SelectPanel: Announce filter input name on initial focus - #8413
liuliu-dev wants to merge 9 commits into
Conversation
🦋 Changeset detectedLatest commit: a506731 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
|
🤖 Lint issues have been automatically fixed and committed to this PR. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved moderate findings remain around asynchronous announcements, accessible-name resolution, native-label support, and render-time snapshot cost; duplicate-announcement coverage is also requested.
Get a fresh assessment by requesting another Copilot review.
Review tier: Lite
Findings: 1
Open (2)
What changed in this PR
Updates SelectPanel accessibility announcements to include the filter input’s accessible name and reduce redundant list updates.
Changes:
- Adds accessible-name resolution and announcement state tracking.
- Integrates stable list references and filter state.
- Adds tests, a Storybook regression scenario, and a patch changeset.
| File | Summary |
|---|---|
script/check-classname-tests.mjs |
Excludes the hook test from classname checks. No direct findings. |
packages/react/src/SelectPanel/SelectPanel.test.tsx |
Updates announcement expectations. |
packages/react/src/SelectPanel/SelectPanel.dev.stories.tsx |
Adds a SelectPanel accessibility regression scenario. |
packages/react/src/FilteredActionList/useAnnouncements.tsx |
Findings: asynchronous filtering can announce stale results (moderate, 1 vote); referenced labels may not use accessible-name semantics (moderate, 1 vote); duplicate suppression lacks regression coverage (nit, 2 votes); native associated labels are unsupported (moderate, 2 votes); snapshots add O(n) work during renders (moderate, 1 vote). |
packages/react/src/FilteredActionList/useAnnouncements.test.tsx |
Adds announcement regression coverage. |
packages/react/src/FilteredActionList/FilteredActionList.tsx |
Supplies stable list references and filter integration. |
.changeset/bright-fields-speak.md |
Documents the patch release. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
| const announcementState = getAnnouncementState(items, loading, message, filterValue) | ||
| const previousAnnouncementState = useRef(announcementState) |
There was a problem hiding this comment.
Addressed in 6640e65 with a regression test confirming recreated equivalent items do not emit a list-update announcement.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: liuliu-dev <6688812+liuliu-dev@users.noreply.github.com>
|
🤖 Lint issues have been automatically fixed and committed to this PR. |
Co-authored-by: liuliu-dev <6688812+liuliu-dev@users.noreply.github.com>
|
Integration test results from github/github-ui PR:
Changes check could not confirm that this PR only changes the expected integration paths. Open the Changes run for the unexpected files or error details. This check is not required for merging. Integration PRs should only change:
Fixes made only in an integration PR do not reach github-ui's main branch. After the upstream Primer PR merges, other integration PRs and release PRs can fail because they do not include those fixes. Before merging your Primer PR:
Please talk to the release conductor or ask in #primer before merging your Primer PR. CI check runs linting, type checking, and unit tests. Check the workflow logs for specific failures. VRT check ensures that when visual differences are detected, the PR cannot proceed until someone acknowledges the changes by adding the "visual difference acknowledged" label. Need help? If you believe this failure is unrelated to your changes, please reach out to the Primer team for assistance. |


Related issue https://github.com/github/accessibility-audits/issues/16971
When a searchable SelectPanel opens, focus moves to the filter input while the first option becomes the active descendant. The existing announcement described the active option but did not include the filter input's accessible name.
This change:
aria-labelledbybeforearia-labelto match accessible-name precedence.The resulting initial announcement is:
After filtering, updates remain:
Changelog
New
aria-labelledby, late-mounted list references, and missing input labels.Changed
Removed
Rollout strategy