From fc52f7f4cf9c95061321855ec7f81f083fabcb4e Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 15 Apr 2026 00:53:04 +0000 Subject: [PATCH] Fix: move command palette open check before workspace command dispatch Workspace commands (via isWorkspaceCommandId) and standalone terminal commands were dispatched before the useCommandPaletteStore.getState().open guard, causing shortcuts like Mod+W, Mod+[, Mod+] to fire while the command palette dialog was open. Move the palette check to run immediately after resolving the shortcut command, consistent with the guard pattern in ChatView.tsx. --- apps/web/src/routes/_chat.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/web/src/routes/_chat.tsx b/apps/web/src/routes/_chat.tsx index 55e1f2b285..36a45c05f1 100644 --- a/apps/web/src/routes/_chat.tsx +++ b/apps/web/src/routes/_chat.tsx @@ -42,6 +42,10 @@ function ChatRouteGlobalShortcuts() { terminalOpen, }, }); + if (useCommandPaletteStore.getState().open) { + return; + } + const isFocusedStandaloneTerminal = focusedWorkspaceSurface?.kind === "terminal"; if (command && isWorkspaceCommandId(command)) { event.preventDefault(); @@ -73,10 +77,6 @@ function ChatRouteGlobalShortcuts() { } } - if (useCommandPaletteStore.getState().open) { - return; - } - if (event.key === "Escape" && selectedThreadKeysSize > 0) { event.preventDefault(); clearSelection();