Preserve any agent tab when switching agents in sidebar
Remove hardcoded validTabs set and pass through whatever tab segment is in the current URL. This makes tab preservation work for all current and future agent tabs. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
4f49c8a2b9
commit
d84399aebe
1 changed files with 1 additions and 3 deletions
|
|
@ -78,8 +78,6 @@ export function SidebarAgents() {
|
|||
const activeAgentId = agentMatch?.[1] ?? null;
|
||||
const activeTab = agentMatch?.[2] ?? null;
|
||||
|
||||
// Valid agent detail tabs — preserve across agent switches
|
||||
const validTabs = new Set(["dashboard", "instructions", "prompts", "skills", "configuration", "configure", "budget", "runs"]);
|
||||
|
||||
return (
|
||||
<Collapsible open={open} onOpenChange={setOpen}>
|
||||
|
|
@ -116,7 +114,7 @@ export function SidebarAgents() {
|
|||
return (
|
||||
<NavLink
|
||||
key={agent.id}
|
||||
to={activeTab && validTabs.has(activeTab) ? `${agentUrl(agent)}/${activeTab}` : agentUrl(agent)}
|
||||
to={activeTab ? `${agentUrl(agent)}/${activeTab}` : agentUrl(agent)}
|
||||
onClick={() => {
|
||||
if (isMobile) setSidebarOpen(false);
|
||||
}}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue