Skip to content

Toasts: collapse to the one house system (CL-6372) - #117

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-6372-toasts
Aug 20, 2026
Merged

TheGreatAxios merged 2 commits into
mainfrom
cl-6372-toasts

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

A failed workbench create fired two toasts: a tokened grey box
bottom-center and a default white rounded pill bottom-right. Both
implementations found:

  • @corbits/react-ui's house Toaster/toast() — mounted once
    in apps/web/src/main.tsx per docs/toasts.md, wraps sonner
    internally with house styling (corbits-toast: border-border-strong,
    bg-card, shadow-surface, no radius), bottom-center placement,
    replace-not-stack semantics, and prefers-reduced-motion handling
    (theme.css).
  • A second, raw <Toaster /> imported straight from sonner
    mounted again in apps/web/src/app.tsx, styled with sonner's
    defaults (bottom-right, white rounded pill).

sonner's toast() renders into every mounted Toaster, so every
@corbits/react-ui toast() call — including the workbench-create
failure toast in new-workbench-picker.tsx — rendered twice.

Fix

Dropped the stray sonner import/mount from app.tsx and the now-
unused direct sonner dependency from apps/web/package.json
(sonner still ships transitively as @corbits/react-ui's own
dependency). No call site needed migrating — every emission in the
app already used @corbits/react-ui's toast(); the raw Toaster
mount was the only sonner usage in the app.

react-ui already ships the house toast primitive, so per the ticket
this uses it rather than writing a second one in workbench.

Known gap (flagging, not fixing here)

The ticket also asks for a destructive tint on error toasts and a
~5s auto-dismiss. Neither exists in the current pinned react-ui
toast (toast.tsx, v0.1.0): it's a single plain-text variant with an
1800ms duration, by design (see its own doc comment and shipped
tests). Since core UI components live in corbitsdev/react-ui and
this repo only composes them, adding an error variant belongs
upstream — flagging for a follow-up there rather than reimplementing
styling divergence in workbench.

Test plan

  • bun test in apps/web — 582 pass, including new
    apps/web/test/toast-single-system.test.tsx: one failure event
    fires exactly one toast, house styling, replace-not-stack, and
    auto-dismiss.
  • bun run typecheck in apps/web — clean.
  • bun run build in apps/web — clean.
  • bun run scripts/checks/react-ui-drift.ts — ok.
  • bun run scripts/checks/ui-vocabulary.ts — ok.
  • bun run scripts/checks/react-ui-pin.ts — ok.

Pins that one failure fires exactly one toast, carries the house
styling, and clears itself — the bug this branch fixes let a failed
workbench create fire two: react-ui's styled Toaster and a second,
raw sonner Toaster mounted alongside it.
A failed workbench create fired two toasts — react-ui's styled
`<Toaster />` (mounted once in main.tsx, per docs/toasts.md) and a
second, unstyled `<Toaster />` imported straight from sonner and
mounted again in app.tsx. Sonner's toast() renders into every mounted
Toaster, so one call rendered twice: the tokened grey box bottom-center
and a default white pill bottom-right.

Drop the stray sonner import and mount; react-ui's Toaster already
wraps sonner with the house styling, bottom-center placement, replace-
not-stack semantics, and prefers-reduced-motion handling, so nothing
else changes. Every emission site already called @corbits/react-ui's
toast() — grep confirms app.tsx's raw Toaster was the only sonner
usage in the app. Drop the now-unused direct sonner dependency from
apps/web/package.json.
@TheGreatAxios
TheGreatAxios merged commit dc6cbaa into main Aug 20, 2026
0 of 2 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-6372-toasts branch August 25, 2026 15:29
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