Registry Mirror
Skip to content

Conversation

@flamboh

@flamboh flamboh commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

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

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.

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).

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Dec 2, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Dec 2, 2026
@macroscopeapp

macroscopeapp Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 9d2037c

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.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

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.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: Minimal · previous review 9d203

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 80148ab and 9d2037c.

Files selected for processing: 1

  • apps/web/src/components/settings/KeybindingsSettings.tsx
Files with no reviewable changes: 1

  • apps/web/src/components/settings/KeybindingsSettings.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

@macroscopeapp
macroscopeapp Bot dismissed their stale review December 2, 2026 23:27

Dismissing prior approval to re-evaluate 9d2037c

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Dec 3, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

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.

Before c670bedae6 After 97ff51acb1
Result ❌ failed
ASSERTION_FAILED: expect.toHaveValue failed
locator: getByRole("textbox", name: "When expression")
expected: value "terminalFocus"
observed: value "terminalFocus &&" (match count 1)
✅ passed
invalid draft before close Base c670bedae6: invalid draft before close Head 97ff51acb1: invalid draft before close
immediate reopen Base c670bedae6: immediate reopen Head 97ff51acb1: immediate reopen
failure Base c670bedae6: failure
Recordings Before After
Same scripted interaction Before video After video

Scenario source

Not shown:

  • The subsequent Save click and reopening after persistence were not exercised; this proof covers the immediate-reopen mismatch targeted by the fix.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Dec 3, 2026
@juliusmarminge
juliusmarminge merged commit a8b0c03 into pingdotgg:main Dec 3, 2026
42 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants