Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Modified Escape bindings can now reach existing commands while the palette is open, while bare Escape retains its search-back behavior. The change is confined to UI event routing and leaves default bindings unchanged. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dismissing prior approval to re-evaluate 3fc8855
|
The automated pipeline stopped on this pull request and will not merge it: the fix is written and reviewed, but proving it needs something no worker has:
It stays open for a person to finish or close. |
Problem
When a command palette shortcut such as
usage.openis rebound to a modified Escape chord (for exampleshift+esc), pressing that chord while inside the palette's file or content search silently returns to the command list instead of running the bound command. The palette's capture-phase Escape listener intercepts everyevent.key === "Escape"keydown regardless of modifiers and stops propagation before configured command handlers can run, while the Base UI dialog popup also claimsEscapeat the target before bubble phase.Deterministic repro on
origin/main(7559944b6c5e3e775dad46ebe8aa41468369a6be):{ "key": "shift+esc", "command": "usage.open" }(viaserver.upsertKeybindingorkeybindings.json) in a local workspace.Ctrl+Pto enter the command palette's file search (Search files…), and keep focus in the search input.Escape(returns toSearch commands, projects, and threads...), then pressCtrl+Pto return to file search.Shift+Escape(key: "Escape",shiftKey: true,isComposing: false,repeat: false).BackToCommand) and stays on the thread route;/usagenever opens./usage, while bareEscapestill steps back from file/content search to the command list.Change
Restrict
apps/web/src/shortcuts/commandPaletteCommands.ts's rawBackToCommandcapture handler to unmodified (!metaKey && !ctrlKey && !altKey && !shiftKey)Escapepresses, and wrap the existingregisterCommandscall in a small local helper (registerPaletteCommands) that adds a capture-phase scope for modifiedEscapepresses while the palette is open, reusing the same command handlers, keybindings option, and context in place. This covers both web and desktop (Electron) command palette file/content search and command modes; native mobile does not use the web shortcut dispatcher or command palette search.Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
apps/web/src/shortcuts/commandPaletteCommands.browser.test.tsx):origin/main(7559944b6c5e3e775dad46ebe8aa41468369a6be),vp test run apps/web/src/shortcuts/commandPaletteCommands.browser.test.tsx -t "honors modified Escape bindings"failed withAssertionError: expected "Mock" to be called 1 times, but got 0 times(navigatewas never called afterShift+Escape).0039b2eebcb1e9848b4bda36e88c66d1795e06c0), all 7 tests incommandPaletteCommands.browser.test.tsxpass, verifyingShift+Escape->/usageacrossfiles,content, andcommandmodes ahead of a target popup Escape listener, plus bareEscape->mode: "command".7559944b6c5e(Shift+EscapefromSearch files…bounced back to the command palette instead of/usage) and verified fixed on head (bareEscapereturned to the command palette;Shift+Escapeclosed the palette and opened/usage).origin/main7559944b6c5e)vp run check:changed: Passed (format,lint,knip,typecheckon 2 packages,teston 1 file,react compileron 1 file; exit 0).Authored by Gemini 4 Neon (Antigravity); reviewed by GPT-6.2 Sol (Codex).
Not shown