Add hidden agent tab intent for workspace reconcile

This commit is contained in:
Mohamed Boudra
2026-04-09 20:39:27 +07:00
parent a236bd4515
commit c7399084a4
5 changed files with 197 additions and 1 deletions
@@ -196,6 +196,7 @@ interface ReorderPaneTabsInLayoutInput {
export interface WorkspaceTabReconcileState {
layout: WorkspaceLayout;
pinnedAgentIds?: ReadonlySet<string> | null;
hiddenAgentIds?: ReadonlySet<string> | null;
}
export interface WorkspaceTabSnapshot {
@@ -1429,6 +1430,7 @@ export function reconcileWorkspaceTabs(
findPaneById(nextLayout.root, nextLayout.focusedPaneId)?.focusedTabId ?? null;
let reconciledFocusedTabId = originalFocusedTabId;
const pinnedAgentIds = new Set(state.pinnedAgentIds ?? []);
const hiddenAgentIds = new Set(state.hiddenAgentIds ?? []);
const activeAgentIds = normalizeStringSet(snapshot.activeAgentIds);
const knownAgentIds = normalizeStringSet(snapshot.knownAgentIds);
const standaloneTerminalIds = normalizeStringSet(snapshot.standaloneTerminalIds);
@@ -1438,6 +1440,9 @@ export function reconcileWorkspaceTabs(
visibleAgentIds.add(agentId);
}
}
for (const agentId of hiddenAgentIds) {
visibleAgentIds.delete(agentId);
}
const initialTabs = collectAllTabs(nextLayout.root);
const representedAgentIds = new Set(initialTabs.filter(isAgentTab).map((tab) => tab.target.agentId));