From ffcffa13752b897920849acd45315a7bf91f592b Mon Sep 17 00:00:00 2001 From: Hongming Wang Date: Sun, 3 May 2026 12:36:44 -0700 Subject: [PATCH] fix(canvas): agent chat bubble dark-mode prose contrast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Regression from PR #2618 (chat dark-contrast). PR #2618 switched the agent bubble bg to `dark:bg-zinc-700` so it visibly elevates against the dark panel — but the inner ReactMarkdown prose div only got `prose-invert` for USER messages. Result: in dark mode the agent's markdown text rendered with the Tailwind Typography plugin's default dark body color on top of the new dark bg = invisible text. User reported empty-looking gray rectangles where agent replies should be. Fix: apply `dark:prose-invert` to agent bubbles so prose body text flips light alongside the bg. Light mode unchanged (default prose colors against the warm `bg-surface-card`). Co-Authored-By: Claude Opus 4.7 (1M context) --- canvas/src/components/tabs/ChatTab.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/canvas/src/components/tabs/ChatTab.tsx b/canvas/src/components/tabs/ChatTab.tsx index a218192e..040fa983 100644 --- a/canvas/src/components/tabs/ChatTab.tsx +++ b/canvas/src/components/tabs/ChatTab.tsx @@ -792,7 +792,18 @@ function MyChatPanel({ workspaceId, data }: Props) { }`} > {msg.content && ( -
p]:mb-1 [&>p:last-child]:mb-0 ${msg.role === "user" ? "prose-invert" : ""}`}> +
p]:mb-1 [&>p:last-child]:mb-0 ${ + msg.role === "user" + ? "prose-invert" + // Agent bubbles use bg-zinc-700 in dark mode; without + // prose-invert the Tailwind Typography plugin keeps + // its default DARK body color → unreadable dark-on-dark. + // Light mode keeps default prose colors against the + // warm surface-card bg. + : "dark:prose-invert" + }`} + > {msg.content}
)}