Toasts: animation, kinds, pause on hover, stack cap, actions #318

Closed
opened 2026-10-07 20:43:22 -04:00 by Salastil · 1 comment
Owner

Toasts.tsx + store.ts:4699-4705 + app.css:2560-2589: a fixed 6s auto-dismiss for everything, no pause on hover, only info/error (error just recolours text), no stack limit or de-duplication, no animation, no role="status"/aria-live, no action button.

Fix: slide in/out; info/success/error with icons; pause on hover; at most 3, duplicates collapsed; aria-live; an optional action (Retry, Undo, View). Unit-tested cap and de-dup.

Part of the v1.0 UI pass.

`Toasts.tsx` + store.ts:4699-4705 + app.css:2560-2589: a fixed 6s auto-dismiss for everything, no pause on hover, only info/error (error just recolours text), no stack limit or de-duplication, no animation, no `role="status"`/`aria-live`, no action button. **Fix:** slide in/out; info/success/error with icons; pause on hover; at most 3, duplicates collapsed; `aria-live`; an optional action (Retry, Undo, View). Unit-tested cap and de-dup. _Part of the v1.0 UI pass._
Salastil added this to the v1.0 milestone 2026-10-07 20:43:22 -04:00
Salastil added the feature label 2026-10-07 20:43:22 -04:00
Author
Owner

Finished: 2d1b8be.

Before (left) and after (right) - the same burst of messages:

toasts

A short recording of one arriving and leaving: toast-motion.mp4

  • Three kinds - info (blue edge), success (green), error (red) - said by the edge and the icon instead of recolouring the words pink.
  • Slide in and out (--motion, still when the system asks for reduced motion).
  • Pause on hover: the countdown is held while the pointer is on a toast and starts over when it leaves; a toast that is long, an error, or has a button stays longer (toastLifetime).
  • Repeats fold: the same words saying the same thing again are one toast with "×3", and saying it again restarts its time, instead of a column of copies.
  • At most three; the oldest gives way.
  • role="status" / aria-live="polite" so a screen reader says them.
  • An optional action button (store.toast(kind, text, { label, onClick })) - nothing uses one yet; Retry / Undo / View can now be attached where they make sense.
  • The stack rules (addToast, toastLifetime) have unit tests. "Link copied" is a success toast now.
Finished: [2d1b8be](https://git.salastil.com/Salastil/moho/commit/2d1b8beb8db85953d643dfa7ab72f77f904ce132). Before (left) and after (right) - the same burst of messages: ![toasts](https://git.salastil.com/attachments/02c451fe-9e50-45f4-9b85-8f8ff6afad4c) A short recording of one arriving and leaving: [toast-motion.mp4](https://git.salastil.com/attachments/0cd1c3ec-e300-4522-abe0-453164552347) - **Three kinds** - info (blue edge), success (green), error (red) - said by the edge and the icon instead of recolouring the words pink. - **Slide in and out** (`--motion`, still when the system asks for reduced motion). - **Pause on hover**: the countdown is held while the pointer is on a toast and starts over when it leaves; a toast that is long, an error, or has a button stays longer (`toastLifetime`). - **Repeats fold**: the same words saying the same thing again are one toast with "×3", and saying it again restarts its time, instead of a column of copies. - **At most three**; the oldest gives way. - `role="status"` / `aria-live="polite"` so a screen reader says them. - **An optional action button** (`store.toast(kind, text, { label, onClick })`) - nothing uses one yet; Retry / Undo / View can now be attached where they make sense. - The stack rules (`addToast`, `toastLifetime`) have unit tests. "Link copied" is a success toast now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Salastil/moho#318