fix(web): announce Search state to screen readers (BEN-144) - #131
Merged
Conversation
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
marked this pull request as ready for review
August 2, 2026 00:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
src/web/Search.tsxrenders 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; setaria-busyon the results container while loading.Summary
role="status" aria-live="polite" aria-atomic="true"region inSearchcovering loading, error, empty-results, and summary text.SearchSummaryat theSearchlevel and pass it intoSearchResultsso summary/no-match text lives in the live region only (no duplicate render).aria-busy={state.tag === "loading"}on the wrapper that contains the idle suggestions /SearchResultsbody.SearchResultsempty-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
SearchResultsin 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 buildsRefs BEN-144.
Generated by Claude Code