import { useState, type ReactNode } from "react"; import { Database, Flask, List, SidebarSimple, SignOut, X } from "@phosphor-icons/react"; import { SidebarContent } from "./Sidebar"; import { useAuth } from "@/context/AuthContext"; import { useSettings } from "@/context/SettingsContext"; import { useLocalStorage } from "@/hooks/useLocalStorage"; import { cn } from "@/lib/utils"; /** * Workspace shell: a floating glass island nav on top, the thread in the * centre, and the source/ingest rail on the right. The rail is collapsible on * desktop (state persists across reloads) and becomes the off-canvas drawer * below `lg`. */ export function AppShell({ nav, children }: { nav?: ReactNode; children: ReactNode }) { const [open, setOpen] = useState(false); const [railOpen, setRailOpen] = useLocalStorage("rr_rail_open", true); const { session, logout } = useAuth(); const { kbOnly, setKbOnly } = useSettings(); return (
{/* First tab stop: lets keyboard users bypass the nav and the rail. */} Skip to main content {/* Ambient wash — single accent hue, no purple. */}
{/* Floating island nav */}
ResearchRAG
{nav && }
{/* Desktop-only: below `lg` the rail is the drawer, which has its own trigger on the left of the island. */}
{/* Thread + rail — full bleed, so the rail stays flush with the right edge. Collapsing it hands the whole width back to the thread. */}
{children}
{/* Mobile drawer */} {open && (
setOpen(false)} />
)}
); }