From b317736263c06eb6e7b6454abdfe1695d3980f63 Mon Sep 17 00:00:00 2001 From: Kanav Dwevedi Date: Tue, 19 May 2026 22:52:22 +0530 Subject: [PATCH] fix(chat): add h1-h6 and hr ReactMarkdown overrides card-bubble overrides p/ol/ul/li/strong/table* but not headings or hr. With Tailwind preflight, `### heading` flattens to body text (heading hierarchy lost) and `***` renders as a near-invisible rule. Adds compact, bubble-styled h1-h6 (rendered as bold paragraphs, tiered by level) and a visible hr. Defensive complement to the backend prompt change that steers the agent away from headings/ tables/HR; this ensures graceful degradation if such Markdown still reaches the UI. Eval evidence (Shridhar OSS eval): 40 chat answers emit ### headings that currently render with zero visual emphasis. Co-Authored-By: Claude Opus 4.7 --- .../components/bubbles/card-bubble.tsx | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/components/screens-component/chat-screen/components/bubbles/card-bubble.tsx b/src/components/screens-component/chat-screen/components/bubbles/card-bubble.tsx index e392757..338fb90 100644 --- a/src/components/screens-component/chat-screen/components/bubbles/card-bubble.tsx +++ b/src/components/screens-component/chat-screen/components/bubbles/card-bubble.tsx @@ -129,6 +129,27 @@ export function CardBubble({ message }: { readonly message: CardMessage }) { td: ({ node, ...props }) => ( ), + h1: ({ node, ...props }) => ( +

+ ), + h2: ({ node, ...props }) => ( +

+ ), + h3: ({ node, ...props }) => ( +

+ ), + h4: ({ node, ...props }) => ( +

+ ), + h5: ({ node, ...props }) => ( +

+ ), + h6: ({ node, ...props }) => ( +

+ ), + hr: ({ node, ...props }) => ( +


+ ), }} > {message.body}