Skip to content

fix(desktop): keep error toasts on screen until dismissed - #5456

Open
TheSeydiCharyyev wants to merge 1 commit into
block:mainfrom
TheSeydiCharyyev:fix/error-toasts-persist
Open

fix(desktop): keep error toasts on screen until dismissed#5456
TheSeydiCharyyev wants to merge 1 commit into
block:mainfrom
TheSeydiCharyyev:fix/error-toasts-persist

Conversation

@TheSeydiCharyyev

Copy link
Copy Markdown
Contributor

Summary

  • error toasts now stay until the user dismisses them, instead of clearing after four seconds
  • error toasts now have a close control; its accessible name is Close toast
  • success notices are unchanged: same short lifetime, no close control

Closes #5362.

Why

useToastEffect called toast[variant](message) with no options. So every error that goes through useFeedbackToasts used Sonner's default TOAST_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:

  • Sonner skips the auto-close timer when duration is not finite, so the toast waits for the user.
  • A per-toast closeButton overrides the Toaster setting, so this stays scoped to errors.

Scope

This covers the four surfaces that use useFeedbackToasts: UnifiedAgentsSection (twice), PersonaCatalogDialog, and MembersSidebar. That includes the repro in the issue.

desktop/src also has 111 direct toast.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

  • RED to GREEN: I reverted only the source change and kept the test. The e2e then fails at the assertion after the 5-second wait, with element(s) not found. With the source change it passes.
  • pnpm --filter buzz test — 4,538 passed
  • pnpm --filter buzz exec tsc --noEmit
  • pnpm --filter buzz check — biome, file sizes, px-text, pubkey truncation
  • agents.spec.ts in full, twice — 35/35 each time
  • channels.spec.ts in full — 78 of 79. The failure is members sidebar can invite relay-authorized agents. It passes twice in isolation, and the error is waiting for getByTestId('channel-general'), not a covered element. A control run on clean main fails 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.

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>
@TheSeydiCharyyev
TheSeydiCharyyev requested a review from a team as a code owner August 10, 2026 04:48
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.

Deletion error toasts disappear after four seconds and have no dismiss button

1 participant