feat(shortcuts): add Cmd+1-9 to jump to task by sidebar position#97
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thank you very much for this! Code ReviewReviewed end-to-end (binding wiring, matchers, Linux behavior, tests). Two critical findings before this can merge — the headline one is that the shortcut never fires on any platform. Critical — shortcut never fires
For the digit row, Fix: Critical — test does not exercise the binding
Suggestion: add one integration test that dispatches a synthetic Important — Linux + non-US layoutsOnce On Linux, Minor
VerdictNeeds changes. After the |
…integration tests
- Bindings used e.code format ("Digit1") but matchers compare against e.key ("1"),
so jump-to-task shortcuts never fired on any platform
- Add shift-key variants for each digit so AZERTY/non-US layouts work (mirrors
the existing Cmd+0 reset-zoom shift variant pattern)
- Add integration tests in shortcuts.test.ts that verify the binding fires on
key="1" and does not fire on key="Digit1" (regression guard)
- Update defaults.test.ts expected IDs to include jump-to-task and shift variants
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Changes in response to reviewCritical fix — shortcut never fired: Changed AZERTY / non-US layout support: Added shift variants for each digit (e.g. Integration tests: Added two tests to Tested and working — Cmd+1 through Cmd+9 now correctly jump to tasks by sidebar position. |
…f registry - jumpToTask now indexes store.taskOrder (left-to-right tile order in the main area), so Cmd+N matches what the user sees in the tile layout and what Cmd+Left/Right cycles through. Previously it indexed computeSidebarTaskOrder which regroups by project, causing Cmd+N to land on a different task than the visually Nth tile when projects are interleaved. This also incidentally fixes the collapsed-task surprise: taskOrder excludes collapsed tasks, so Cmd+N can no longer activate a task hidden inside a collapsed project group. - Move the AZERTY shift variants from defaults.ts to a new registerJumpToTaskShortcuts() in shortcuts.ts, mirroring the Cmd+0 reset-zoom precedent. This keeps the keybindings UI from showing 9 duplicate "Jump to task N" rows. - Add an integration test for the AZERTY shift path (key="1", shift=true) and a unit test pinning that jumpToTask ignores collapsedTaskOrder. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Thank you very much! Pushed 1. The previous Now all three navigation paths agree: 2. AZERTY shift variants moved out of the keybindings registry. The shift variants in Tests: added one unit test pinning Not included: the sidebar |
|
Thank you! <3 |
Summary
Cmd+1throughCmd+9keyboard shortcuts to jump directly to the Nth task in the sidebarglobal: trueso they fire even when a terminal has focusImplementation
src/store/navigation.ts— newjumpToTask(index)function usingcomputeSidebarTaskOrder()src/lib/keybindings/defaults.ts— 9 new bindings (app.nav.jump-to-task-1…app.nav.jump-to-task-9)src/store/store.ts— exportsjumpToTaskthrough the store barrelsrc/App.tsx— wires the 9 action strings to handlersTest plan
Cmd+2— second task in sidebar becomes activeCmd+1— first task becomes activeCmd+9with fewer than 9 tasks — no crash, no changeCmd+2— still switches task (global shortcut)npm test— all 312 tests pass (5 new tests insrc/store/navigation.test.ts)🤖 Generated with Claude Code