From 3271000ea45ad3b12a8bb71af750663d543b965e Mon Sep 17 00:00:00 2001 From: amosblomqvist Date: Wed, 2 Sep 2026 17:32:19 +0300 Subject: [PATCH] Fleet panel gains a collapsed rail view in lockstep with the plan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The right sidebar's mode (rail | list | graph) is now shared state: a new useTreePanelMode() hook lets every sidebar section collapse and expand together. With sub-agents running in rail mode the fleet shows a quiet strip — bot icon (click expands the sidebar) + vertical 'N running' count — mirroring the plan rail's node-count strip below it. The sidebar now collapses all the way regardless of running jobs. End-to-end verified through the real flow (dispatch part in the transcript + running job record, the 1s jobs poll rendering the panel): rail column exactly w-10 with both rails stacked and aligned (40px), the fleet rail's expand click transitions to list mode and persists, fleet + plan panels equal widths in list (256/256) and graph (384/384) modes, 9-node graph intact, console clean. --- components/sub-agents-panel.tsx | 32 ++++++++++++++++++++++++++++++++ components/tree-panel.tsx | 8 +++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/components/sub-agents-panel.tsx b/components/sub-agents-panel.tsx index ead8bb9..4e644e0 100644 --- a/components/sub-agents-panel.tsx +++ b/components/sub-agents-panel.tsx @@ -2,6 +2,7 @@ import { BotIcon, PenToolIcon, PlayIcon, SearchIcon } from "lucide-react"; import type { JobKind, JobRecord } from "@/src/core"; +import { useTreePanelMode } from "@/components/tree-panel"; /** * The sub-agents sidebar section (vision §2.5 live observability): what the @@ -20,9 +21,40 @@ const KIND_META: Record = { visual: { label: "Figure maker", Icon: PenToolIcon }, }; +/** The collapsed fleet: a quiet strip on the sidebar rail — bot icon + + * running count, exactly like the plan's node-count rail below it. Click + * expands the sidebar back to the full fleet list. */ +function SubAgentsRail({ count, onExpand }: { count: number; onExpand: () => void }) { + return ( +
+ + + {count} running + +
+ ); +} + export function SubAgentsPanel({ jobs }: { jobs: JobRecord[] }) { + const { mode, go } = useTreePanelMode(); const running = jobs.filter((j) => j.status === "running"); if (running.length === 0) return null; + if (mode === "rail") + return go("list")} />; return (