Registry Mirror
Skip to content

Conversation

@saphid

@saphid saphid commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Problem

When a command palette shortcut such as usage.open is rebound to a modified Escape chord (for example shift+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 every event.key === "Escape" keydown regardless of modifiers and stops propagation before configured command handlers can run, while the Base UI dialog popup also claims Escape at the target before bubble phase.

Deterministic repro on origin/main (7559944b6c5e3e775dad46ebe8aa41468369a6be):

  1. Seed { "key": "shift+esc", "command": "usage.open" } (via server.upsertKeybinding or keybindings.json) in a local workspace.
  2. Open a thread, press Ctrl+P to enter the command palette's file search (Search files…), and keep focus in the search input.
  3. Control: press bare Escape (returns to Search commands, projects, and threads...), then press Ctrl+P to return to file search.
  4. Press Shift+Escape (key: "Escape", shiftKey: true, isComposing: false, repeat: false).
  • Observed: The palette returns to the command list (BackToCommand) and stays on the thread route; /usage never opens.
  • Expected: The palette closes and navigates to /usage, while bare Escape still steps back from file/content search to the command list.

Change

Restrict apps/web/src/shortcuts/commandPaletteCommands.ts's raw BackToCommand capture handler to unmodified (!metaKey && !ctrlKey && !altKey && !shiftKey) Escape presses, and wrap the existing registerCommands call in a small local helper (registerPaletteCommands) that adds a capture-phase scope for modified Escape presses 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

  • Regression test (apps/web/src/shortcuts/commandPaletteCommands.browser.test.tsx):
    • On unmodified origin/main (7559944b6c5e3e775dad46ebe8aa41468369a6be), vp test run apps/web/src/shortcuts/commandPaletteCommands.browser.test.tsx -t "honors modified Escape bindings" failed with AssertionError: expected "Mock" to be called 1 times, but got 0 times (navigate was never called after Shift+Escape).
    • On head (0039b2eebcb1e9848b4bda36e88c66d1795e06c0), all 7 tests in commandPaletteCommands.browser.test.tsx pass, verifying Shift+Escape -> /usage across files, content, and command modes ahead of a target popup Escape listener, plus bare Escape -> mode: "command".
  • Real-app E2E proof (Chromium + T3 Code web server): Repro'd in the live app on base 7559944b6c5e (Shift+Escape from Search files… bounced back to the command palette instead of /usage) and verified fixed on head (bare Escape returned to the command palette; Shift+Escape closed the palette and opened /usage).
Before (origin/main 7559944b6c5e) After (fixed)
Before: Shift+Escape returns to Command Palette on thread route After: Shift+Escape closes palette and opens /usage
  • vp run check:changed: Passed (format, lint, knip, typecheck on 2 packages, test on 1 file, react compiler on 1 file; exit 0).
  • Evidence transcript & captures: https://gist.github.com/saphid/37062699dddbc529eefd2e59e0b1d6a8
  • Not shown: Real-app E2E proof exercised Chromium file search only; live-app content-search and command-mode flows (both covered in the browser shortcut test), the Electron desktop shell wrapper, and macOS keyboard layouts were not separately run end-to-end.

Authored by Gemini 4 Neon (Antigravity); reviewed by GPT-6.2 Sol (Codex).

Not shown

  • before-after-transcript.md:4 — The published test, real-app after run, and check:changed transcript identify the earlier head 286a629e1ccf, not 0039b2eebcb1. Label the existing captures with their actual revision and attach SHA-tagged current-head test and check output, or distinguish the submitted current-head results from the older public evidence.
  • before-after-transcript.md:46 — The file-search repro reaches a visible route assertion, but the evidence does not include a runnable scenarios:prove fixture or exact invocation. Link that fixture or state that automated replay was not independently verified.

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

macroscopeapp Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 3fc8855

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.

@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The command palette now captures modified Escape shortcuts while open. Its child-palette handler ignores modified Escape presses. Browser tests cover command execution and palette behavior for modified and bare Escape.

Changes: Modified Escape Handling

Layer / File(s) Summary
Modified Escape handling and coverage
apps/web/src/shortcuts/commandPaletteCommands.ts, apps/web/src/shortcuts/commandPaletteCommands.browser.test.tsx
The palette registers commands for modified Escape in a capture-phase scope while retaining their original scope. The child-palette handler ignores modified Escape. Browser tests cover modified Escape in files, content, and command modes, and bare Escape in files mode.

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

Change: Bug fix

Suggested reviewers: chenxin-yan

Merge Risk: Minimal · up to 3fc88

This change lets configured modified-Escape shortcuts run while the command palette is open, and bare Escape still returns to command mode. No concrete merge-blocking risk was found in the reviewed change.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: modified Escape bindings are now honored in the command palette search. It follows conventional commit form and matches the objectives and the summarized changes to co…
Description check Passed The description follows the template sections (Problem, Change, Scope, Verification) and gives a reproducible problem, a clear change, a scope justification, and detailed verification. It also flags i…
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: modified Escape bindings are now honored in the command palette search. It follows conventional commit form and matches the objectives and the summarized changes to commandPaletteCommands.ts. It is specific enough for a teammate scanning history.

Full details: Description check

Explanation

The description follows the template sections (Problem, Change, Scope, Verification) and gives a reproducible problem, a clear change, a scope justification, and detailed verification. It also flags its own gaps. The verification evidence refers to an earlier head SHA (286a629e1ccf) rather than the current head (0039b2eebcb1), and the live-app E2E covers only Chromium file search. The author must label or refresh that evidence and link or disclose the replay fixture. These gaps are notable but do not make the description largely incomplete.

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 4d3fba6 and 3fc8855.

Files selected for processing: 1

  • apps/web/src/shortcuts/commandPaletteCommands.ts

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

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Dec 3, 2026
@macroscopeapp
macroscopeapp Bot dismissed their stale review December 3, 2026 12:58

Dismissing prior approval to re-evaluate 3fc8855

@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Dec 3, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

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:

  • Permanent blocker: a stable Replay provider model was unavailable in the scenario runner; therefore the command-palette interaction and the before/after behavior could not be captured.

It stays open for a person to finish or close.

@juliusmarminge juliusmarminge added takeover:blocked Takeover blocked; reason in the PR body and removed takeover:in-progress A takeover lead is working on this PR labels Dec 3, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). takeover:blocked Takeover blocked; reason in the PR body 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