Repository navigation
fix: keep error toasts visible until dismissed - #30420
Merged
Merged
Conversation
Error toasts, including rejected toast.promise calls, now stay on screen until the user closes them (WCAG 2.2.1 Timing Adjustable). Success, info, and warning toasts keep Sonner's timer. Add a toast wrapper in site/src/components/Toaster/toast.ts, route all imports through it, and add a Biome noRestrictedImports rule so new code cannot import toast from sonner directly. Fixes DEQ-463 and DEQ-310.
…toasts # Conflicts: # site/src/pages/AgentsPage/AgentCreatePage.test.tsx # site/src/pages/AgentsPage/AgentCreatePage.tsx # site/src/pages/AgentsPage/exp/chatBoard/BoardColumns.tsx # site/src/pages/AgentsPage/exp/chatBoard/ChatBoardPage.test.tsx # site/src/pages/AgentsPage/exp/chatBoard/ChatBoardPage.tsx # site/src/pages/AgentsPage/exp/chatBoard/assistants.test.ts # site/src/pages/AgentsPage/exp/chatBoard/assistants.ts # site/src/pages/AgentsPage/exp/chatBoard/runPlan.test.tsx # site/src/pages/AgentsPage/exp/chatBoard/runPlan.ts
aqandrew
reviewed
Oct 8, 2026
aqandrew
left a comment
Collaborator
There was a problem hiding this comment.
The new wrapper + its tests make sense to me, although I wonder if we're calling act unnecessarily (see comment).
Other than that, some code comments just need some trimming
Trim redundant comments, shorten the biome restriction message, and drop unnecessary act() wrappers in toast tests.
…toasts # Conflicts: # site/src/hooks/useClipboard.test.tsx # site/src/pages/AgentsPage/AgentCreatePage.test.tsx # site/src/pages/AgentsPage/AgentsPageLayout.tsx # site/src/pages/AgentsPage/components/WebPushButton.tsx # site/src/pages/AgentsPage/utils/agentWorkspaceUtils.test.ts # site/src/pages/AgentsPage/utils/agentWorkspaceUtils.ts
aqandrew
approved these changes
Oct 9, 2026
…toasts # Conflicts: # site/src/pages/AISettingsPage/InstructionsPage/OrganizationInstructionsSettings.tsx # site/src/pages/AgentsPage/AgentAutomationsPage.test.tsx # site/src/pages/AgentsPage/AgentAutomationsPage.tsx # site/src/pages/AgentsPage/components/ChatPageContent.tsx # site/src/pages/AgentsPage/components/ChatTopBar.test.tsx # site/src/pages/AgentsPage/components/GitPanel/GitPanel.tsx
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Error toasts now stay on screen until the user closes them, to meet WCAG 2.2.1 Timing Adjustable. Success, info, and warning toasts keep Sonner's default timer.
Fixes DEQ-463 (Open Cursor Desktop failure) and DEQ-310 (adding a user who is already in a group).
Sonner has no default duration per toast type, so this adds
site/src/components/Toaster/toast.ts, a thin wrapper around Sonner'stoast:toast.errordefaults toduration: Infinity. A caller can still set its ownduration.toast.promisefailures get the same default. Sonner renders a rejected promise without callingtoast.error, and the group member flow (DEQ-310) usestoast.promise.All
toastimports now go through the wrapper. A BiomenoRestrictedImportsrule blocks importingtoastdirectly fromsonner, following the existing@pierre/diffsrule. Tests that mockedsonnernow mock the wrapper. Most of the 130-file diff is the import swap.Proof
Error toast on the create token page (duplicate name), with the pointer off the toast so Sonner doesn't pause the timer. Shots are taken once the enter animation has finished:
Also checked in the running app: the close button dismisses the error toast, and a "Token created" success toast still disappears on its own.
toast.test.tsxcovers the error and rejectedtoast.promisecases staying visible, dismissing them with the close button, and success toasts still timing out. With the persistent duration removed, the two error cases fail.Decision log
duration: Infinityon the shared<Toaster>for every toast type. Product feedback: only error toasts were reported, so success and info toasts should keep their timer.<Toaster>withuseSonnerand change them afterward. That would add subscription and timer-ordering issues.toastobject in place. The wrapper plus a lint rule is explicit and enforced.runPlan.ts) usestoast()with a timer that matches its undo window, so it isn't affected.toast.promiseandtoast.errorpaths the tests cover.Generated by Coder Agents on behalf of @chrifro.