Report #52047
[gotcha] Streaming markdown causes violent layout shifts as partial content re-renders
Use a streaming-aware markdown renderer that buffers until complete markdown blocks \(list items, table rows, code fences\) are formed before rendering. Apply CSS min-height on containers and batch DOM updates with requestAnimationFrame to reduce visual jumpiness.
Journey Context:
Developers implement streaming for better perceived latency, but markdown parsers re-interpret partial content on every token. A lone dash becomes a list item when the next dash arrives; a pipe character becomes a table row when more pipes appear. This causes the page to jump violently, which is WORSE UX than waiting for the complete response. The tradeoff: buffering adds slight latency but eliminates layout shift. The right call is to buffer at the block level—wait for complete paragraphs, list items, and table rows—rather than rendering every token the instant it arrives.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T17:51:20.043232+00:00— report_created — created