Skip to content

feat: support aria-busy state announcement - #240

Open
AdamMagued wants to merge 1 commit into
guidepup:mainfrom
AdamMagued:feat/support-aria-busy
Open

AdamMagued wants to merge 1 commit into
guidepup:mainfrom
AdamMagued:feat/support-aria-busy

Conversation

@AdamMagued

Copy link
Copy Markdown
Contributor

Summary

Implements support for the aria-busy state per the W3C WAI-ARIA 1.2 specification, addressing issue #36.

Changes

  1. Accessibility Tree and Node Data:

    • Detects aria-busy="true" on elements and sets busy: boolean on AccessibilityNode.
    • Propagates busy across root and child tree nodes.
    • Maps attribute labels (busy for true, not busy for false).
  2. Focused Element Announcements:

    • Implemented #announceFocusedBusy in Virtual.ts to observe mutations on active/focused elements.
    • Announces "busy" when aria-busy transitions to "true" and "not busy" when set to "false".
    • Avoids duplicate announcements when the focused element is also an active live region.
  3. Live Region Processing:

    • Tracks busy: boolean state across ancestor hierarchies in getLiveRegionAttributes.
    • Announces ${live}: busy when a live region becomes busy.
    • Suppresses intermediate DOM updates while a live region or its ancestors remain busy.
    • Automatically announces updated region content when aria-busy is cleared or set to "false".
  4. Tests and Coverage:

    • Added comprehensive integration tests in test/int/ariaBusy.int.test.ts covering static navigation, accessibility tree attributes, dynamic focused changes, live regions, nested busy ancestry, batch mutations, and edge cases.
    • All 58 test suites (358 tests) pass with 100% test pass rate and satisfy all strict coverage thresholds (statements >= 98%, branches >= 95%, functions 100%, lines >= 98%).

Closes #36

- Expose busy state and attribute mapping on accessibility nodes

- Announce busy and not busy state transitions for focused elements

- Support aria-busy on live regions, suppressing interim updates until busy period completes

- Closes guidepup#36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: support aria-busy

1 participant