fix(chat): add h1-h6 and hr ReactMarkdown overrides#67
Open
KDwevedi wants to merge 1 commit into
Open
Conversation
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 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
card-bubble.tsxrenders chat answers viareact-markdown@10+remark-gfm@4with component overrides forp,ol,ul,li,strong, and (as of #65) the fulltablefamily — but noth1–h6orhr.With Tailwind's preflight reset:
### headingflattens to body text —<h3>inherits base size/weight, so the section structure the agent intended is visually invisible.***renders as a near-invisible<hr>.Evidence (Shridhar OSS eval,
sme_review_400)40 chat answers emit
### headings(chat 141, 57, 197, 10, 16, 19, 25, 49, 60, 74, 93, 94, …) that currently present with zero emphasis to the farmer. Tables already render correctly after #65; voice is plain prose (unaffected).Change
Adds
h1–h6overrides (rendered as bold paragraphs, tiered by level, compact spacing to match the bubble) and a visiblehr. Purely additive, matches the existing override style.This is the defensive half of the fix. The root-cause half is backend PR OpenAgriNet/amul-oan-api#65, which steers the agent away from headings/tables/HR/LaTeX entirely. This PR ensures graceful degradation if such Markdown still reaches the UI.
Validation
Visual-only, additive. Recommend a dev smoke rendering one heading-heavy answer (e.g. chat 141) to confirm tiered bold paragraphs + visible HR.
🤖 Generated with Claude Code