diff --git a/ui/src/components/transcript/RunTranscriptView.tsx b/ui/src/components/transcript/RunTranscriptView.tsx index 32727d40..fee3a561 100644 --- a/ui/src/components/transcript/RunTranscriptView.tsx +++ b/ui/src/components/transcript/RunTranscriptView.tsx @@ -93,6 +93,12 @@ type TranscriptBlock = endTs?: string; lines: Array<{ ts: string; text: string }>; } + | { + type: "system_group"; + ts: string; + endTs?: string; + lines: Array<{ ts: string; text: string }>; + } | { type: "stdout"; ts: string; @@ -558,13 +564,19 @@ export function normalizeTranscript(entries: TranscriptEntry[], streaming: boole } continue; } - blocks.push({ - type: "event", - ts: entry.ts, - label: "system", - tone: "warn", - text: entry.text, - }); + // Batch consecutive system events into a single collapsible group + const prev = blocks[blocks.length - 1]; + if (prev && prev.type === "system_group") { + prev.lines.push({ ts: entry.ts, text: entry.text }); + prev.endTs = entry.ts; + } else { + blocks.push({ + type: "system_group", + ts: entry.ts, + endTs: entry.ts, + lines: [{ ts: entry.ts, text: entry.text }], + }); + } continue; } @@ -1260,6 +1272,43 @@ function TranscriptStderrGroup({ ); } +function TranscriptSystemGroup({ + block, + density, +}: { + block: Extract; + density: TranscriptDensity; +}) { + const [open, setOpen] = useState(false); + return ( +
+
setOpen((v) => !v)} + onKeyDown={(e) => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); setOpen((v) => !v); } }} + > + + + {block.lines.length} system {block.lines.length === 1 ? "message" : "messages"} + + {open ? : } +
+ {open && ( +
+          {block.lines.map((line, i) => (
+            
+              {i > 0 ? "\n" : ""}
+              {line.text}
+            
+          ))}
+        
+ )} +
+ ); +} + function TranscriptStdoutRow({ block, density, @@ -1383,6 +1432,7 @@ export function RunTranscriptView({ {block.type === "tool_group" && } {block.type === "diff_group" && } {block.type === "stderr_group" && } + {block.type === "system_group" && } {block.type === "stdout" && ( )}