feat(web): render agent reports as safe-subset Markdown
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
b7cbc06567
commit
41e3647f0a
3 files changed
+370
-2
No files matched your search
@@ -36,6 +36,7 @@ import { ApprovalCard, type ApprovalCardStatus } from "~/components/agentui/appr
|
||||
import { type CitationItem, CitationList } from "~/components/agentui/citations.tsx";
|
||||
import { CHEVRON_CLASS, Disclosure } from "~/components/agentui/disclosure.tsx";
|
||||
import { FileDiff } from "~/components/agentui/file-diff.tsx";
|
||||
import { Markdown } from "~/components/agentui/markdown.tsx";
|
||||
import {
|
||||
Message,
|
||||
MessageAvatar,
|
||||
@@ -427,7 +428,8 @@ export function AgentConversation({
|
||||
announce={false}
|
||||
showActions={!active && idx === lastText}
|
||||
>
|
||||
{it.text}
|
||||
{/* 流式中按原文显示(半截 Markdown 会闪),结束后按安全子集渲染 */}
|
||||
{streaming ? it.text : <Markdown text={it.text} />}
|
||||
</StreamingResponse>
|
||||
</AssistantRow>
|
||||
);
|
||||
@@ -724,7 +726,7 @@ export function FinalReport({
|
||||
模型说的(未经核查)
|
||||
</p>
|
||||
<StreamingResponse status="complete" copyText={said || undefined} contentClassName="max-h-60 overflow-auto">
|
||||
{said || "(没有文字汇报)"}
|
||||
{said ? <Markdown text={said} /> : "(没有文字汇报)"}
|
||||
</StreamingResponse>
|
||||
<p className="mt-2 text-meta text-muted-foreground">仅供参考,不作为完成依据。</p>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user