Skip to content

fix(web): announce Search state to screen readers (BEN-144) - #131

Merged
benSepanski merged 1 commit into
mainfrom
agent/ben-144
Aug 2, 2026
Merged

fix(web): announce Search state to screen readers (BEN-144)#131
benSepanski merged 1 commit into
mainfrom
agent/ben-144

Conversation

@benSepanski

Copy link
Copy Markdown
Owner

Context

src/web/Search.tsx renders loading, error and results-summary text as plain <p>s with no live region, so screen-reader users get no feedback when a debounced query resolves. Breaks WCAG 4.1.3 (Status Messages).

TL;DR

Add a single role="status" aria-live="polite" region that announces "Searching for …" / "N matches across M runs" / "No matches" as Search state changes; set aria-busy on the results container while loading.

Summary

  • Add an always-rendered role="status" aria-live="polite" aria-atomic="true" region in Search covering loading, error, empty-results, and summary text.
  • Compute SearchSummary at the Search level and pass it into SearchResults so summary/no-match text lives in the live region only (no duplicate render).
  • Set aria-busy={state.tag === "loading"} on the wrapper that contains the idle suggestions / SearchResults body.
  • SearchResults empty-state now renders only the "Tip:" help text (the announcement moved up); the "showing N" filter counter moves to a dedicated line since the summary line is gone.

Demo

n/a — non-visual accessibility change; no user-visible layout regression. The loading text now reads "Searching for "<query>"…" instead of "searching…" (small copy improvement).

Alternatives

  • Sr-only duplicate live region alongside the existing visible text. Rejected: two sources of truth for the same message, harder to keep in sync.
  • Wrap SearchResults in the live region wholesale. Rejected: filter chip clicks would spam SR announcements every time the visible list changed.

Test Plan

  • pnpm all — typecheck + fmt:check + lint + test + eval (336 tests + 5 evals green)
  • pnpm build:web — web bundle builds
  • Manual SR check: type a query, verify VoiceOver/NVDA announces the loading and summary transitions

Refs BEN-144.


Generated by Claude Code

Wrap Search loading, error, empty and summary text in a single
role="status" aria-live="polite" region so SR users hear "Searching
for …" and "N matches across M runs · X turns · Y events" as the
debounced query completes. Add aria-busy on the results container
while loading.

Refs BEN-144.
@benSepanski
benSepanski marked this pull request as ready for review August 2, 2026 00:14
@benSepanski
benSepanski merged commit 34005f0 into main Aug 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants