fix: correct default sidebar state initialization and adjust sidebar width

This commit is contained in:
Roberto Musso
2026-02-20 12:34:23 +01:00
parent 8c1fb54afd
commit 3f1208f5ad
2 changed files with 3 additions and 2 deletions

View File

@@ -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) => {

View File

@@ -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"