Compare commits

...
Author SHA1 Message Date
Cursor Agent c0aed107dc Fix missing terminal focus bump after close and clarify toggleOpen predicate
- Add setTerminalFocusRequestId bump in closeTerminal for non-final tabs,
  matching the pattern used by splitTerminal and createNewTerminal.
- Refactor toggleOpen to use a named 'next' variable so the predicate reads
  identically to setOpen, reducing maintenance hazard.
2026-04-16 00:47:58 +00:00
2 changed files with 7 additions and 4 deletions

No files matched your search

+4 -4
View File
@@ -18,10 +18,10 @@ export const useCommandPaletteStore = create<CommandPaletteStore>((set) => ({
workspaceTarget: null,
setOpen: (open) => set({ open, ...(open ? {} : { workspaceTarget: null }) }),
toggleOpen: () =>
set((state) => ({
open: !state.open,
...(!state.open ? {} : { workspaceTarget: null }),
})),
set((state) => {
const next = !state.open;
return { open: next, ...(next ? {} : { workspaceTarget: null }) };
}),
openWorkspaceTarget: (target) => set({ open: true, workspaceTarget: target }),
clearWorkspaceTarget: () => set({ workspaceTarget: null }),
}));
+3
View File
@@ -1371,6 +1371,9 @@ export default function ChatView(props: ChatViewProps) {
if (activeThreadRef) {
storeCloseTerminal(activeThreadRef, terminalId);
}
if (!isFinalTerminal) {
setTerminalFocusRequestId((current) => current + 1);
}
},
[
activeThreadId,