auto: fix markdown prose styling for non-recipe chat responses#18
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
auto: fix markdown prose styling for non-recipe chat responses
Why
Two real user traces confirm that numbered lists and bullet points are invisible in the chat UI:
0ee0a635e5b25b7abe154d9e730c90ab: User said "I think the markdown is not rendering the numbers" after receiving a numbered dinner-options list.dafdb4a5e3bbb0d1a6e12f2466ae1315: User asked the agent to format options "like 1, 2, 3" — implying current list rendering was broken.Root cause:
@tailwindcss/typographyis not installed and not intailwind.config.tsplugins. Tailwind's preflight CSS resets<ol>/<ul>defaults — it stripslist-style-typeandpadding-leftfrom all list elements. Theprose-invertclass used throughout the chat components has no effect without the typography plugin, so every numbered list and bullet the agent produces renders as flat, unstyled text with no visible markers.This affects every non-recipe response: numbered dinner options, clarifying-question lists, substitution bullet points, multi-turn follow-ups.
What
web/components/markdown-renderer.tsx(new): SharedMarkdownRenderercomponent wrappingreact-markdownwith acomponentsprop that applies explicit Tailwind utility classes (list-decimal pl-5,list-disc pl-5,leading-relaxed, etc.) whenproseEnabledis true. Falls back to unstyled rendering when flag is off, preserving current behavior exactly.api/main.py: Addedmarkdown_prose_stylingkey to/flagsresponse, reading theauto_markdown_prose_stylingFlagsmith flag (default off).web/components/chat.tsx: Replaced directReactMarkdownusage in bubble-layout and column-layout paths withMarkdownRenderer; reads newmarkdown_prose_stylingflag and passesproseEnableddown.web/components/recipe-card.tsx: Updated fallback (non-recipe) rendering path to useMarkdownRendererwithproseEnabledprop instead of directReactMarkdown.No new npm packages — uses only the already-installed
react-markdown'scomponentsprop.Flag
auto_markdown_prose_styling— default off. Enable in Flagsmith "cooking" project → Development to activate. When off, markdown renders as before (no visible change to existing behavior).Eval delta
No regressions. No scenarios were modified.
How to test
Rollback
Flip
auto_markdown_prose_stylingoff in Flagsmith. No code revert needed — the entire styled path is a conditional branch off the flag.Follow-ups
cooking_agent.py:96uses baseSYSTEM_PROMPTin the history path, silently dropping flag addendums (auto_safety_check_enhanced, etc.) for all multi-turn chats.d92027fashows the agent answering questions about "light mode in this website" with ChatGPT instructions; the system prompt has no stay-on-topic rule.