fix: propagate tab-switch shortcuts from FreshClaude panes#173
fix: propagate tab-switch shortcuts from FreshClaude panes#173mvanhorn wants to merge 2 commits intodanshapiro:mainfrom
Conversation
ChatComposer now explicitly handles Ctrl+Shift+[ and Ctrl+Shift+] to switch tabs, matching the pattern used by TerminalView. This ensures tab switching works reliably when the FreshClaude textarea has focus. Fixes danshapiro#162
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b10b55169
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (e.ctrlKey && e.shiftKey && !e.altKey && !e.metaKey) { | ||
| if (e.code === 'BracketLeft') { | ||
| e.preventDefault() | ||
| dispatch(switchToPrevTab()) | ||
| return |
There was a problem hiding this comment.
Stop duplicate tab-switch dispatch from chat composer shortcut
Dispatching switchToPrevTab()/switchToNextTab() here without stopping propagation causes the same keydown to be handled again by App’s window-level shortcut listener (src/App.tsx keyboard handler around lines 999-1004), because preventDefault() does not stop bubbling. In FreshClaude textareas this results in two tab-switch actions per keypress (e.g., with 2 tabs it appears to do nothing, with 3+ tabs it skips a tab), which is a functional regression introduced by this change.
Useful? React with 👍 / 👎.
preventDefault alone does not stop event bubbling - the keydown still reaches App's window-level shortcut listener, causing two tab-switch actions per keypress. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
customKeyEventHandlerFixes #162
Changes
src/components/agent-chat/ChatComposer.tsx: Added Ctrl+Shift+[/] handling inhandleKeyDownthat dispatchesswitchToPrevTab()/switchToNextTab()test/unit/client/components/agent-chat/ChatComposer.test.tsx: Added 3 tests for tab-switch shortcut behaviorTest plan
npm run typecheckpassesagent-chat-tab-shortcut-focus.test.tsxpassesThis contribution was developed with AI assistance (Claude Code).