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
@@ -128,6 +128,18 @@ describe("keyboard-shortcuts", () => {
context: { isMac: true },
action: "agent.new",
},
{
name: "matches Cmd+N to create new workspace on mac",
event: { key: "n", code: "KeyN", metaKey: true },
context: { isMac: true, commandCenterOpen: false },
action: "workspace.new",
},
{
name: "matches Ctrl+N to create new workspace on non-mac",
event: { key: "n", code: "KeyN", ctrlKey: true },
context: { isMac: false, commandCenterOpen: false, focusScope: "other" },
action: "workspace.new",
},
{
name: "matches question-mark shortcut to toggle the shortcuts dialog",
event: { key: "?", code: "Slash", shiftKey: true },
@@ -564,6 +576,7 @@ describe("keyboard-shortcut help sections", () => {
context: { isMac: true, isDesktop: true },
expectedKeys: {
"new-agent": ["mod", "shift", "O"],
"new-workspace": ["mod", "N"],
"workspace-tab-new": ["mod", "T"],
"workspace-jump-index": ["mod", "1-9"],
"workspace-tab-jump-index": ["mod", "alt", "1-9"],