Skip to content

chore(deps): upgrade sonner to 2.0.8 - #18

Merged
agentHits merged 4 commits into
AgentHits-Devfrom
chore/deps-sonner-2
Oct 7, 2026
Merged

agentHits merged 4 commits into
AgentHits-Devfrom
chore/deps-sonner-2

Conversation

@agentHits

Copy link
Copy Markdown
Collaborator

What changed

  • apps/dokploy: sonner ^1.7.4 -> ^2.0.8 (resolved with a 3-day minimum release age). bun.lock updated; no other package moved.
  • No code changes were needed. The only Toaster in the app is components/ui/sonner.tsx, mounted once in pages/_app.tsx as <Toaster richColors />.

What the release notes say

v2.0.0 is announced as "mostly bug fixes". The actual diff between 1.7.4 and 2.0.8 (source at v1.7.3, whose styles.css is byte-identical to the 1.7.4 dist, and v2.0.8, plus dist/index.d.ts and dist/styles.css of both installed versions) shows these changes:

Removed API (not used here)

  • Toaster props loadingIcon (use icons.loading) and pauseWhenPageIsHidden. We already use icons.loading.
  • Types are now exported with export type. import { type ToasterProps } in our wrapper still works.

Added API (not used here)

  • toast.promise success/error can return an object with toast options ({ message, description, ... }). The return type of toast.promise (id & { unwrap }) did not change.
  • Multiple toasters (Toaster id / toasterId), testId, customAriaLabel, toastOptions.closeButtonAriaLabel.

Behaviour changes

  • Toasts always pause their timer while the browser tab is hidden (in 1.x this was opt-in via pauseWhenPageIsHidden). A toast fired while you are in another tab stays until you come back and the 4 s run out.
  • Default viewport offset from the screen edge: 32px -> 24px (desktop). Mobile stays at 16px. Default position (bottom-right), duration (4000 ms), gap (14px), visible toasts (3) and width (356px) are unchanged.
  • The "lift" of collapsed toasts on hover (data-lifted, translateY(-10px)) is gone. Hovering still expands the stack.
  • Swipe to dismiss needs 45px instead of 20px (or a fast flick), and dragging in a non-dismiss direction is dampened instead of blocked.
  • toast.dismiss(id) is applied on the next animation frame, and onDismiss now also fires for programmatic dismissals.
  • A promise that resolves with an Error instance now shows the error toast. Our 4 toast.promise calls resolve with undefined or reject, so they behave as before.
  • A toast whose title is a React element now gets the normal icon + content layout instead of being rendered raw. No call in the app passes JSX as the title (243 files import toast; they use toast.success/error/info/warning with strings and description/id/duration, plus 4 toast.promise).
  • classNames.default now applies only to untyped toasts (unused here).
  • The close button is hidden on loading toasts (we do not enable closeButton).

Styling

  • All :where(...) wrappers were removed, so sonner's built-in selectors have more specificity. It makes no difference here: sonner's injected CSS is unlayered and already beat Tailwind v4 layered utilities, and our only custom classes (toaster group on the list, cn-toast on each toast) carry no styles. No CSS in the repo targets [data-sonner-*], [data-theme] or [data-rich-colors].
  • The theme attribute on the toaster was renamed data-theme -> data-sonner-theme. Nothing in the repo targets it.
  • --normal-bg, --normal-text, --normal-border, --border-radius that the wrapper sets are still read the same way. The close button now uses them too, instead of the hard-coded gray palette.
  • Rich colors palette tweaks (the app uses richColors):
    • light: success border hsl(145 92% 91%) -> 87% (slightly darker green), info border 91% -> 93% (lighter), warning border 91% -> 84% (darker yellow);
    • dark: info border hsl(223 100% 12%) -> hsl(223 43% 17%) (more gray, lighter), warning border 12% -> 9% lightness.
      Backgrounds and text colors of rich toasts did not change.
  • Description text: non-rich toasts now get #3f3f3f (light) / hsl(0 0% 91%) (dark) for descriptions. Rich toasts keep color: inherit, so success/error/info/warning descriptions still use the toast's text color. Only loading/plain toasts with a description would look different, and the app has none.
  • The content column now has flex: 1; min-width: 0, so title/description take the full width next to the icon. Very long unbreakable strings in error messages (URLs, IDs) may wrap or overflow slightly differently.
  • filter: blur(0) was dropped from the toast, and the hover/swipe "ghost" areas changed size.

How it was verified

  • bun run typecheck (all workspaces): passes.
  • bunx biome check on apps/dokploy/package.json, components/ui/sonner.tsx, pages/_app.tsx: clean.
  • vitest run in apps/dokploy (*.real.test.ts excluded; they need Docker): 229/234 files, 2051 tests passed. The 6 failures are timeouts in tests that shell out to Docker (backup injection, env-file literals, docker version probe, cloud queue setup) or ran under very high machine load; server-setup and better-auth-schema-compat pass when rerun on their own. No test mocks or imports sonner.
  • import("sonner") resolves under Bun and exports Toaster, toast, useSonner.
  • next build was not run locally; CI builds it.

What to check by hand on dev

  1. Trigger a success toast (e.g. save any settings form) and an error toast (e.g. a failing connection test in Settings -> Destinations or Git providers) in light and dark themes. Expected: same rich green/red look, the lucide icons, descriptions in the toast's own color. Borders of info/warning toasts are slightly different.
  2. The toast stack sits 8px closer to the bottom-right corner.
  3. Fire 3+ toasts quickly, hover the stack: it expands as before but no longer lifts by 10px while collapsed.
  4. Swipe a toast right to dismiss: needs a slightly longer drag.
  5. Fire a toast, switch to another tab for >4 s, come back: the toast is still there and then disappears (new pause-on-hidden behaviour).
  6. Deploy a template (Create Service -> Template -> Confirm) and start/stop/delete a service from the environment page and the overview: the loading toast should turn into a success or error toast as before.
  7. Register / reset password pages: their toasts use duration: 2000 and should still close after 2 s.

🤖 Generated with Claude Code

@agentHits
agentHits merged commit 5e0698b into AgentHits-Dev Oct 7, 2026
7 of 8 checks passed
@agentHits
agentHits deleted the chore/deps-sonner-2 branch October 7, 2026 04:51
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.

1 participant