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

Option to avoid toast duplicates #1504

Open
2 tasks done
TobiasToS opened this issue Oct 7, 2024 · 2 comments
Open
2 tasks done

Option to avoid toast duplicates #1504

TobiasToS opened this issue Oct 7, 2024 · 2 comments
Labels
triage We discuss this topic in our internal weekly type: enhancement New feature or request

Comments

@TobiasToS
Copy link

Prerequisites

  • I have read the Contributing Guidelines.
  • I have not leaked any internal/restricted information like screenshots, videos, code snippets, links etc.

Suggestion / feature request

Hello,

it would be useful if there could be an option to avoid multiple toast messages with identical content.

Use case:
In my case, Info messages will be closed by auto close, which is fine, but error messages have to be manually closed by the user. If we got a (for example) communication problem, there will be an error toast every few seconds which will spam the UI over time.

Workarounds (failed):
Workarounds with a "Acknowledge Button" within the toast" aren't working, because ist not guarantied that the user will press them, or just press the "x".
A "Don't show this hint again" Button doesn't work either, because the users aren't 24/7 at the system and during these absence time, there could be already dozens or hundreds of toasts...

A manual build up "current showing toasts"-list aren't possible, because there is no return if a toast is closed or not.

thanks in advance
Tobias

This topic was already posted at https://community.siemens.com/t/avoid-toast-duplicates/1432

@TobiasToS TobiasToS added triage We discuss this topic in our internal weekly type: enhancement New feature or request labels Oct 7, 2024
@matthiashader
Copy link
Collaborator

Hello @TobiasToS - thanks for your insights.
I have passes this as a requirement to our UX-colleagues, they will come back to you.
Despite not being possible with the component, you can still achieve similar functionality programmatically, i have prepared a small example here: https://stackblitz.com/edit/v69cas-ks2zmw?file=src%2Ftoast-position.tsx

@TobiasToS
Copy link
Author

Hello Matthias,

thanks for your answer and your example.
Unfortunately, the example would only allow exactly one toast at a time,
but I actually meant that duplicates are filtered (in a nice expansion stage possibly provided with a small counter, such as "already occurred x times"), but other toasts are still displayed.

Of course I could expand on your idea and build lists etc in the background,
but I don't think I want to put this work into a workaround ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage We discuss this topic in our internal weekly type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants