Skip to content

a11y(toast): announce updates politely#777

Merged
mikewheeleer merged 2 commits into
Talenttrust:mainfrom
Devadakene:a11y/toast-01-live
Jul 26, 2026
Merged

a11y(toast): announce updates politely#777
mikewheeleer merged 2 commits into
Talenttrust:mainfrom
Devadakene:a11y/toast-01-live

Conversation

@Devadakene

Copy link
Copy Markdown
Contributor

Closes #557

Description

This PR introduces a debounced live-region announcement to improve accessibility when toast content updates. Previously, screen-reader users did not receive feedback on the overall count and status of visible toasts when a new toast arrived. This adds a polite live-region announcement that dynamically states the overall count and specific variants (success/error), using a 500ms debounce to prevent spamming the screen reader queue during rapid updates.

Closes #

Type of Change

  • Bug fix (non-breaking change that resolves an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactor (no functional change, internal code improvement)
  • Documentation update

Pre-flight Checklist

All items must be checked before requesting review.

  • npm run lint passes with no errors
  • npm test passes with no failures
  • npm run build completes successfully

Testing & Coverage

  • Module test coverage for impacted files meets or exceeds the 95% minimum threshold
    (run npm test -- --coverage and check the per-file table)
  • If this PR adds or modifies UI components, accessibility tests were written using
    the shared utilities in src/test-utils/a11y.tsx

What was tested?

  • Debounce logic: Verified that rapid, successive toast creations (within the 500ms window) result in a single, consolidated announcement.
  • Zero notifications edge-case: Verified that when all toasts are dismissed, the announcement dynamically resets to report "0 notifications".
  • String correctness: Verified that the live region correctly announces counts for specific variants (e.g., "2 notifications (1 error, 1 success)").

Accessibility & Security Notes

Accessibility

Yes, added a new polite live-region announcement specifically targeted at screen readers to communicate changes to the toast stack that were previously omitted. Testing covers assertions on aria-live regions and proper timing to ensure assistive technologies have adequate time to announce the updates.

Security

N/A – no authentication or sensitive user logic was altered. Ensure statusAnnouncement renders plainly, which it safely does via React state string interpolation.

@drips-wave

drips-wave Bot commented Jul 25, 2026

Copy link
Copy Markdown

@Devadakene Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@mikewheeleer
mikewheeleer merged commit 0031a9e into Talenttrust:main Jul 26, 2026
1 check failed
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.

Announce toast updates through an aria-live region

2 participants