diff --git a/apps/web/src/app/(authenticated)/layout.tsx b/apps/web/src/app/(authenticated)/layout.tsx index 2580c03..9099d6a 100644 --- a/apps/web/src/app/(authenticated)/layout.tsx +++ b/apps/web/src/app/(authenticated)/layout.tsx @@ -4,10 +4,79 @@ import { useEffect } from "react"; import { useRouter } from "next/navigation"; import { useAuth } from "@/lib/auth/auth-context"; import { IS_MOCK_AUTH_MODE } from "@/lib/config"; -import { Navigation } from "@/components/layout/Navigation"; +import { AppHeader } from "@/components/layout/AppHeader"; +import { AppSidebar } from "@/components/layout/AppSidebar"; +import { SidebarProvider, useSidebar } from "@/components/layout/SidebarContext"; import { ChatOverlay } from "@/components/chat"; +import { MosaicSpinner } from "@/components/ui/MosaicSpinner"; import type { ReactNode } from "react"; +// --------------------------------------------------------------------------- +// Constants +// --------------------------------------------------------------------------- + +const SIDEBAR_EXPANDED_WIDTH = "240px"; +const SIDEBAR_COLLAPSED_WIDTH = "60px"; + +// --------------------------------------------------------------------------- +// Inner shell — must be a child of SidebarProvider to use useSidebar +// --------------------------------------------------------------------------- + +interface AppShellProps { + children: ReactNode; +} + +function AppShell({ children }: AppShellProps): React.JSX.Element { + const { collapsed, isMobile } = useSidebar(); + + // On tablet (md–lg), hide sidebar from the grid when the sidebar is collapsed. + // On mobile, the sidebar is fixed-position so the grid is always single-column. + const sidebarHidden = !isMobile && collapsed; + + return ( +