Repository navigation
fix(web): mod+w closes a side chat tab from inside the side chat - #28973
zapagenrevdale wants to merge 1 commit into
Conversation
The main chat ignored every key pressed in a side chat, so mod+w did nothing on desktop. Let rightPanel.close through; other side-chat keys stay isolated.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — The existing close-tab shortcut now works from inside a side chat, while other parent-chat shortcuts remain blocked there. It reuses the established close behavior and safeguards, with no material new exposure identified. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Filter shortcuts by side-chat focus apps/web/src/components/chat/useChatShortcuts.ts, apps/web/src/lib/sideChatPane.ts |
The handler skips type-to-focus handling when focus is in the side chat pane. It allows only rightPanel.close to proceed. A comment describing the previous behavior was removed; that file’s behavior is unchanged. |
Cover side-chat shortcut behavior apps/web/src/components/chat/useChatShortcuts.browser.test.tsx |
The test wrapper accepts optional keybindings, commands, and children. Tests verify that mod+w invokes rightPanel.close from the composer and message region, while other tested shortcuts remain unhandled by the parent. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related issues
pingdotgg/t3code#28905— This issue concerns shortcuts in the side chat. The reported Cmd+F search shortcut remains unimplemented by this change.
Suggested reviewers: t3dotgg, juliusmarminge
Merge Risk: 
Minimal · up to 6483c
-
Side-chat closing and typing isolation have no identified merge-blocking issue.
Pre-merge checks: 
4
-
Full details: Description check
-
Explanation
The description covers the problem, expected behavior, fix, scope rationale, focused tests, manual verification, screenshots or recordings, and untested platforms. It contains several typographical and formatting errors, but it is sufficiently complete and directly related to the change.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Problem
On desktop, pressing mod+w with focus inside a side chat (its messages or its composer) does nothing. The keybindings guide says mod+w "closes the focused terminal or the active right-panel tab", with no exception for side chats.
The main chat's window shortcut listener (
useChatShortcuts) returned early for any key event inside[data-side-chat-pane]. The side chat itself only handles its composer chords, sorightPanel.closehad no handler while a side chat had focus.#26901 meant to keep thread-level commands out of the side chat ("Thread-level commands stay off in the side chat"). Panel shortcuts like mod+w were never discussed, so blocking them looks like a side effect of the catch-all guard, not intent. Shortcuts handled outside ChatView (sidebar toggle, new chat, mod+shift+t) already work from a side chat.
This is a small fix for an obvious bug: documented behavior missing in one focus state, one guard changed, no new behavior.
Fix
The main chat still ignores side-chat keys for type-to-focus and for every command except
rightPanel.close. Thread stop, r chords stay isolated as before.Thread-find Escape and paste-to-focus still skip the side chat.Verification
useChatShortcuts.browser.test.tsxwith a case for focus in the side chat composer and the side chat messagd+w runs the parent'srightPanel.closeand prevents default, that typing doesn't jump to the main composer, andthat ctrl+shift+x doesn't stop thes fail on
main(expected [] to deeply equal [ 'close' ]) and pass with the fix.vp test run src/components/char.test.tsx: 9/9 pass.vp run check:changed: format, lint, knip, typecheck, tests and the React compiler checkall pass.
composer, pressed Cmd+W, and the ing stayed in the side chat.Recording below.
before: when side chat is focused, cant exit via mod+w unless tab for that chat session is clicked
before-trimmed.mp4
after: mod + w closes side chat on focus.
after-trimmed.mp4
Not checked:
rightPanel.close(browsers reserve mod+w, per the keybindings guide). The fix covers any binding, and the test isn't tied to one, but I didn't try it in a real browser.Written with Claude Opus 5.5 via t3code