From e9a3ae8da81506226f1c11317930afbbae266477 Mon Sep 17 00:00:00 2001 From: Illia Panasenko Date: Sun, 26 Jul 2026 14:24:20 +0200 Subject: [PATCH 1/2] fix(web): persist the Settled shelf's collapsed state Collapsing Settled in Sidebar V2 read as a lasting preference but was component state, so every relaunch brought the history back. Move it to the useLocalStorage hook used for other client-only UI prefs, defaulting to expanded so nothing changes for anyone who hasn't collapsed it. --- apps/web/src/components/SidebarV2.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/SidebarV2.tsx b/apps/web/src/components/SidebarV2.tsx index e36a4407072..702b2f88f29 100644 --- a/apps/web/src/components/SidebarV2.tsx +++ b/apps/web/src/components/SidebarV2.tsx @@ -1,4 +1,5 @@ import { autoAnimate } from "@formkit/auto-animate"; +import * as Schema from "effect/Schema"; import { useAtomValue } from "@effect/atom-react"; import { canSnooze, @@ -88,6 +89,7 @@ import { openCommandPalette } from "../commandPaletteBus"; import { startNewThreadFromContext } from "../lib/chatThreadActions"; import { useClientSettings, useUpdateClientSettings } from "../hooks/useSettings"; import { useCopyToClipboard } from "../hooks/useCopyToClipboard"; +import { useLocalStorage } from "../hooks/useLocalStorage"; import { useNowMinute } from "../hooks/useNowMinute"; import { useEnvironments, usePrimaryEnvironmentId } from "../state/environments"; import { useProjects, useThreadShells } from "../state/entities"; @@ -167,6 +169,9 @@ import { useComposerDraftStore } from "../composerDraftStore"; // stays behind an explicit Show more. const SETTLED_TAIL_INITIAL_COUNT = 10; const SETTLED_TAIL_PAGE_COUNT = 25; +// Collapsing Settled is a lasting preference — someone who tucks history away +// doesn't want it back on the next launch. +const SETTLED_SHELF_EXPANDED_KEY = "t3code:sidebar-v2:settled-expanded"; const PROJECT_GROUPING_MODE_LABELS: Record = { repository: "Group by repository", repository_path: "Group by repository path", @@ -1571,8 +1576,15 @@ export default function SidebarV2() { () => setSettledVisibleCount((count) => count + SETTLED_TAIL_PAGE_COUNT), [], ); - const [settledShelfExpanded, setSettledShelfExpanded] = useState(true); - const toggleSettledShelf = useCallback(() => setSettledShelfExpanded((value) => !value), []); + const [settledShelfExpanded, setSettledShelfExpanded] = useLocalStorage( + SETTLED_SHELF_EXPANDED_KEY, + true, + Schema.Boolean, + ); + const toggleSettledShelf = useCallback( + () => setSettledShelfExpanded((value) => !value), + [setSettledShelfExpanded], + ); const renderedSettledThreads = useMemo(() => { if (settledShelfExpanded) return visibleSettledThreads; if (routeThreadKey === null) return []; From f575c749132bc3f1782c3a52bfe512ea28b1b652 Mon Sep 17 00:00:00 2001 From: Pixel Perfect Date: Fri, 31 Jul 2026 10:37:20 -0700 Subject: [PATCH 2/2] fix(web): persist the Snoozed shelf's collapsed state --- apps/web/src/components/SidebarV2.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/SidebarV2.tsx b/apps/web/src/components/SidebarV2.tsx index 702b2f88f29..b5ba88d8b71 100644 --- a/apps/web/src/components/SidebarV2.tsx +++ b/apps/web/src/components/SidebarV2.tsx @@ -172,6 +172,7 @@ const SETTLED_TAIL_PAGE_COUNT = 25; // Collapsing Settled is a lasting preference — someone who tucks history away // doesn't want it back on the next launch. const SETTLED_SHELF_EXPANDED_KEY = "t3code:sidebar-v2:settled-expanded"; +const SNOOZED_SHELF_EXPANDED_KEY = "t3code:sidebar-v2:snoozed-expanded"; const PROJECT_GROUPING_MODE_LABELS: Record = { repository: "Group by repository", repository_path: "Group by repository path", @@ -1598,8 +1599,15 @@ export default function SidebarV2() { // The snoozed shelf is collapsed by default: out of the way, never gone. // Collapsed threads don't render (and so don't participate in jump // shortcuts or multi-select), matching the settled tail's paging model. - const [snoozedShelfExpanded, setSnoozedShelfExpanded] = useState(false); - const toggleSnoozedShelf = useCallback(() => setSnoozedShelfExpanded((value) => !value), []); + const [snoozedShelfExpanded, setSnoozedShelfExpanded] = useLocalStorage( + SNOOZED_SHELF_EXPANDED_KEY, + false, + Schema.Boolean, + ); + const toggleSnoozedShelf = useCallback( + () => setSnoozedShelfExpanded((value) => !value), + [setSnoozedShelfExpanded], + ); const visibleSnoozedThreads = useMemo(() => { if (snoozedShelfExpanded) return snoozedThreads; // The open thread must never vanish behind the collapsed shelf: a