refactor: use confirmDialog and unique draft agent IDs

This commit is contained in:
Mohamed Boudra
2026-03-04 15:28:55 +07:00
parent f47ea7afe5
commit 430ad54d77
5 changed files with 58 additions and 48 deletions
@@ -4,8 +4,6 @@ import {
parseHostWorkspaceTabRouteFromPathname,
} from "@/utils/host-routes";
const DRAFT_AGENT_ID = "__new_agent__";
export function resolveSelectedOrRouteAgentKey(input: {
selectedAgentId?: string;
pathname: string;
@@ -22,7 +20,7 @@ export function resolveSelectedOrRouteAgentKey(input: {
return agentId ? `${workspaceTabRoute.serverId}:${agentId}` : null;
}
if (tabId.startsWith("draft_")) {
return `${workspaceTabRoute.serverId}:${DRAFT_AGENT_ID}`;
return `${workspaceTabRoute.serverId}:${tabId}`;
}
}