feat(FN-687): add markdown rendering to agent log viewer

- Add ReactMarkdown component to AgentLogViewer for rendering markdown content in agent logs
- Remove className prop from ReactMarkdown for v10 compatibility (fix)
- Add comprehensive tests for markdown rendering in agent log
- Consolidate test files by removing redundant InlineCreateCard and QuickEntryBox tests
This commit is contained in:
gsxdsm
2026-04-02 09:48:40 -07:00
parent 437c4734dd
commit fe7e535edb
2 changed files with 114 additions and 2 deletions

View File

@@ -1,6 +1,8 @@
import type { AgentLogEntry } from "@fusion/core";
import { ProviderIcon } from "./ProviderIcon";
import { useRef, useEffect } from "react";
import ReactMarkdown from "react-markdown";
import remarkGfm from "remark-gfm";
interface ModelInfo {
provider?: string;
@@ -190,7 +192,10 @@ export function AgentLogViewer({ entries, loading, executorModel, validatorModel
opacity: 0.7,
}}
>
{agentBadge}{entry.text}
{agentBadge}
<ReactMarkdown remarkPlugins={[remarkGfm]}>
{entry.text}
</ReactMarkdown>
</span>
);
}
@@ -258,7 +263,10 @@ export function AgentLogViewer({ entries, loading, executorModel, validatorModel
// Default: text entries
return (
<span key={i} className="agent-log-text">
{agentBadge}{entry.text}
{agentBadge}
<ReactMarkdown remarkPlugins={[remarkGfm]}>
{entry.text}
</ReactMarkdown>
</span>
);
})}