* feat(app): add ⌘P shortcut to switch project on New Workspace screen Opens the existing project picker with its search focused so the project can be switched from the keyboard (type + Enter) instead of clicking the badge and then the project. Wires a new "workspace.project.pick" action through the standard keyboard pipeline (binding -> route passthrough -> dispatcher), handled by a screen-scoped handler on the New Workspace screen that is only registered while the screen is mounted and there are projects to pick. Because preventDefault only fires when a handler handles the key, ⌘P/Ctrl+P still triggers native print everywhere else. Adds a Settings -> Shortcuts help row (rebindable) and the "Switch project" label across all locales. * test(app): cover project picker shortcut --------- Co-authored-by: Mohamed Boudra <boudra.moha@gmail.com>
60 lines
1.4 KiB
TypeScript
60 lines
1.4 KiB
TypeScript
export type KeyboardFocusScope =
|
|
| "terminal"
|
|
| "message-input"
|
|
| "command-center"
|
|
| "editable"
|
|
| "browser"
|
|
| "other";
|
|
|
|
export type MessageInputKeyboardActionKind =
|
|
| "focus"
|
|
| "send"
|
|
| "dictation-toggle"
|
|
| "dictation-cancel"
|
|
| "dictation-confirm"
|
|
| "voice-toggle"
|
|
| "voice-mute-toggle"
|
|
| "mode-cycle";
|
|
|
|
export type KeyboardActionId =
|
|
| "agent.interrupt"
|
|
| "agent.new"
|
|
| "workspace.tab.new"
|
|
| "workspace.tab.close.current"
|
|
| "workspace.tab.navigate.index"
|
|
| "workspace.tab.navigate.relative"
|
|
| "workspace.pane.split.right"
|
|
| "workspace.pane.split.down"
|
|
| "workspace.pane.focus.left"
|
|
| "workspace.pane.focus.right"
|
|
| "workspace.pane.focus.up"
|
|
| "workspace.pane.focus.down"
|
|
| "workspace.pane.move-tab.left"
|
|
| "workspace.pane.move-tab.right"
|
|
| "workspace.pane.move-tab.up"
|
|
| "workspace.pane.move-tab.down"
|
|
| "workspace.pane.close"
|
|
| "workspace.navigate.index"
|
|
| "workspace.navigate.relative"
|
|
| "sidebar.toggle.left"
|
|
| "sidebar.toggle.right"
|
|
| "sidebar.toggle.both"
|
|
| "settings.toggle"
|
|
| "command-center.toggle"
|
|
| "shortcuts.dialog.toggle"
|
|
| "workspace.terminal.new"
|
|
| "workspace.new"
|
|
| "workspace.project.pick"
|
|
| "worktree.new"
|
|
| "workspace.archive"
|
|
| "workspace.pin"
|
|
| "view.toggle.focus"
|
|
| "theme.cycle"
|
|
| "message-input.action";
|
|
|
|
export type KeyboardShortcutPayload =
|
|
| { index: number }
|
|
| { delta: 1 | -1 }
|
|
| { kind: MessageInputKeyboardActionKind }
|
|
| null;
|