Skip to content
SprecherEast
Issue 1378

Toast with tone, ending and placement

Back to our plan
Done
enhancementfrontenduxpriority: medium

Problem

Toast has one look, one place and only a close button. It cannot show a type (information, success, warning, error), fade after a set time, wait for an accept button, or sit inside a panel.

Proposed fix

Rebuild Toast on Radix Toast and reuse Alert's tones and icons (the icon map defined once and shared). Props: tone, ending (fade with durationMs, default 5 s; close; accept with its button label), and placement (panel inside the nearest positioned container, or screen as today). A fading toast pauses while hovered or focused. Reduced motion: no slide. The existing version-check toast keeps working.

Existing work compared

Radix Toast chosen over Sonner and a custom timer (native, then official/established plugin, then our code); check its audit and maintenance when installing, and record it here.

Acceptance criteria

  • Not done: Each of the four tones shows its own icon and color, checked light and dark at 4.5:1.
  • Not done: fade closes after its duration and pauses while hovered or focused; close and accept stay until used.
  • Not done: accept calls the caller's handler and then closes.
  • Not done: panel placement covers only the top edge of its container; screen is unchanged.
  • Not done: Screen readers announce it politely (errors assertively); reduced motion has no slide.
  • Not done: Tests, axe check, gallery entry and docs/ui/component-set.md row.

Files likely touched

src/platform/ui/Toast.tsx, Alert.tsx (shared icon map), VersionCheck.client.tsx, gallery, component-set docs, package.json.

Must not touch

Account, auth and deploy code.


Generated by Claude Code, opens in a new tab

See it on GitHub, opens in a new tab