feat: customizable tab navigation shortcuts + close-tab focus fix#7
Open
ChrisLi826 wants to merge 3 commits into
Open
feat: customizable tab navigation shortcuts + close-tab focus fix#7ChrisLi826 wants to merge 3 commits into
ChrisLi826 wants to merge 3 commits into
Conversation
Add Ctrl+Shift+PageUp/PageDown to move the active tab left/right (with wrap-around), and expose all four tab-navigation actions (prev/next/move-left/move-right) for rebinding in Settings → Hotkeys. Bindings persist via localStorage; each action accepts multiple bindings and ships with the previous hardcoded defaults (Shift+ArrowUp/Down, Ctrl+PageUp/Down, Ctrl+Shift+PageUp/Down). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Ctrl+Shift+W was jumping to the last tab regardless of which tab was closed. Capture the closed tab's index before removal and pick the next index (clamped to remaining length), so closing tab N selects tab N+1 (or the new last tab if N was already last). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ctrl+Shift+PageUp/PageDown(wraps around at both ends).localStorage; Reset / Reset all restore the previous hardcoded defaults.Ctrl+Shift+Wnow focuses the right-hand neighbor instead of always jumping to the last tab.Implementation
src/stores/shortcuts.ts(new): binding store,actionFor(event)lookup, localStorage persistence.src/App.tsx: capture-phase keydown handler now dispatches viaactionForinstead of hardcoded conditions.src/components/SettingsDialog.tsx: Hotkeys pane gains an editable section; remaining shortcuts stay read-only.src/stores/tabs.ts:closeTabcaptures the closed index before removal and clamps toremaining.length - 1.Other hotkeys (Ctrl+Shift+T, Ctrl+1–9, Ctrl+Shift+P, etc.) remain hardcoded; same pattern can extend to them later.
Test plan
Ctrl+Shift+PageUp/PageDownmoves the active tab and wraps from first↔last.Shift+↑/↓andCtrl+PageUp/Downstill cycle tabs.Ctrl+Shift+W→ focus moves to the next tab to the right (not the last).🤖 Generated with Claude Code