From f98d8212139a2432b908a03ec944b7487f69b3d6 Mon Sep 17 00:00:00 2001 From: dotta Date: Wed, 18 Mar 2026 06:31:42 -0500 Subject: [PATCH] Preserve active tab when switching agents in sidebar When clicking a different agent in the sidebar, the current tab (prompts, skills, configuration, budget, runs) is now preserved in the navigation URL instead of always defaulting to dashboard. Falls back to default agent URL for non-tab paths (e.g. specific run detail pages). Co-Authored-By: Paperclip Co-Authored-By: Claude Opus 4.6 --- ui/src/components/SidebarAgents.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/src/components/SidebarAgents.tsx b/ui/src/components/SidebarAgents.tsx index 5b438f0a..0b34f3a0 100644 --- a/ui/src/components/SidebarAgents.tsx +++ b/ui/src/components/SidebarAgents.tsx @@ -74,8 +74,12 @@ export function SidebarAgents() { return sortByHierarchy(filtered); }, [agents]); - const agentMatch = location.pathname.match(/^\/(?:[^/]+\/)?agents\/([^/]+)/); + const agentMatch = location.pathname.match(/^\/(?:[^/]+\/)?agents\/([^/]+)(?:\/([^/]+))?/); const activeAgentId = agentMatch?.[1] ?? null; + const activeTab = agentMatch?.[2] ?? null; + + // Valid agent detail tabs — preserve across agent switches + const validTabs = new Set(["dashboard", "prompts", "skills", "configuration", "configure", "budget", "runs"]); return ( @@ -112,7 +116,7 @@ export function SidebarAgents() { return ( { if (isMobile) setSidebarOpen(false); }}