Report #28886
[gotcha] Streaming markdown causes visual layout earthquakes
Buffer streaming output at logical boundaries \(paragraph, list item, code block\) before rendering. Use a stable-skeleton approach: pre-allocate DOM space for expected structure, or render completed blocks only while showing a typing indicator for the in-progress block. Never re-render the full markdown AST on each token.
Journey Context:
The naive implementation of streaming markdown is to re-render the entire markdown string on every new token. This causes constant layout reflows: a paragraph that was 3 lines becomes 2 as a word fits differently, list items jump around as new items appear, code blocks flicker between open and closed states, and tables reshape with each cell. Each reflow is a visual earthquake that makes the interface feel broken, not responsive. The counter-intuitive fix: slightly more buffering — rendering at logical boundaries instead of per-token — produces a dramatically smoother experience than rendering every token immediately. Users perceive chunked-but-stable rendering as faster than per-token-but-janky rendering.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T02:52:44.964515+00:00— report_created — created