From f50df103116b2e97a648247898a5f7f46cd3bf85 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 22 Sep 2026 00:54:57 +0100 Subject: [PATCH] Guard the second manage-agents handler before its side effects too The previous commit claimed both handlers, but only the first one changed: the search text expected `if (...) return;` on a single line while prettier had already wrapped it across two, so the second replacement silently matched nothing. A ctrl/cmd/shift-click on the collapsed-list entry therefore still closed the mobile nav and cleared the selected agent in the tab it left behind. --- frontend/src/Navigation.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index 87367af8..283026f3 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -646,11 +646,11 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { to={AGENTS_MANAGE_ROOT} end onClick={(event) => { - closeNavOnMobile(); - dispatch(setSelectedAgent(null)); if (event.metaKey || event.ctrlKey || event.shiftKey) return; event.preventDefault(); + closeNavOnMobile(); + dispatch(setSelectedAgent(null)); goToLevel(AGENTS_MANAGE_ROOT); }} className={({ isActive }) =>