Skip to content
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

Prevent snackbars from stacking up by adding a max count #53201

Closed
richtabor opened this issue Jul 31, 2023 · 7 comments · Fixed by #58559
Closed

Prevent snackbars from stacking up by adding a max count #53201

richtabor opened this issue Jul 31, 2023 · 7 comments · Fixed by #58559
Labels
[Package] Components /packages/components [Type] Enhancement A suggestion for improvement.

Comments

@richtabor
Copy link
Member

Snackbars should have a max count, where you can't end up with a stack of them hanging around. #53200 will reduce the number, but there should be a max. Even as small as three notice max may work just fine.

CleanShot 2023-07-31 at 17 44 16
@richtabor richtabor added the [Type] Enhancement A suggestion for improvement. label Jul 31, 2023
@glendaviesnz
Copy link
Contributor

Also, each notice type should have a unique id as done here so that only one of that notice type appears at a time.

@richtabor
Copy link
Member Author

Also, each notice type should have a unique id #53087 so that only one of that notice type appears at a time.

Yea, perhaps the copy to clipboard snackbar doesn't have one?

@Mamaduka
Copy link
Member

Mamaduka commented Aug 1, 2023

I like how this library, Sonner, handles stacking and multiple snackbars/toasts.

@richtabor
Copy link
Member Author

I like how this library, Sonner, handles stacking and multiple snackbars/toasts.

Very cool! What do we need to do to try this interaction in the editor?

For reference:

CleanShot.2023-08-01.at.11.34.27.mp4
@Mamaduka Mamaduka added the [Package] Components /packages/components label Aug 1, 2023
@Mamaduka
Copy link
Member

Mamaduka commented Aug 1, 2023

I think it would require an update to the SnackbarList component.

@mirka, how doable is this with current snackbar components?

@jasmussen
Copy link
Contributor

Yes please 🙏

@mirka
Copy link
Member

mirka commented Aug 4, 2023

I think it would require an update to the SnackbarList component.

@mirka, how doable is this with current snackbar components?

Architecturally it seems feasible to me, since SnackbarList has full control over how the notice data objects are rendered. Most of the complexity would be in getting the interactive animations right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
5 participants