Skip to content

fix(web): a held Esc in a nested panel control no longer closes the right panel sheet - #42262

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/web-right-panel-sheet-held-escape
Nov 24, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/web-right-panel-sheet-held-escape

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

On a narrow window, where the right panel opens as a sheet, holding Esc to close an open menu, select, popover, or dialog inside the panel (for example the "Add panel surface" menu) closes that menu and then, on the key's next repeat, closes the whole right panel.

The right panel sheet (apps/web/src/components/RightPanelSheet.tsx) now ignores Esc key repeats, the same way the Usage and Settings modal does since #42224. A single Esc press still closes it.

Before and after

Before After
Add panel surface menu open Before: the right panel sheet with the Add panel surface menu open After: the right panel sheet with the Add panel surface menu open
Held Esc Before: holding Esc closes the menu and then the right panel sheet After: holding Esc closes only the menu; the right panel sheet stays open

Testing

An AI agent ran these checks:

  • Added a browser test to RightPanelSheet.browser.test.tsx: opens a menu inside the sheet, presses Esc once to close the menu, sends a repeated Esc to verify the sheet stays open, and presses a fresh Esc to close it. It fails on main at the repeat step and passes 3/3 runs on this branch. The existing FileBrowserPanel sheet tests pass.
  • vp run check:changed passes.
  • Real-app check in Linux Chrome against an isolated dev server (vp run dev --no-seed) at a 900px-wide window: opened the right panel, opened "Add panel surface", then pressed Esc and its key repeats (the sheet stays open; a fresh Esc closes it). On main, the sheet closes on the first repeat.

Generated with Gemini 4 Neon in T3 Code Nightly

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 24, 2026
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

RightPanelSheet now ignores opening notifications and cancels close notifications caused by repeated Escape keydowns. The browser test checks that closing a nested menu does not close the sheet, while a subsequent non-repeated Escape does.

Changes: Right panel Escape handling

Layer / File(s) Summary
Handle Escape close notifications
apps/web/src/components/RightPanelSheet.tsx, apps/web/src/components/RightPanelSheet.browser.test.tsx
RightPanelSheet ignores opening notifications, cancels close notifications caused by repeated Escape, and calls onClose for other close notifications. The browser test checks nested-menu dismissal followed by sheet dismissal.

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

Change: Bug fix · Severity of issue fixed: Low

Possibly related PRs

  • pingdotgg/t3code#41790: This PR applies a repeated-Escape ignore rule to the Files sheet and attachment preview dialog.

Suggested labels: bugfix

Suggested reviewers: maria-rcks, macroscopeapp

Merge Risk: Minimal · up to be04a

Merge Risk: ⚪ Minimal · up to be04a

Holding Esc in a nested control inside the right panel sheet should no longer close the sheet, and a fresh Esc press still closes it. The change is small and localized, with no concrete merge-blocking risk identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a held Esc in a nested panel control no longer closes the right panel sheet. It follows the conventional commit form and matches the raw summary, which says the sheet …
Description check Passed The description follows the template. It states the problem with reproduction steps (narrow window, holding Esc). It explains the change (RightPanelSheet ignores Esc repeats, as the Usage and Settings…
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 names the main change: a held Esc in a nested panel control no longer closes the right panel sheet. It follows the conventional commit form and matches the raw summary, which says the sheet now cancels repeated Escape-key dismissals, and the PR objectives.

Full details: Description check

Explanation

The description follows the template. It states the problem with reproduction steps (narrow window, holding Esc). It explains the change (RightPanelSheet ignores Esc repeats, as the Usage and Settings modal does). It links prior work (#42224) and gives before and after images. Its Testing section lists a browser test, the existing FileBrowserPanel sheet tests, check:changed, and a real-app check with the environment. The Scope section is missing: it does not link an issue for the bug or say why no issue is needed. The template also asks for the model and harness that did the work. The author gives 'Gemini 4 Neon in T3 Code Nightly' at the end, so that item is covered.

Resolution

Optionally add a Scope note: link the issue that shows the bug, or say why a small fix needs no issue.

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 90e6e3e and a6c04d7.

Files selected for processing: 2

  • apps/web/src/components/RightPanelSheet.browser.test.tsx
  • apps/web/src/components/RightPanelSheet.tsx

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

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 24, 2026
…heet-held-escape

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Proven with the real web app in Chromium 156 on Linux, 900×800, light theme, fresh synthetic state and Replay (dev). The same scenario ran on both commits; scenarios:prove exited 0.

Steps: open the thread → Toggle right panel → Add panel surface → Escape keydown closes the menu → three repeated Escape keydowns before keyup. On base the sheet closes; on head it remains open. On head, keyup followed by a fresh Escape press closes the sheet.

Capture Before: 90e6e3e69d After: be04a0d9f8
Result Sheet disappears after repeated Escape; visibility assertion fails Sheet stays open; visibility assertion passes
Nested menu open Before: nested menu open After: nested menu open
First Escape Before: first Escape leaves sheet open After: first Escape leaves sheet open
Held Escape Before: held Escape closes sheet After: held Escape leaves sheet open
Failure capture Before: sheet absent at assertion failure
Release and fresh Escape After: fresh Escape closes sheet
Recording Before recording, interaction at approximately 0:24 After recording, interaction at approximately 0:16

Reproduction scenario.

Not shown:

  • Desktop Electron shell was not run; this proof covers the shared web component in Chromium.

@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 Nov 24, 2026
@juliusmarminge
juliusmarminge merged commit e62e512 into pingdotgg:main Nov 24, 2026
52 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 24, 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:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants