T-IMOO-pane-toggle-keybindings
Status: closed/done · Impact: medium · Complexity: medium
Give the shell’s panes keyboard toggle/focus (e.g. Ctrl+1–4) without a second global listener: panes register through the existing command registry so dispatch and the command palette stay coordinated.
| Location | Role today |
|---|---|
packages/ts/shell/app/composables/useKeybindings.ts | A single route-scoped window keydown dispatcher over usePlatform().commands, matching via utils/chords.ts. |
packages/ts/panes/src/PaneGroup.vue | Exposes its controller (toggle/collapse/focus/resize) via defineExpose, but owns no keyboard. |
packages/ts/shell/app/layouts/default.vue | Will host the pane group (T-E078-layout-host-pane-shell); registers no pane commands. |
Proposed
Section titled “Proposed”The shell registers pane commands (shell.togglePane.secondary, shell.togglePane.aux,
shell.focusPane.main, and so on) with keybindings through usePlatform(), so useKeybindings
dispatches them like any command. Each command drives the layout-hosted PaneGroup controller. No
new window listener; the commands are active only when the pane group is mounted.
Approach
Section titled “Approach”- Capture the layout-hosted
PaneGroupcontroller (its exposed ref) in the shell layout. - Add
usePaneCommands(controller)that registers toggle/focus commands with chords (Ctrl+1–4 or the determined convention) throughusePlatform(). - Ensure the commands unregister or no-op when no pane group is mounted, and do not collide with the command palette or existing chords.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
packages/ts/shell/app/composables/usePaneCommands.ts | new | register pane toggle/focus commands + chords |
packages/ts/shell/app/layouts/default.vue | modify | wire the pane-group controller into usePaneCommands |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: The configured chord toggles/focuses each pane through the command registry, with no second window listener added.
- AC-2: The bindings are inert when no pane group is mounted and do not shadow the command palette or existing chords.
- AC-3: Pane commands are registered in
usePlatform().commands(discoverable like other commands).
Out of scope
Section titled “Out of scope”- Layout-hosting the pane group — T-E078-layout-host-pane-shell (prerequisite).
- Persistence — T-ARPY-persist-pane-state.