Add keyboard shortcut to create a new workspace

Cmd+N (Ctrl+N off mac) navigates to the new-workspace route through a
global handler keyed on the active host. The sidebar header row surfaces
the shortcut hint on hover, replacing the redundant "+" button that
duplicated the action in the Workspaces section header.
This commit is contained in:
Mohamed Boudra
2026-06-16 16:13:03 +07:00
parent e77c8e2bf3
commit 88b48c9d09
17 changed files with 106 additions and 39 deletions
@@ -120,6 +120,7 @@ const SHORTCUT_HELP_SECTION_LABEL_KEYS: Record<ShortcutSectionId, string> = {
const SHORTCUT_HELP_LABEL_KEYS: Record<string, string> = {
"new-agent": "settings.shortcuts.help.openProject",
"new-workspace": "settings.shortcuts.help.newWorkspace",
"new-worktree": "settings.shortcuts.help.newWorktree",
"archive-worktree": "settings.shortcuts.help.archiveWorktree",
"workspace-tab-new": "settings.shortcuts.help.newTab",
@@ -190,6 +191,32 @@ const SHORTCUT_BINDINGS: readonly ShortcutBinding[] = [
},
},
// --- New workspace ---
{
id: "workspace-new-cmd-n-mac",
action: "workspace.new",
combo: "Cmd+N",
when: { mac: true, commandCenter: false },
help: {
id: "new-workspace",
section: "projects",
label: "New workspace",
keys: ["mod", "N"],
},
},
{
id: "workspace-new-ctrl-n-non-mac",
action: "workspace.new",
combo: "Ctrl+N",
when: { mac: false, commandCenter: false, terminal: false },
help: {
id: "new-workspace",
section: "projects",
label: "New workspace",
keys: ["mod", "N"],
},
},
// --- New worktree ---
{
id: "worktree-new-cmd-o-mac",