diff --git a/src/components/ProjectSidebar.tsx b/src/components/ProjectSidebar.tsx index a6a0efbc..2c3a1635 100644 --- a/src/components/ProjectSidebar.tsx +++ b/src/components/ProjectSidebar.tsx @@ -95,9 +95,17 @@ export function ProjectSidebar({ const navigate = useNavigate(); + // Custom navigate function that closes sidebar on mobile + const navigateAndClose = (path: string) => { + navigate(path); + if (isMobile && onClose) { + onClose(); + } + }; + const handleNewProject = () => { onSelectProject(null); - navigate('/'); + navigateAndClose('/'); }; const handleToggleSidebar = () => { @@ -122,7 +130,7 @@ export function ProjectSidebar({