feat(core): useAnnounce live-region hook + Typeahead announcements (comboboxes-6)#3382
Merged
Conversation
useAnnounce speaks messages to screen readers through persistently-mounted polite/assertive live regions created once (not born-with-content), so announcements are reliable. Wired into BaseTypeahead to announce result counts and no-results during search (comboboxes-6), which were previously silent.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
josephfarina
approved these changes
Jul 2, 2026
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.
Part of the accessibility & keyboard-management program (#3343). Adds the live-region primitive the announcement findings need, and closes the core of
comboboxes-6for Typeahead.Problem
The audit found the entire search/combobox domain has no working live region — result counts, "No results found", loading, and token/multiselect changes are all silent to screen readers. The one existing
aria-livespan inBaseTypeaheadis mounted together with its content, which most assistive tech will not announce (a live region must exist before its content changes).What this adds
useAnnounce()— an imperative hook returningannounce(message, politeness?):role="status"/aria-live="polite"androle="alert"/aria-live="assertive", botharia-atomic) appended todocument.bodyonce, empty, on first use. Because they are not born with content, updates are announced reliably.announce('')clears a lingering status (e.g. when a search query is cleared) instead of announcing nothing.document); regions self-reattach if removed.Wired into Typeahead (comboboxes-6)
BaseTypeaheadnow announces the outcome of each active search —"N results"/"1 result"/ theemptySearchResultsText("No results found") — and clears the announcement when the query is cleared. Previously silent.Tests
useAnnounce.test.tsx(6): regions mount empty on first announce with correct ARIA; polite vs assertive routing; identical-message re-announce; empty-message clear; empty-message no-op before first use; singleton reuse across hook instances.Typeahead.test.tsx(+2): announces a result count; announces "no results found".Typecheck, lint, and the full useAnnounce + Typeahead suites are green (35 tests).
Follow-up
Wire
useAnnounceinto the remaining silent surfaces (Selector/MultiSelector empty + select-all, Tokenizer add/remove, FileInput selection, Pagination/Calendar/Lightbox index changes) — tracked under #3343.