Skip to content

feat: customizable tab navigation shortcuts + close-tab focus fix#7

Open
ChrisLi826 wants to merge 3 commits into
craig7351:mainfrom
ChrisLi826:feat/tab-shortcuts
Open

feat: customizable tab navigation shortcuts + close-tab focus fix#7
ChrisLi826 wants to merge 3 commits into
craig7351:mainfrom
ChrisLi826:feat/tab-shortcuts

Conversation

@ChrisLi826
Copy link
Copy Markdown

Summary

  • New: move tabs with Ctrl+Shift+PageUp/PageDown (wraps around at both ends).
  • New: rebind tab navigation in Settings → ⌨ Hotkeys. All four actions (prev / next / move-left / move-right) accept multiple bindings each; press + Add then any key combo. Bindings persist in localStorage; Reset / Reset all restore the previous hardcoded defaults.
  • Fix: Ctrl+Shift+W now focuses the right-hand neighbor instead of always jumping to the last tab.
  • Bump version to v1.0.9.

Implementation

  • src/stores/shortcuts.ts (new): binding store, actionFor(event) lookup, localStorage persistence.
  • src/App.tsx: capture-phase keydown handler now dispatches via actionFor instead of hardcoded conditions.
  • src/components/SettingsDialog.tsx: Hotkeys pane gains an editable section; remaining shortcuts stay read-only.
  • src/stores/tabs.ts: closeTab captures the closed index before removal and clamps to remaining.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/PageDown moves the active tab and wraps from first↔last.
  • Existing Shift+↑/↓ and Ctrl+PageUp/Down still cycle tabs.
  • Settings → Hotkeys: add a custom binding, restart, verify it persists; Reset all restores defaults.
  • Close a middle tab via Ctrl+Shift+W → focus moves to the next tab to the right (not the last).
  • Close the last tab → focus moves to the new last tab.

🤖 Generated with Claude Code

ChrisLi and others added 3 commits May 15, 2026 16:39
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant