Fix/a11y speak queue#79883
Draft
pranvinit wants to merge 2 commits into
Draft
Conversation
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.
What?
Closes #79561
Improves
@wordpress/a11yspeak()reliability by queueing polite announcements and adding a short clear-fill delay before writing them to the live region.Why?
speak()previously cleared and filled live regions synchronously. In Safari with VoiceOver, that can cause announcements to be missed because the cleared and filled states may be batched into one accessibility tree update.It also meant rapid polite announcements could be dropped, since each new
speak()call immediately cleared and overwrote the previous message before assistive technology had a chance to process it.How?
packages/a11y/src/shared/queue.ts.speak( message, ariaLive? )API unchanged.@wordpress/a11ytests for async polite behavior, queue ordering, and assertive/polite channel independence.Testing Instructions
Testing Instructions for Keyboard
No UI or keyboard interaction changes are introduced. Existing keyboard flows should behave the same.
Screenshots or screencast
Not applicable. This is an internal accessibility announcement behavior change.
Use of AI Tools
This PR was developed with assistance from OpenAI Codex. Codex was used to inspect the issue and codebase, implement the patch, update tests and documentation, and run focused verification. I reviewed the generated changes and am responsible for the final code.