feat: Vary live region politeness based on priority#50
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates the ariaNotify() polyfill to select different live-region hosts based on message priority, aligning behavior with current spec direction for polite vs assertive announcements.
Changes:
- Split live region host selection into two custom element types:
polite-live-region-*andassertive-live-region-*. - Introduce
PoliteLiveRegionCustomElement/AssertiveLiveRegionCustomElementsubclasses to setaria-liveappropriately. - Update browser tests to assert routing via the correct live region host and that messages dispatch through it.
Show a summary per file
| File | Description |
|---|---|
| arianotify-polyfill.js | Selects polite vs assertive custom live-region host based on message priority; defines dedicated custom element subclasses. |
| tests/web-test-runner/arianotify-polyfill.test.js | Reworks tests to validate correct host type/ariaLive and handleMessage dispatch for both priorities. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
tests/web-test-runner/arianotify-polyfill.test.js:64
- This test uses a fixed 300ms delay before asserting
handleMessagewas called, while the polyfill uses a 250ms sleep internally. The small buffer can cause intermittent failures; prefer polling for the expected call (with a reasonable timeout) or increase the wait to provide sufficient headroom.
await new Promise((resolve) => setTimeout(resolve, 300));
expect(calls).to.have.length(1);
- Files reviewed: 2/2 changed files
- Comments generated: 1
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
smockle
commented
Apr 22, 2026
smockle
commented
Apr 22, 2026
smockle
commented
Apr 22, 2026
smockle
commented
Apr 22, 2026
Co-authored-by: Clay Miller <clay@smockle.com>
smockle
commented
Apr 22, 2026
smockle
commented
Apr 22, 2026
Co-authored-by: Clay Miller <clay@smockle.com>
priority
lindseywild
approved these changes
Apr 22, 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.
Fixes #27
This PR updates the polyfill so
priority: normalmessages go to anaria-live: politelive-region andpriority: highmessages go to anaria-live: assertivelive-region, to more closely align with the spec and mappings.