From 4ed1e0b9cdb1c9e42c7e2741cb4ac9b4095d1ae9 Mon Sep 17 00:00:00 2001 From: Andrew Blakeslee Moore Date: Mon, 6 Jul 2026 18:27:25 -0700 Subject: [PATCH] Transcript Incremental Projection Nucleic-Session: 0FFD007B-0696-4517-9429-129C7B0FD5AC Co-authored-by: Nucleic --- .../Views/Transcript/TranscriptProjection.swift | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/NucleicRemote/NucleicRemote/Views/Transcript/TranscriptProjection.swift b/NucleicRemote/NucleicRemote/Views/Transcript/TranscriptProjection.swift index 64ae655..6f52da4 100644 --- a/NucleicRemote/NucleicRemote/Views/Transcript/TranscriptProjection.swift +++ b/NucleicRemote/NucleicRemote/Views/Transcript/TranscriptProjection.swift @@ -579,4 +579,21 @@ extension JSONValue { default: return false } } + + /// A one-line gist of a tool input/result for the collapsed row. Lives here (not with the + /// row views) because the projection folds it into `.raw` bodies, and this file also builds + /// standalone as the host-testable `NucleicRemoteProjection` SwiftPM target. + var compactSummary: String { + switch self { + case .string(let s): return s + case .object(let o): + if let cmd = o["command"]?.stringValue { return cmd } + if let path = o["file_path"]?.stringValue ?? o["path"]?.stringValue { return path } + return o.keys.sorted().joined(separator: ", ") + case .array(let a): return "[\(a.count) items]" + case .number(let n): return String(n) + case .bool(let b): return String(b) + case .null: return "null" + } + } }