brauliogusmao stops the chat from crashing mid-answer

A real upstream bug: responses that arrive live and contain a table or a formula could crash the chat window before they finished rendering.

chat-ui

When the assistant streams an answer onto the screen word by word, the display logic and the formatting logic were fighting over the same patch of screen - and when the answer happened to include a table or a math formula, the whole thing could fall over mid-stream. brauliogusmao traced it to a genuine flaw in Mike's upstream code, not a quirk of this fork.

The fix is pragmatic: while text is still arriving, formatting is held back and the raw response is shown plainly; the moment the answer completes, tables and formulas snap into their proper layout. You trade a second of unformatted text for a window that never crashes. It's a small change with a clear tradeoff baked in.

So what Anyone running a streaming chat assistant should care - if your answers ever contain tables or formulas, this is the kind of bug that bites real users without warning.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

2 commits from brauliogusmao/mike, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
4872c90b fix: corrige removeChild durante streaming do ReactMarkdown Braulio Gabriel Gusmao 2026-05-12 ↗ GitHub
commit body
Adiciona key="streaming"/"done" no ReactMarkdown para forçar remount
ao fim do streaming. Evita que rehypeKatex/remarkGfm produzam árvores
DOM inconsistentes durante reconciliação com markdown parcial.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
78e2b036 fix: desativa plugins do ReactMarkdown durante streaming para evitar conflito de DOM Braulio Gabriel Gusmao 2026-05-12 ↗ GitHub
commit body
Durante streaming usa ReactMarkdown sem plugins (árvore DOM estável).
Ao fim do streaming, key muda para "done" forçando remount único com
rehypeKatex e remarkGfm ativos para renderização final completa.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-386.md from inside the repo you want the changes in.

⬇ Download capture-thread-386.md