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

Only show one error toast at a time #702

Merged
merged 1 commit into from
Oct 28, 2024
Merged

Only show one error toast at a time #702

merged 1 commit into from
Oct 28, 2024

Conversation

Amnish04
Copy link
Collaborator

@Amnish04 Amnish04 commented Oct 28, 2024

@tarasglek wanted to only show the last error on screen to avoid confusion with lots of stacked error toasts.

This quick PR does exactly that by keeping track of any open error toast ids, and closing them whenever a new error toast is triggered.

Here's a quick demo of how it works.
OnlyLastErroraToast

It wasn't clear to me if this was exactly what we wanted, or hide any open toasts on submitting a completion, so I went with whatever I understood.

One problem I see with this approach is that some important error messages might be lost if multiple relevant error toasts are relevant at a time.

This fixes #667

@Amnish04 Amnish04 requested a review from tarasglek October 28, 2024 02:56
@Amnish04 Amnish04 self-assigned this Oct 28, 2024
@humphd
Copy link
Collaborator

humphd commented Oct 28, 2024

I think this is good. We retain the error in the console logs.

@Amnish04 Amnish04 merged commit afd0be1 into main Oct 28, 2024
4 checks passed
@tarasglek
Copy link
Owner

love it. thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hide error toasts once we submit next completion.
3 participants