Skip to content

docs(toast): accessibility migration analysis#6442

Open
nikkimk wants to merge 9 commits into
mainfrom
nikkimk/swc-2256-toast-a11y
Open

docs(toast): accessibility migration analysis#6442
nikkimk wants to merge 9 commits into
mainfrom
nikkimk/swc-2256-toast-a11y

Conversation

@nikkimk

@nikkimk nikkimk commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Description

In CONTRIBUTOR-DOCS/03_project-planning/03_components/toast/accessibility-migration-analysis.md:

  • Documented recommendations for ARIA roles, states, and properties for the 2nd-gen Toast
  • Shadow DOM and cross-root ARIA considerations documented, including why no cross-root ARIA issues exist for this component
  • Accessibility tree expectations documented for all configurations: closed state, text-only, icon + text, and with action button
  • Keyboard interaction model fully specified, covering focus management, Tab order through close and action buttons, and focus-return behavior on dismiss
  • Testing requirements defined, including unit tests, aXe/Storybook checks, Playwright ARIA snapshots, and manual screen reader testing guidance for live region announcements
  • Known 1st-gen accessibility issues cataloged with dispositions (fix in 2nd-gen): assertive live region role, missing hover pause, missing aria-hidden when closed, and action-button-plus-auto-dismiss hazard
  • WCAG 4.1.3 (Status Messages) identified as the primary applicable criterion; role="status" prescribed as the fixed host role (change from 1st-gen's inner role="alert")
  • 1st-gen component analysis completed, covering current ARIA implementation (role="alert" on inner .body div), timeout handling, focus-pause behavior, and existing test coverage

Motivation and context

The 2nd-gen migration is an opportunity to address known accessibility gaps, align with the latest WAI-ARIA Authoring Practices, and ensure the component meets WCAG 2.2 AA compliance.

Related issue(s)

  • resolves SWC-2256

Screenshots (if appropriate)


Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes. (docs-only PR; no code changes)
  • I have included a well-written changeset if my change needs to be published. (docs-only PR; no package changes)
  • I have included updated documentation if my change required it.

Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Includes thoughtfully written changeset if changes suggested include patch, minor, or major features
  • Automated tests cover all use cases and follow best practices for writing
  • Validated on all supported browsers
  • All VRTs are approved before the author can update Golden Hash

Manual review test cases

Review the Toast accessibility migration analysis

  • ARIA roles, states, and properties covered
  • Shadow DOM and cross-root ARIA considerations covered
  • Accessibility tree documented
  • Keyboard interaction fully specified
  • Testing requirements defined
  • Known 1st-gen issues cataloged with dispositions
  • Review the changes that include the adaptive dual-border guidance

@nikkimk nikkimk self-assigned this Jun 23, 2026
@nikkimk nikkimk added the a11y Issues or PRs related to accessibility label Jun 23, 2026
@changeset-bot

changeset-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 5efd6e7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@nikkimk nikkimk added Status:Ready for review PR ready for review or re-review. High priority PR review PR is a high priority and should be reviewed ASAP labels Jun 23, 2026
@coveralls

coveralls commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 28254101860

Coverage remained the same at 96.246%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 39173
Covered Lines: 37902
Line Coverage: 96.76%
Relevant Branches: 6460
Covered Branches: 6018
Branch Coverage: 93.16%
Branches in Coverage %: Yes
Coverage Strength: 458.82 hits per line

💛 - Coveralls

@nikkimk nikkimk marked this pull request as ready for review June 23, 2026 16:01
@nikkimk nikkimk requested a review from a team as a code owner June 23, 2026 16:01
@github-actions

Copy link
Copy Markdown
Contributor

📚 Branch Preview Links

🔍 First Generation Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-6442

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

@cdransf cdransf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Left one tiny suggestion. ✨

Comment on lines +132 to +133
None

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
None

@5t3ph 5t3ph self-assigned this Jun 25, 2026

@5t3ph 5t3ph left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking to discuss following React's lead with a "Toast Container" format vs. just the individual Toast component.


### What it is not

Not a dialog, alert dialog, or replacement for critical error messaging. Toasts should not contain actions the user must take to complete a task. If a user must confirm, acknowledge, or act before continuing, use a dialog component instead.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, I don't think it's realistic to say Toasts can't contain actions (and design expects them to handle actions). However, it's limited to one action.

See this thread which Michael Jordan weighed in on, although it would partly require we provide a toast container like React does. Maybe something to bring to sync on whether we should own full Toast display/positioning or just provide the base component? One thing the container offers is the ability to better handle the live announcements, which may get muddled if each Toast independently manages it. Plus ability to manage focus within the group and on dismiss.

@nikkimk nikkimk requested a review from 5t3ph June 26, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a11y Issues or PRs related to accessibility High priority PR review PR is a high priority and should be reviewed ASAP Status:Ready for review PR ready for review or re-review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants