Tighten Escape agent interrupt shortcut

This commit is contained in:
Mohamed Boudra
2026-04-22 12:52:47 +07:00
parent 6edf19c7c6
commit fc86ce2a5f
9 changed files with 175 additions and 30 deletions
@@ -280,11 +280,10 @@ describe("keyboard-shortcuts", () => {
payload: { kind: "voice-mute-toggle" },
},
{
name: "lets Escape continue to local handlers while routing dictation cancel",
name: "routes Escape to agent interrupt outside terminal focus",
event: { key: "Escape", code: "Escape" },
context: { focusScope: "message-input" },
action: "message-input.action",
payload: { kind: "dictation-cancel" },
action: "agent.interrupt",
preventDefault: false,
stopPropagation: false,
},
@@ -353,6 +352,16 @@ describe("keyboard-shortcuts", () => {
event: { key: "d", code: "KeyD", metaKey: true },
context: { isMac: true, focusScope: "terminal" },
},
{
name: "does not interrupt agent when terminal is focused",
event: { key: "Escape", code: "Escape" },
context: { focusScope: "terminal" },
},
{
name: "does not interrupt agent when command center is open",
event: { key: "Escape", code: "Escape" },
context: { commandCenterOpen: true },
},
{
name: "does not bind pane shortcuts on non-mac platforms",
event: { key: "\\", code: "Backslash", ctrlKey: true },