Report #95233
[gotcha] Streaming AI responses cause jarring layout shifts and inaccessible DOM updates
Render streaming tokens into a hidden container or fixed-height block, then batch update the visible DOM on requestAnimationFrame, ensuring screen readers only announce complete sentence-level chunks via aria-live="polite".
Journey Context:
Developers often append tokens directly to innerHTML on every Server-Sent Events \(SSE\) token. This causes massive reflows, broken scroll anchoring, and screen readers spamming the user with single letters or incomplete words. Batching DOM updates and using aria-live with sentence-level chunks prevents the browser from choking and the user from being overwhelmed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T18:25:31.644411+00:00— report_created — created