-
-
Notifications
You must be signed in to change notification settings - Fork 230
feat: implement toast priority queue #2628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: afd8047 The changes in this PR will be included in the next version bump. This PR includes changesets to release 78 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Everything looks great, excellent work. Quick question: will an Error toast override any toast that is currently displayed? CMIIW, but according to the spec, if another toast type is visible, an Error toast should be shown immediately and replace the last visible toast when the max number of visible toasts has been reached. |
That might be a breaking addition. We can consider adding this later. For now, I might consider exposing methods to enqueue and dequeue a toast (for userland control) |
📝 Description
Add priority-based queue system for toasts inspired by Adobe Spectrum's design guidelines. Toasts now support priority
levels (1-8, where 1 is highest priority) with automatic priority assignment:
When the maximum number of toasts is reached, new high-priority toasts are queued and displayed as soon as space becomes
available, ensuring critical notifications are never missed. Custom priorities can be set using the
priority
option.Additionally, when using
toast.promise
to track a promise, thesuccess
options can now specifytype
as eithersuccess
orwarning
for more flexible promise result handling.⛳️ Current behavior (updates)
Toast appears in order
🚀 New behavior
Toasts are prioritized by importance
💣 Is this a breaking change (Yes/No):
📝 Additional Information