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.
This commit is contained in:
2 files changed
+7
-4
No files matched your search
@@ -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 }),
|
||||
}));
|
||||
@@ -1371,6 +1371,9 @@ export default function ChatView(props: ChatViewProps) {
|
||||
if (activeThreadRef) {
|
||||
storeCloseTerminal(activeThreadRef, terminalId);
|
||||
}
|
||||
if (!isFinalTerminal) {
|
||||
setTerminalFocusRequestId((current) => current + 1);
|
||||
}
|
||||
},
|
||||
[
|
||||
activeThreadId,
|
||||
|
||||
Reference in new issue
Block a user