fix(desktop): keep error toasts on screen until dismissed - #5456
Open
TheSeydiCharyyev wants to merge 1 commit into
Open
fix(desktop): keep error toasts on screen until dismissed#5456TheSeydiCharyyev wants to merge 1 commit into
TheSeydiCharyyev wants to merge 1 commit into
Conversation
Agent and team deletion errors used Sonner's four-second default and had no close control. Those messages run to several lines and are often worth copying into a report, so the timer regularly cleared them before they could be read. Error feedback now stays up until it is dismissed and carries Sonner's close control, whose default accessible name is "Close toast". Success notices are untouched and keep the short default lifetime. Closes block#5362 Signed-off-by: Seydi Charyyev <seydi.charyev@gmail.com>
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
Close toastCloses #5362.
Why
useToastEffectcalledtoast[variant](message)with no options. So every error that goes throughuseFeedbackToastsused Sonner's defaultTOAST_LIFETIME, which is 4000 ms. The deletion errors in the report run to several lines, and they are often the thing a user wants to copy. Four seconds regularly won that race.Both halves fit in one options object at the single call site:
durationis not finite, so the toast waits for the user.closeButtonoverrides theToastersetting, so this stays scoped to errors.Scope
This covers the four surfaces that use
useFeedbackToasts:UnifiedAgentsSection(twice),PersonaCatalogDialog, andMembersSidebar. That includes the repro in the issue.desktop/srcalso has 111 directtoast.error(...)calls that do not go through the hook. Those still use the defaults. Putting a close control on every error toast in the app looks like a product decision rather than a bug fix, so I left them alone. I can extend it if you want that.Validation
element(s) not found. With the source change it passes.pnpm --filter buzz test— 4,538 passedpnpm --filter buzz exec tsc --noEmitpnpm --filter buzz check— biome, file sizes, px-text, pubkey truncationagents.spec.tsin full, twice — 35/35 each timechannels.spec.tsin full — 78 of 79. The failure ismembers sidebar can invite relay-authorized agents. It passes twice in isolation, and the error iswaiting for getByTestId('channel-general'), not a covered element. A control run on cleanmainfails 2 different tests in the same file. So the suite is flaky in my environment, and this branch is not worse than the base.No existing e2e test asserts that a toast disappears on its own, so nothing depended on the old timeout.