diff --git a/apps/ui/src/components/layout/sidebar.tsx b/apps/ui/src/components/layout/sidebar.tsx index 6cdb32cd..0baa81cf 100644 --- a/apps/ui/src/components/layout/sidebar.tsx +++ b/apps/ui/src/components/layout/sidebar.tsx @@ -20,7 +20,10 @@ import { SidebarHeader, SidebarNavigation, SidebarFooter, + MobileSidebarToggle, } from './sidebar/components'; +import { useIsCompact } from '@/hooks/use-media-query'; +import { PanelLeftClose } from 'lucide-react'; import { TrashDialog, OnboardingDialog } from './sidebar/dialogs'; import { SIDEBAR_FEATURE_FLAGS } from './sidebar/constants'; import { @@ -44,9 +47,11 @@ export function Sidebar() { trashedProjects, currentProject, sidebarOpen, + mobileSidebarHidden, projectHistory, upsertAndSetCurrentProject, toggleSidebar, + toggleMobileSidebarHidden, restoreTrashedProject, deleteTrashedProject, emptyTrash, @@ -57,6 +62,8 @@ export function Sidebar() { setSpecCreatingForProject, } = useAppStore(); + const isCompact = useIsCompact(); + // Environment variable flags for hiding sidebar items const { hideTerminal, hideRunningAgents, hideContext, hideSpecEditor } = SIDEBAR_FEATURE_FLAGS; @@ -255,10 +262,16 @@ export function Sidebar() { return location.pathname === routePath; }; + // Check if sidebar should be completely hidden on mobile + const shouldHideSidebar = isCompact && mobileSidebarHidden; + return ( <> + {/* Floating toggle to show sidebar on mobile when hidden */} + + {/* Mobile backdrop overlay */} - {sidebarOpen && ( + {sidebarOpen && !shouldHideSidebar && (