diff --git a/ui/src/components/AppShell.tsx b/ui/src/components/AppShell.tsx index d7b1634f..a8fc0f4b 100644 --- a/ui/src/components/AppShell.tsx +++ b/ui/src/components/AppShell.tsx @@ -18,7 +18,7 @@ export function AppShell({ user, title, description, backTo, children }: AppShel
-
+
{backTo && ( +
-
{control}
+
{control}
); } diff --git a/ui/src/components/AppSidebar.tsx b/ui/src/components/AppSidebar.tsx index a4752133..84684b18 100644 --- a/ui/src/components/AppSidebar.tsx +++ b/ui/src/components/AppSidebar.tsx @@ -51,6 +51,7 @@ export function AppSidebar({ user }: { user: SessionUser }) {
- - - + + +
@@ -99,10 +116,12 @@ function ThreadGroup({ label, threads, activeThreadId, + onNavigate, }: { label: string; threads: Array; activeThreadId?: string; + onNavigate?: () => void; }) { if (threads.length === 0) return null; @@ -112,13 +131,26 @@ function ThreadGroup({ {label}
{threads.map((thread) => ( - + ))}
); } -function ThreadRow({ thread, isActive }: { thread: AgentThread; isActive: boolean }) { +function ThreadRow({ + thread, + isActive, + onNavigate, +}: { + thread: AgentThread; + isActive: boolean; + onNavigate?: () => void; +}) { const deleteThread = useDeleteAgentThread(); const badge = thread.diffStats && thread.diffStats.additions > 0 @@ -141,6 +173,7 @@ function ThreadRow({ thread, isActive }: { thread: AgentThread; isActive: boolea setCollapsed(!collapsed), [collapsed, setCollapsed]); - return { width, collapsed, setWidth, setCollapsed, toggle }; + const closeOnMobile = useCallback(() => { + if (typeof window === "undefined") return; + // State-only: don't persist, so the desktop collapsed preference is preserved. + if (window.matchMedia("(max-width: 767px)").matches) setCollapsedState(true); + }, []); + + return { width, collapsed, setWidth, setCollapsed, toggle, closeOnMobile }; } interface SidebarFrameProps { @@ -76,10 +85,16 @@ export function SidebarFrame({ return ( ); }