A Stream Retry Needs a Fresh Announcement, Not a Rewritten Transcript
While I was keyboard-testing this single-file demo, I retried a chat answer that had stalled after one short clause. I pressed Escape to cancel, then activated Retry, and I expected a clean announcement of a new attempt. Instead the reader spoke the cancelled fragment and the new sentence as if they were one paragraph. The primary button still announced Stop, even though the request had already…
A streaming chat interface required a new announcement after a failure, rather than simply rewriting the existing transcript. When a chat answer stalled, the author expected a fresh spoken attempt after retrying, but instead the cancelled fragment was combined with the new sentence. The primary "Stop" button remained unchanged even though the request had failed, and the accessibility tree still contained the previous text.
The issue arose because the transcript and its live region were not updated correctly on retry. The transcript lived in a single paragraph, and when cleared, the same node was reused, leading to listeners perceiving the rewrite as a continuation of the old message. The primary button's accessible name, derived from a closure, did not update until a later paint, causing confusion for keyboard users.
The author built a small streaming panel for a browser chat, with keyboard-operable controls and a polite live region. Upon retry, the transcript was cleared and new tokens were added, but the visual reset did not signal a new message to all assistive technologies. The fix was to separate the transcript from the announcer, updating the announcer node on every phase change.
This allowed the transcript to update freely while the announcer received one short sentence per transition, ensuring clear communication for all users.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.