From 783e7c38cec14a18958f8d974599cd6a76dbc067 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 18 Sep 2025 16:55:13 -0500 Subject: [PATCH] Close the mobile sidebar when navigating to self page --- src/components/ProjectSidebar.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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({