Skip to content
mentoor

Topic 1 of 5 · 4 min read

Accessible chat and streaming interfaces

Goal: Find WCAG 2.2 failures in an AI chat interface, including how streamed responses are announced to screen readers.

An AI chat interface is accessible only if a person using a keyboard or a screen reader can send a prompt, follow the answer as it arrives and use every control, with no mouse and no sight. WCAG 2.2, the W3C standard, sets the tests.

Check yourself · 1 of 3

A chat page streams its answer into a plain div. A screen reader user hears nothing until they move through the page by hand. What is the most direct fix?

Choose one answer

Why it matters

Chat screens look simple, so teams skip the checks. But they break in ways ordinary pages do not. Text appears while the user is reading it. Buttons show up and vanish. Focus can jump. A sighted mouse user copes. A screen reader user may hear nothing, or hear the answer re-read word by word.

How to check it

  1. Keyboard. Unplug the mouse. Can you reach the input, send, stop, copy, regenerate and feedback buttons with Tab? Is the focus ring always visible (WCAG 2.4.7, and 2.4.11 in version 2.2, which says focus must not be hidden behind a sticky bar)? Can you leave every popup with Escape?
  2. Names. An icon-only button needs a text name such as "Copy answer". "Button" or a thumbs-up glyph fails 4.1.2 (name, role, value).
  3. Streaming. Put the answer in a region with aria-live="polite" so a screen reader announces new text without moving focus. Do not make it assertive, and do not announce every token: the reader would interrupt itself. Announce "Answer started" and "Answer finished", then let the user read the finished text at their own pace. MDN explains why updates that are too frequent flood the reader.
  4. Focus. After sending, keep focus in the input or move it to a clear place. Never steal focus mid-answer. If the Stop button replaces Send, keep focus on the button that is now there.
  5. AI-written alt text. Tools now describe images for you. Treat that text as a draft. Check it against the W3C alt decision tree: does it say what the image is for in this context, not only what it shows? A chart described as "a bar chart" tells a blind user nothing.

Before and after

Before: The reply streams into a plain div. Each new word is read aloud, or nothing is read at all. The Stop button is an icon with no name.

After: The reply sits in a polite live region that is updated in chunks and announces completion. Stop is labelled "Stop generating". Focus stays where the user left it.

What goes wrong

  • Teams test with the page already loaded, so they never hear what streaming sounds like.
  • An assertive live region cuts off whatever the user was reading.
  • Colour alone marks the AI answer or an error, which fails users who cannot see that colour.

Run a real screen reader (NVDA, VoiceOver or TalkBack) on one full conversation before you ship. Automated scanners catch only part of the problems, and none of them hear a stream.

Optional code branch

<div id="answer" role="log" aria-live="polite" aria-busy="true"></div>
<p id="status" class="visually-hidden" role="status"></p>

Set aria-busy to false and write "Answer finished" into the status element when the stream ends.

Examples

Stop button swap

While an answer streams, Send turns into Stop. Keyboard users who pressed Enter on Send lose focus, because the old button was removed from the page.

Fix: keep one button element, change its label to "Stop generating", and keep focus on it. Pressing Escape in the input also stops the stream.

Alt text from a model

A model describes a sales chart as "A colourful bar chart." The page needs the point of the chart.

Better: "Bar chart: monthly sign-ups rose from 120 in January to 310 in June." Check the numbers against the source before publishing.

Key points

  • Every chat control must work with the keyboard alone and show a visible focus indicator that nothing covers.
  • Icon-only buttons such as copy, stop and regenerate need a text name that a screen reader can read.
  • Streamed text belongs in a polite live region, with a short start and finish announcement instead of token-by-token reading.
  • Never move focus while an answer is still arriving; keep it where the user left it.
  • AI-written alt text is a draft to check against the image's purpose, not a finished description.

Common mistakes

  • Testing only with a mouse and a sighted eye, so streaming is never heard.
  • Setting the live region to assertive, which interrupts the user's own reading.
  • Announcing every streamed token instead of the finished answer.
  • Publishing AI-generated alt text without reading it.

Check yourself · 2 of 3

Which icon-only chat button breaks WCAG 4.1.2 (name, role, value)?

Choose one answer

Check yourself · 3 of 3

A model writes this alt text for a photo of a sales dashboard: "A computer screen." What should you do before publishing it?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic