Repository navigation
fix(toast): respect queue strategy overflow - #277
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Toast overflow behavior so queueStrategy consistently governs what happens when maxVisible is exceeded (not just which queued toast is promoted later), aligning runtime behavior with the intended FIFO/LIFO contract for consumers of the design system.
Changes:
- Updates
enqueueToast()overflow handling: FIFO now queues new overflow toasts instead of demoting a visible toast; LIFO keeps demotion/latest-visible behavior. - Adds/updates regression tests to cover FIFO overflow visibility, FIFO promotion order, queued-toast removal stability, and LIFO overflow/promotion scenarios.
- Updates Storybook queue-strategy demo copy and TypeScript docs to reflect the clarified semantics.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/components/organisms/toast/types.ts |
Documents the FIFO/LIFO overflow + promotion semantics for ToastQueueStrategy and provider props. |
src/components/organisms/toast/toastStore.ts |
Applies queueStrategy during overflow so FIFO queues and LIFO demotes/shows newest. |
src/components/organisms/toast/Toast.test.tsx |
Expands regression coverage for FIFO/LIFO overflow visibility and promotion ordering. |
src/components/organisms/toast/Toast.stories.tsx |
Updates the QueueStrategy story text to accurately teach the new behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
queueStrategyoverflow semantics so FIFO keeps current visible toasts and queues newer overflow toasts.Closes #274
Review scope
src/components/organisms/toast/toastStore.tssrc/components/organisms/toast/Toast.test.tsxsrc/components/organisms/toast/Toast.stories.tsxsrc/components/organisms/toast/types.tsType of change
Workflow gates
Closes #NNNor maintainer approved an exception.status:approvedbefore implementation starts.In progress, branch/worktree recorded.<type>(<optional scope>): <description>..playwright-mcp,page-*.png,page-*.jpeg,*.md.playwright-output.Component evidence (required for component changes)
types.ts,use*.ts,Component.tsx,Component.test.tsx,Component.stories.tsx,index.ts.types.ts; JSX component has no state, CVA calls, or business logic.@defaultJSDoc intypes.ts(node scripts/verify-prop-default-docs.mjs).theme.css; no hardcoded colors or arbitrary color utilities.Accessibility evidence
Validation evidence
pnpm exec tsc --noEmit✅pnpm vitest run src/components/organisms/toast/Toast.test.tsx✅ — 48 tests passedpnpm run test✅ — 35 files / 741 tests passedpnpm run storybook-build✅node scripts/verify-prop-default-docs.mjs✅pnpm exec biome check src/components/organisms/toast/toastStore.ts src/components/organisms/toast/Toast.test.tsx src/components/organisms/toast/Toast.stories.tsx src/components/organisms/toast/types.ts✅git diff --check✅Screenshots or recordings
N/A — this is queue-order behavior plus docs/test coverage; Storybook build passed.
Notes for reviewer
FIFO now queues new overflow toasts and keeps current visible slots stable. LIFO keeps the previous latest-first behavior by demoting the oldest visible toast before showing the new one. Promotion after close remains strategy-aware through the existing queue promotion path.