You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Settings → Keybindings, type an invalid When expression (like terminalFocus &&), press Esc, and reopen the editor right away. The box still shows the invalid text, but Save is enabled. Saving writes the last valid expression, not what you see.
#24488 resets the row to valid when the editor closes, assuming closing unmounts the builder and drops its unparsed text. It doesn't during the popover's exit animation: a reopen in that window gets the same builder back, text and all.
Fix
WhenClauseControl keys the builder by an open counter, so every open mounts a fresh builder that starts from the last valid expression. The close-time validity reset stays. Existing rows and the New keybinding row share this control, so both are covered.
Scope and approval
Small, obvious bug in one component. No issue filed. No contract, server, or mobile changes (mobile has no keybindings screen).
Verification
KeybindingsSettings.browser.test.tsx now loads app CSS, so the popover has its real exit animation. The existing test "re-enables Save when a When editor closes on an expression it could not parse" reopens right after Esc. It fails on main (box still shows terminalFocus &&) and passes with the fix. All 12 tests in the file pass.
vp run check:changed passes.
Real app on a dev box, main vs this branch. Animations slowed 3× so the reopen lands inside the exit animation on camera.
What to look for: before, reopening right after Esc brings back the invalid text while Save is enabled; after, it shows terminalFocus, the value Save writes.
Made with Claude Opus 5.5 in Claude Code (T3 Code).
Macroscope's review found this PR approvable — Reopening the When editor now resets its text to the current valid value rather than retaining a discarded draft. The change is limited to editor state and leaves saving behavior and product defaults unchanged.
You can add or adjust custom eligibility rules. Learn more.
Reviewing files that changed from the base of the PR and between 9d2037c and 97ff51a.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The condition editor now remounts each time its popover opens. The browser test also imports the application stylesheet.
Changes: When-clause editor
Layer / File(s)
Summary
Reset editor on reopen apps/web/src/components/settings/KeybindingsSettings.tsx, apps/web/src/components/settings/KeybindingsSettings.browser.test.tsx
WhenClauseControl increments an open counter and passes it as the WhenExpressionBuilder key. Closing still marks the draft valid. The browser test imports ~/index.css.
This fixes a case where reopening the When editor during its exit animation could show invalid text with Save enabled. The change is small and local to the keybindings settings control, and no merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(web): reopening a When editor right after closing it shows what Save will write" follows conventional commit format and describes the main change: the fix for the When editor showing st…
Description check
The description follows the template well. It has a Problem section with expected behavior and reproduction steps, a Change section explaining the open-counter keying of the builder, a Scope section e…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "fix(web): reopening a When editor right after closing it shows what Save will write" follows conventional commit format and describes the main change: the fix for the When editor showing stale invalid text on quick reopen while Save writes the last valid expression. The raw summary confirms WhenClauseControl now keys WhenExpressionBuilder by an open counter, so each reopen remounts the builder. The title is specific and matches the changeset, though it is somewhat long at 83 characters.
Full details: Description check
Explanation
The description follows the template well. It has a Problem section with expected behavior and reproduction steps, a Change section explaining the open-counter keying of the builder, a Scope section explaining why no issue is linked and that it is a small bug fix, and a Verification section with specific tests, the observed before/after result, and a recording link. The description states the test now loads app CSS, which matches the raw summary. The template's comment-style guidance about the agent model line is satisfied by the NOTE naming the model. No linked issue is provided, but the author explains why one is not needed, which the template allows for small obvious fixes.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
Environment: real web app, Chromium 156 on Linux, 1280×800, light theme, fresh isolated databases and synthetic demo project seeded with t3.project; no real user data.
On both commits: open Settings → Keybindings; edit When for Terminal: Toggle; fill terminalFocus, then type && to show the parse error and disabled Save; press Escape and immediately click the same When trigger; capture the reopened editor. Base shows terminalFocus && with the parse error while Save is enabled; head shows terminalFocus with Save enabled.
Scenario: Reopening the When editor shows the expression Save will write
Proven: the scenario fails on base c670bedae6 and passes on head 97ff51acb1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:XS0-9 changed lines (additions + deletions).vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
🤖 Claude Opus 5.5 on behalf of Oliver
Problem
In Settings → Keybindings, type an invalid When expression (like
terminalFocus &&), press Esc, and reopen the editor right away. The box still shows the invalid text, but Save is enabled. Saving writes the last valid expression, not what you see.#24488 resets the row to valid when the editor closes, assuming closing unmounts the builder and drops its unparsed text. It doesn't during the popover's exit animation: a reopen in that window gets the same builder back, text and all.
Fix
WhenClauseControlkeys the builder by an open counter, so every open mounts a fresh builder that starts from the last valid expression. The close-time validity reset stays. Existing rows and the New keybinding row share this control, so both are covered.Scope and approval
Small, obvious bug in one component. No issue filed. No contract, server, or mobile changes (mobile has no keybindings screen).
Verification
KeybindingsSettings.browser.test.tsxnow loads app CSS, so the popover has its real exit animation. The existing test "re-enables Save when a When editor closes on an expression it could not parse" reopens right after Esc. It fails on main (box still showsterminalFocus &&) and passes with the fix. All 12 tests in the file pass.vp run check:changedpasses.https://gh-file-drop-api-prod-galwoqjslzlnws6s.oliver-boorstein.workers.dev/f/caadff4c99f8190c/sbs.mp4
What to look for: before, reopening right after Esc brings back the invalid text while Save is enabled; after, it shows
terminalFocus, the value Save writes.Made with Claude Opus 5.5 in Claude Code (T3 Code).