diff --git a/frontend/src/components/AppLayout.tsx b/frontend/src/components/AppLayout.tsx index dbcad4a..5c8dfbf 100644 --- a/frontend/src/components/AppLayout.tsx +++ b/frontend/src/components/AppLayout.tsx @@ -70,10 +70,16 @@ export function AppLayout({ children }: { children: ReactNode }) { {navItems.map((item) => { const showGroup = item.group && item.group !== lastGroup; lastGroup = item.group; + // Check if another nav item is a more specific match (child route) + const hasMoreSpecificMatch = navItems.some( + (other) => other.to !== item.to && other.to.startsWith(item.to + '/') && currentPath.startsWith(other.to), + ); const active = item.to === '/' ? currentPath === '/' - : currentPath.startsWith(item.to); + : hasMoreSpecificMatch + ? currentPath === item.to + : currentPath === item.to || currentPath.startsWith(item.to + '/'); return (