diff --git a/packages/collab-web/CHANGELOG.md b/packages/collab-web/CHANGELOG.md index 3476f6e80..6d2f872a7 100644 --- a/packages/collab-web/CHANGELOG.md +++ b/packages/collab-web/CHANGELOG.md @@ -12,6 +12,9 @@ ### Removed - Removed custom visualization for the search_tool_bm25 tool, which now falls back to generic rendering. +### Fixed + +- Rendered user and host transcript messages as Markdown and separated adjacent assistant content blocks. ([#5559](https://github.com/can1357/oh-my-pi/issues/5559)) ## [16.5.1] - 2026-07-14 diff --git a/packages/collab-web/src/components/transcript/Transcript.tsx b/packages/collab-web/src/components/transcript/Transcript.tsx index 947883ee1..1e8e960ee 100644 --- a/packages/collab-web/src/components/transcript/Transcript.tsx +++ b/packages/collab-web/src/components/transcript/Transcript.tsx @@ -54,19 +54,15 @@ function ThinkingBlock({ text, redacted }: { text: string; redacted?: boolean }) ); } -/** Plain text + image thumbnails for user / custom message content. */ +/** Markdown + image thumbnails for user / custom message content. */ function MsgContent({ content }: { content: string | readonly (TextContent | ImageContent)[] }): ReactNode { - if (typeof content === "string") return
{content}
; + if (typeof content === "string") return ; return ( <> {content.map((block, i) => { switch (block.type) { case "text": - return ( -
- {block.text} -
- ); + return ; case "image": return ( .tr-md, -.tr-body > .tr-text { +.tr-row--assistant .tr-body { + gap: 8px; +} + +.tr-body > .tr-md { align-self: stretch; } -.tr-text { - white-space: pre-wrap; - word-break: break-word; -} .tr-row--custom .tr-body { color: var(--fg-muted); diff --git a/packages/collab-web/test/transcript.test.tsx b/packages/collab-web/test/transcript.test.tsx index 1d3d60d99..6b1e8af5e 100644 --- a/packages/collab-web/test/transcript.test.tsx +++ b/packages/collab-web/test/transcript.test.tsx @@ -112,3 +112,36 @@ describe("Transcript live tool rendering", () => { expect(html).toContain("thinking…"); }); }); + +describe("Transcript message Markdown", () => { + it("renders host strings and guest text blocks as Markdown", () => { + const entries: SessionEntry[] = [ + { + type: "message", + id: "host-markdown", + parentId: null, + timestamp: "2026-07-15T00:00:00Z", + message: { + role: "user", + content: "Use `381866285601915778`", + timestamp: 1, + }, + }, + { + type: "custom_message", + id: "guest-markdown", + parentId: "host-markdown", + timestamp: "2026-07-15T00:00:01Z", + customType: "collab-prompt", + content: [{ type: "text", text: "Guest uses **Markdown**" }], + details: { from: "guest" }, + display: true, + }, + ]; + + const html = renderTranscript({ entries, working: false }); + + expect(countElements(html, ".tr-row--user .tr-md code")).toBe(1); + expect(countElements(html, ".tr-row--user .tr-md strong")).toBe(1); + }); +});