Announce each reply once instead of every streamed chunk

Geschlossen
#338 2 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@kachamsiddarth arbeitet bereits daran.

Seit 26.10.2026.

  • #410 von @kachamsiddarth — gemerged

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

accessibility enhancement hacktoberfest widget

The message list is role="log" with aria-live="polite", and a reply's text is rebuilt on every streamed chunk. Some screen readers read those partial updates one by one, which is noisy, and others skip them.

What to do

  • While a reply streams, set the log to aria-live="off".
  • Add a visually hidden aria-live="polite" region (there's a cc-sr-only class already). When a reply finishes, put its final text there once, then set the log back to polite.
  • Error and cut off replies should be announced too, with their error text.
  • Messages the visitor sends don't need an announcement.

Where to look

  • packages/widget/src/dom/messages.ts (the constructor sets role and aria-live; updateMessage sets aria-busy while streaming)
  • packages/widget/src/widget.ts (handleSend: where streaming starts and ends)
  • packages/widget/tests/dom/messages.test.ts

Acceptance criteria

  • The log is aria-live="off" while a reply streams and polite otherwise
  • The hidden region gets the full reply text once, when it finishes
  • Failed replies announce their error message
  • Unit tests for each
  • A short note in the PR on what you checked with a screen reader, if you have one (not required)
  • Changeset for @chatcops/widget (patch)
  • pnpm test:coverage, pnpm lint and pnpm size pass

The chat panel (dist/chatcops.panel.js) has a 14 kB gzip budget and about 800 B of it is left, shared by several open issues. Keep the change small, and check pnpm size before you open the PR.

Vorherrschende Sprache
TypeScript
Sterne
13
Forks
7
Ø Merge
3 Std. 10 Min.
Gemergte PRs (30 T.)
339

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus codercops/chatcops

Alle Issues in codercops/chatcops

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.