From 3f1208f5adf01ce1174434ba4e6becbe28725641 Mon Sep 17 00:00:00 2001 From: Roberto Musso Date: Fri, 20 Feb 2026 12:34:23 +0100 Subject: [PATCH] fix: correct default sidebar state initialization and adjust sidebar width --- src/renderer/components/layout/AppShell.tsx | 3 ++- src/renderer/components/ui/sidebar.tsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/layout/AppShell.tsx b/src/renderer/components/layout/AppShell.tsx index 80dae71..1061c86 100644 --- a/src/renderer/components/layout/AppShell.tsx +++ b/src/renderer/components/layout/AppShell.tsx @@ -45,8 +45,9 @@ export function AppShell({ children }: AppShellProps) { const currentPath = routerState.location.pathname; // Controlled open state (spec: "Controlled Sidebar" pattern) + // Default to collapsed (false) until the persisted preference loads const [open, setOpen] = useState(() => - collapsedQuery.data === undefined ? true : !collapsedQuery.data + collapsedQuery.data === undefined ? false : !collapsedQuery.data ); const handleOpenChange = (value: boolean) => { diff --git a/src/renderer/components/ui/sidebar.tsx b/src/renderer/components/ui/sidebar.tsx index dcb7737..2b4e0dc 100644 --- a/src/renderer/components/ui/sidebar.tsx +++ b/src/renderer/components/ui/sidebar.tsx @@ -27,7 +27,7 @@ import { const SIDEBAR_COOKIE_NAME = "sidebar_state" const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7 -const SIDEBAR_WIDTH = "16rem" +const SIDEBAR_WIDTH = "12rem" const SIDEBAR_WIDTH_MOBILE = "18rem" const SIDEBAR_WIDTH_ICON = "3rem" const SIDEBAR_KEYBOARD_SHORTCUT = "b"