Uh oh!
There was an error while loading. Please reload this page.
feat(web): mod+w closes the active right panel tab before the window - #9363
Conversation
Mod+W only closed a focused terminal; anywhere else it fell straight through to the desktop close-window accelerator, so closing a stack of right-panel tabs meant reaching for the mouse. Add a `rightPanel.close` command bound to `mod+w` when the terminal is not focused. It closes the active right-panel tab through the existing close path (so terminal and agent-browser confirmations still apply), one tab per press, and leaves the event alone once nothing is open so the shortcut keeps its native meaning. The pull-requests page's shared panel handles the command itself since it renders no ChatView. Co-Authored-By: Claude Code <noreply@anthropic.com>
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds a new default You can add or adjust custom eligibility rules. Learn more. |
Problem
Mod+Wonly closed a focused terminal. Anywhere else it fell straight through to the desktop close-window accelerator, so closing a stack of right-panel tabs (diff, files, browser, PR) meant reaching for the mouse — or losing the window by accident.Fix
Add a
rightPanel.closekeybinding command, bound by default tomod+wwhen the terminal is not focused (the existingterminal.closerule keeps winning while it is).closeRightPanelSurfacepath so terminal-close and agent-controlled-browser confirmations still apply.ChatView.WebContentsViewalready forwards mod+W to the main window.Browsers reserve
mod+wand never deliver it to the page; that was already true ofterminal.close. Docs note the rebind.Testing
apps/web/src/keybindings.test.ts: mod+w resolves toterminal.closewith terminal focus andrightPanel.closeotherwise.apps/server/src/keybindings.test.ts: default binding present.apps/webtypecheck clean; targeted lint has no new findings.Model: Claude Fable 5 via Claude Code.
🤖 Generated with Claude Code
Note
Low Risk
Keyboard UX and default bindings only; behavior is gated on panel/terminal focus and falls through to native close when nothing is open.
Overview
Adds a
rightPanel.closekeybinding (defaultmod+wwhen the terminal is not focused) so users can dismiss right-panel tabs from the keyboard without immediately triggering close-window.mod+wnow resolves toterminal.closewith terminal focus andrightPanel.closeotherwise. ChatView handles the command by closing the active right-panel surface through the existing close path, skipping key repeat, and leaving the event untouched when no panel is open so desktop mod+w still closes the window. The pull-requests route registers the same shortcut locally because it does not mount ChatView.Contracts, shared defaults, server/web tests, and user keybinding docs are updated (including browser mod+w rebind guidance).
Reviewed by Cursor Bugbot for commit 14e8bb0. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add
rightPanel.closecommand bound tomod+wwith terminal-focus precedencerightPanel.closeto the static keybinding command registry and maps it tomod+wwith a context gate so it only applies whenterminalFocusis false; the existingterminal.closerule keeps terminal precedenceChatView; ifrightPanel.closeis not the resolved command it leaves the event untouched, so check the terminal-focus context resolution in pull-requests.tsx for regressionsMacroscope summarized 14e8bb0.