Compare commits

...
Author SHA1 Message Date
Cursor AgentandJulius Marminge 41556cccd2 Fix sidebar terminal shortcut state subscription
Co-authored-by: Julius Marminge <[email protected]>
2026-06-04 16:17:47 +00:00
+9 -14
View File
@@ -2810,6 +2810,11 @@ export default function Sidebar() {
select: (params) => resolveThreadRouteRef(params),
});
const routeThreadKey = routeThreadRef ? scopedThreadKey(routeThreadRef) : null;
const activeThreadTerminalOpen = useTerminalUiStateStore((state) =>
routeThreadRef
? selectThreadTerminalUiState(state.terminalUiStateByThreadKey, routeThreadRef).terminalOpen
: false,
);
const keybindings = useServerKeybindings();
const openAddProjectCommandPalette = useCommandPaletteStore((store) => store.openAddProject);
const [expandedThreadListsByProject, setExpandedThreadListsByProject] = useState<
@@ -2926,15 +2931,10 @@ export default function Sidebar() {
const getCurrentSidebarShortcutContext = useCallback(
() => ({
terminalFocus: isTerminalFocused(),
terminalOpen: routeThreadRef
? selectThreadTerminalUiState(
useTerminalUiStateStore.getState().terminalUiStateByThreadKey,
routeThreadRef,
).terminalOpen
: false,
terminalOpen: activeThreadTerminalOpen,
modelPickerOpen,
}),
[modelPickerOpen, routeThreadRef],
[activeThreadTerminalOpen, modelPickerOpen],
);
const newThreadShortcutLabelOptions = useMemo(
() => ({
@@ -3134,15 +3134,10 @@ export default function Sidebar() {
const sidebarShortcutContext = useMemo(
() => ({
terminalFocus: false,
terminalOpen: routeThreadRef
? selectThreadTerminalUiState(
useTerminalUiStateStore.getState().terminalUiStateByThreadKey,
routeThreadRef,
).terminalOpen
: false,
terminalOpen: activeThreadTerminalOpen,
modelPickerOpen,
}),
[modelPickerOpen, routeThreadRef],
[activeThreadTerminalOpen, modelPickerOpen],
);
const threadJumpLabelByKey = useMemo(
() =>