From 32ab26a30b08d84507336bd902f89078ae4a9297 Mon Sep 17 00:00:00 2001 From: Chinesezjc Date: Fri, 31 Jul 2026 10:58:19 +0800 Subject: [PATCH] fix(tui): route read card content through renderBody's stripped-content path The master merge added a web card whose renderBody content narrow checked only card === 'generic', so a read card fell through to the raw result content and rendered the full // envelope instead of the envelope-stripped text. Include card === 'read' in that narrow, mirroring the markdownContent selection in render(); the parallel-file-reads terminal golden is byte-for-byte unchanged. --- packages/ui/tui/src/components/transcript.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/ui/tui/src/components/transcript.ts b/packages/ui/tui/src/components/transcript.ts index 29a9b33769..81225bdc76 100644 --- a/packages/ui/tui/src/components/transcript.ts +++ b/packages/ui/tui/src/components/transcript.ts @@ -518,11 +518,12 @@ export class ToolCardComponent implements Component { // rather than under the dim result-output color. return { prelude: [...hunks, footer], lines: [] } } - // The web card carries no `content` copy, so a `web` result view falls back - // to the raw result content here (`view.card === 'generic'` narrows the - // generic union arm; a `web` card takes the same fallback, mirroring the - // `markdownContent` selection in render()). - const content = (view.card === 'generic' ? view.content : undefined) ?? this.result?.content + // A generic or read card carries its own envelope-stripped `content`; a `web` + // card carries no `content` copy and falls back to the raw result content + // here. (Mirrors the `markdownContent` selection in render(); a read card has + // no dedicated TUI rendering, so its `content` takes the same body path, + // keeping read output as it was before the read card existed.) + const content = (view.card === 'generic' || view.card === 'read' ? view.content : undefined) ?? this.result?.content const prelude: string[] = [] const lines: string[] = [] // The presenter title headlines the body now that the header is a fixed