Repository navigation
fix(site): stop exposing the empty notifications region to screen readers - #32141
Merged
Merged
Conversation
…ders Sonner always renders its toast container as a section named "Notifications alt+T", so screen readers announce an empty region at the bottom of every page. Upgrade sonner to 2.0.8 for customAriaLabel and leave the section unnamed while no toast is shown. It remains a polite live region, so toasts are still announced.
sonner 2.0.8 replays active toasts to a newly mounted Toaster, so toasts from one test or story leaked into the next and duplicated text queries.
jeremyruppel
approved these changes
Nov 13, 2026
aqandrew
temporarily deployed
to
docs-preview
November 13, 2026 21:06 — with
GitHub Actions
Inactive
This branch was previously deployed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Sonner always renders its toast container as
<section aria-label="Notifications alt+T" aria-live="polite">. NVDA reads it as an empty "Notifications alt+T region" at the bottom of every page, even when no toast is shown.This PR upgrades sonner from 2.0.7 to 2.0.8, which adds
customAriaLabel, and passes an empty label while there are no toasts. An unnamedsectionis not a landmark, so screen readers no longer stop on it. It stays a polite live region, so toasts are still announced, and it gets its usual name back while toasts are visible.Closes DEQ-474
Closes DEQ-497
/login?redirect=/workspaces)/login)This changes ARIA only and nothing visible, so there are no screenshots.
The sonner 2.0.8 bump also brings upstream fixes: dismissal and re-creation of toasts with the same ID, bounded toast history,
aria-hiddenon its default icons (we supply our own), and adata-react-aria-top-layerattribute on the section. The CSS changes in the release apply only to[data-styled=true], and our Toaster isunstyled.In 2.0.8, a newly mounted Toaster replays every active toast from sonner's module-level store. Without cleanup, toasts from one test or story leaked into the next and duplicated text queries. So
site/test/setup/msw.ts(Vitest) andsite/.storybook/preview.tsx(a project-levelbeforeEach) now calltoast.dismiss().Self-review findings left as they are:
.not.toBeInTheDocument()) on a role query. The behavior under test is the accessible name, which a screenshot cannot capture. The rest of the file uses the same assertions.useSonner()counts toasts for all toasters and ignorestoasterId. The app has one Toaster and nothing setstoasterId, so filtering would be dead code.aria-relevant="additions text", so removals are not announced anyway.{...props}spreads aftercustomAriaLabel, so a caller could override it. No caller passes props, and moving the spread would change precedence for every other prop.Grouping and decision log
reading-order-hidden-contentlabel has three tickets. DEQ-474 and DEQ-497 report the same element (#root > section, the Sonner container), so they share one root cause and one fix in the sharedToasterwrapper.inertandaria-hidden, and feat: replace Emoji Mart with Frimousse in the emoji picker #30526 replaced Emoji Mart. The collapsed popover's content is not mounted. Nothing to change here; noted on the ticket.<Toaster>only while toasts exist. Rejected: a live region inserted together with its content is often not announced.customAriaLabelupstream.customAriaLabel=""while empty. Chosen: smallest change, no patch to maintain.NotificationsInbox/MarkAllAsReadFailure): with a toast, the section is namedNotifications alt+T. After closing it,aria-label=""andaria-live="polite"remain, and no region shows in the accessibility tree. axe reports only the existingaria-dialog-nameon the popover.🤖 Generated by Coder Agents on behalf of @aqandrew.