Toast with tone, ending and placement
Back to our planProblem
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:
fadecloses after its duration and pauses while hovered or focused;closeandacceptstay until used. - Not done:
acceptcalls the caller's handler and then closes. - Not done:
panelplacement covers only the top edge of its container;screenis 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.mdrow.
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