fix(tui): keep read result on the dim-Markdown body path

A read result now carries card:'read', but render()'s genericContent gate was
card==='generic' only, so the read body kept its text yet lost the dim-Markdown
dimBody treatment the generic card gave it. Admit card:'read' to that gate so
its content fallback takes the same dim path, restoring read's TUI rendering to
what it was before the read card existed. Refresh the parallel-file-reads TUI
golden accordingly and correct the Note's TUI claim on both language sides.
This commit is contained in:
Chinesezjc
2026-07-30 18:50:48 +08:00
parent 35bd2de2a9
commit 76b3ba1f79
5 changed files with 17 additions and 5 deletions

View File

@@ -389,7 +389,13 @@ export class ToolCardComponent implements Component {
const glyph = this.result === undefined ? '○' : '●'
const rawBody = this.renderBody()
const view = this.resultView ?? this.callView
const genericContent = view.card === 'generic' ? view.content ?? this.result?.content : undefined
// A generic card carries its UI content on the view; a read card is the same
// for the TUI, which has no dedicated read rendering — its `content`
// fallback (the envelope-stripped file text) takes the generic dim-Markdown
// body, so read output is unchanged from before the read card existed.
const genericContent = view.card === 'generic' || view.card === 'read'
? view.content ?? this.result?.content
: undefined
const unknownXml = this.definition === undefined && genericContent !== undefined
? renderUnknownXml(
displayText(contentText(genericContent)),