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.
This commit is contained in:
1 file changed
+4
-4
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user