fix(Toast): improve responsive and interaction behavior - #5353
Draft
rubyycheung wants to merge 1 commit into
Draft
fix(Toast): improve responsive and interaction behavior#5353rubyycheung wants to merge 1 commit into
rubyycheung wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsToast (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: 1 accessibility violation(s) found — 1 moderate. Toast - 1 issue(s)
Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
bottomEndplacement.ToastViewportannounces through the singleton live regions, while visual toasts no longer put controls insiderole="status"/role="alert".<=640pxqueue behavior: one visible toast at a time with FIFO promotion; wide viewports keep the current default stack of 5; explicitmaxVisiblestill overrides the responsive default.touch-action: pan-y, logical edge direction/RTL support, threshold/cancel handling, and pause during gesture. The close button, F6 focus entry, Escape/layer behavior, and imperative dismiss remain available.Responsive and Interaction Readiness outcomes
Responsive layout
ToastViewportdefault preservebottomEnd;ToastViewport.test.tsxasserts default bottom/end alignment and wide stack behavior.ToastViewport.test.tsxcovers compact queue behavior and wrapping.Toast.tsxuses border-boxmaxWidth: 100%, long-messageoverflowWrap, wrapping trailing content, and a non-shrinking dismiss control;Mobile situations / Long localized actiondemonstrates it.Touch, pointer, and hover
touch-action: pan-y; mouse drag is ignored. Storybook notes that stories do not emulate touch unless the reviewer uses touch emulation/device.maxVisibleis overridden.Accessibility and interaction contracts
Button size="sm" isIconOnly(28x28 CSS px), satisfying WCAG 2.5.8 AA. No AAA/48px requirement is introduced.ToastViewportretains a named notifications region and announces once throughuseAnnounce; visual toasts no longer put interactive content inside status/alert regions.prefers-reduced-motion: reduce; swipe operability remains available.Mobile viewport constraints
ToastViewportowns logical fixed safe-area gutters usingenv(safe-area-inset-*), with RTL-aware inline start/end. Storybook RTL story labels safe-area as device-only behavior rather than faking pixel proof.Storybook
Validation
pnpm exec prettier --check packages/core/src/Toast/Toast.tsx packages/core/src/Toast/ToastViewport.tsx packages/core/src/Toast/ToastViewport.test.tsx packages/core/src/Toast/types.ts apps/storybook/stories/Toast.stories.tsx .changeset/toast-responsive-interaction.mdpnpm exec vitest run --project ui packages/core/src/Toast/ToastViewport.test.tsx packages/core/src/Toast/useToast.test.tsx— 39 Toast tests passedpnpm -F @astryxdesign/core buildpnpm -F @astryxdesign/core typecheckpnpm -F @astryxdesign/core typecheck:docspnpm -F @astryxdesign/docsite generatepnpm -F @astryxdesign/docsite typecheckpnpm -F @astryxdesign/storybook typecheckpnpm check:changesetspnpm lab:readiness:check— passes; existing unrelated List Input / Transfer List readiness gaps are still reportedpnpm check:repopnpm lint— exits 0; existing unrelated repo warnings remaingit diff --checkNotes
<=640px), not touch capability. ExplicitmaxVisibleoverrides the responsive default.