From 2f8c021819bedb5b47a44cf50350e83c902a992c Mon Sep 17 00:00:00 2001 From: orangecoding Date: Sat, 13 Jun 2026 13:17:19 +0200 Subject: [PATCH] ability to jump back to main menu when clicking on nav bar and on submenu --- ui/src/components/navigation/Navigation.jsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ui/src/components/navigation/Navigation.jsx b/ui/src/components/navigation/Navigation.jsx index bfa3ebd..99ec384 100644 --- a/ui/src/components/navigation/Navigation.jsx +++ b/ui/src/components/navigation/Navigation.jsx @@ -92,8 +92,15 @@ export default function Navigation({ isAdmin }) { items={items} isCollapsed={collapsed} selectedKeys={[parsePathName(location.pathname)]} - onSelect={(key) => { - navigate(key.itemKey); + onClick={({ itemKey }) => { + // Use onClick (fires on every click) instead of onSelect (skips the + // already-selected item) so clicking e.g. "Jobs" while on a nested + // route like /jobs/edit/:id still navigates back to the list. Only + // leaf routes navigate; parent items (keys without a leading '/') just + // toggle their submenu. + if (typeof itemKey === 'string' && itemKey.startsWith('/')) { + navigate(itemKey); + } }} header={