What to build
providers-registry.tsx:83-95 configures sonner with three issues that hurt usability and consistency:
theme="dark" is hard-coded. Toasts ignore prefers-color-scheme and the shop's design-token theme. Should default to "system" (or be wired into the shop theme) so light-mode users get appropriately-themed toasts.
- Duration conflict — top-level
duration={5000} vs toastOptions.duration: 2500. Sonner uses the inner override, but the outer prop is dead-code that misleads readers. Pick one source of truth.
toastOptions literal — passed as a fresh { duration: 2500, classNames: { toast: 'toast-notification' } } on every render. If ProvidersRegistry re-renders, Toaster sees a new prop reference. Hoist to a module-level constant or useMemo.
- No
richColors — error vs success differentiation is icon-only. Add richColors for clearer success/warning/error distinction.
- a11y — verify
aria-live and role="status" defaults are correctly applied (sonner handles this, but assert in test).
Acceptance criteria
Blocked by
None — can start immediately.
References
apps/storefront/src/components/providers-registry.tsx:83-95
What to build
providers-registry.tsx:83-95configuressonnerwith three issues that hurt usability and consistency:theme="dark"is hard-coded. Toasts ignoreprefers-color-schemeand the shop's design-token theme. Should default to"system"(or be wired into the shop theme) so light-mode users get appropriately-themed toasts.duration={5000}vstoastOptions.duration: 2500. Sonner uses the inner override, but the outer prop is dead-code that misleads readers. Pick one source of truth.toastOptionsliteral — passed as a fresh{ duration: 2500, classNames: { toast: 'toast-notification' } }on every render. IfProvidersRegistryre-renders, Toaster sees a new prop reference. Hoist to a module-level constant oruseMemo.richColors— error vs success differentiation is icon-only. AddrichColorsfor clearer success/warning/error distinction.aria-liveandrole="status"defaults are correctly applied (sonner handles this, but assert in test).Acceptance criteria
"system"or shop-themed)toastOptionsreference is stable across re-rendersrichColorsenabledBlocked by
None — can start immediately.
References
apps/storefront/src/components/providers-registry.tsx:83-95