From 0e08e91757cea9d4a3150d1c413123a7b1d53c6e Mon Sep 17 00:00:00 2001 From: LHaghfoss Date: Sun, 22 Nov 2026 01:18:31 +0100 Subject: [PATCH 1/4] fix(desktop): tidy the toast's action, stack and timer line --- apps/desktop/src/index.css | 15 ---- apps/desktop/src/ui/Toaster.tsx | 125 ++++++++++++++++++-------------- docs/design.md | 11 +-- 3 files changed, 76 insertions(+), 75 deletions(-) diff --git a/apps/desktop/src/index.css b/apps/desktop/src/index.css index b1199a860..28811386e 100644 --- a/apps/desktop/src/index.css +++ b/apps/desktop/src/index.css @@ -1398,21 +1398,6 @@ transform-origin: bottom center; transition: transform 220ms var(--ease-snappy); } -/* An auto-dismissing card's clock, along its foot: a 1px accent hairline that drains. */ -@keyframes rc-toast-timer { - from { - transform: scaleX(1); - } - to { - transform: scaleX(0); - } -} -.rc-toast-timer { - animation-name: rc-toast-timer; - animation-timing-function: linear; - animation-fill-mode: forwards; - transform-origin: left center; -} /* * Skeletons: a quiet block where content will appear, swept by a soft diff --git a/apps/desktop/src/ui/Toaster.tsx b/apps/desktop/src/ui/Toaster.tsx index 05ae08289..8939f6de9 100644 --- a/apps/desktop/src/ui/Toaster.tsx +++ b/apps/desktop/src/ui/Toaster.tsx @@ -1,6 +1,8 @@ // Up to three toasts, newest in front (state/toasts.ts keeps the queue), frosted // like the composer, in the window's bottom-right corner, away from the -// transcript being read. Info and success leave after 2.5 s, errors after 5 s. +// transcript being read. At rest the cards behind the front one take its +// height and hide their text, so only their edges peek above it. Info and +// success leave after 2.5 s, errors after 5 s. // The pointer or focus on the stack, a drag, or the window in the background // stops the clock. A click anywhere on the card, ×, Escape, or a drag past 48px // sideways or 24px down dismisses; a drag never selects text anywhere. @@ -17,16 +19,16 @@ import { TOAST_DRAG_MS, } from "../lib/toastDrag"; import { dismissToast, expireToasts, setToastsPaused, type Toast, useApp } from "../state/store"; -import { nextExpiry, toastTtl } from "../state/toasts"; +import { nextExpiry } from "../state/toasts"; import { CircleAlert, CircleCheck, Info, X } from "./icons"; -import { cx, Pill, Spinner } from "./primitives"; +import { cx, Spinner } from "./primitives"; /** How far the cards behind the front one peek over its top edge, and how much smaller each is. */ const TOAST_PEEK = 6; const TOAST_SHRINK = 0.04; -/** The 8px between fanned-out cards. */ /** The stack's distance from the window's bottom and right edges. */ const TOAST_INSET = 16; +/** The 8px between fanned-out cards. */ const TOAST_GAP = 8; /** A quiet settle on the check after a spinner finishes. */ const TOAST_SETTLE_MS = 320; @@ -50,11 +52,12 @@ interface DragSession { function ToastCard({ toast, - paused, + compactHeight, onDrag, }: { toast: Toast; - paused: boolean; + /** A card behind the front one at rest: drawn at the front card's height with its text hidden. */ + compactHeight?: number; onDrag: (dragging: boolean) => void; }) { const ref = useRef(null); @@ -167,6 +170,7 @@ function ToastCard({ const timer = setTimeout(() => setSettled(false), TOAST_SETTLE_MS); return () => clearTimeout(timer); }, [spinning, toast.tone]); + const compact = compactHeight !== undefined; return (
- - {spinning ? ( - - ) : ( - +
-

{toast.text}

- {toast.action && ( - { - toast.action?.run(); - dismissToast(toast.id); - }} - > - {toast.action.label} - - )} - - {toast.persist && toast.progress !== undefined ? ( + + {spinning ? ( + + ) : ( + + )} + +

{toast.text}

+
+ {toast.action && ( + // The one thing to do about the message, in the accent as text: it reads as the + // card's action without outweighing the message the way a filled pill did. + + )} + +
+
+ {toast.persist && toast.progress !== undefined && ( - ) : toast.persist ? null : ( - // An auto-dismissing card drains a 1px accent hairline along its foot; it stops with - // the clock while the stack is held by the pointer, focus or a drag. - - - )}
); @@ -354,7 +362,11 @@ export function Toaster() { : `translateY(${-index * TOAST_PEEK}px) scale(${Math.max(0.9, 1 - index * TOAST_SHRINK)})`, }} > - + 0 ? heights[toasts[0]?.id ?? ""] : undefined} + onDrag={setDragging} + /> ))} @@ -380,9 +392,12 @@ function ToastSlot({ useEffect(() => { const el = ref.current; if (!el) return; - const report = () => onHeight(id, el.offsetHeight); + // The card's body keeps its natural height while a compact card is clamped to the front + // one's, so the fanned-out offsets are known before the stack opens. + const body = el.querySelector("[data-toast-body]") ?? el; + const report = () => onHeight(id, body.offsetHeight); report(); - return observeSize(el, report); + return observeSize(body, report); }, [id, onHeight]); return (
diff --git a/docs/design.md b/docs/design.md index cab4c2c2b..18109906a 100644 --- a/docs/design.md +++ b/docs/design.md @@ -674,14 +674,15 @@ a raw element. `?catalog` in a dev build shows them all on one page. - **Toast:** `.rc-toast rounded-2xl` (strong glass and a slight shadow), 380px wide, `py-1.5 pl-3 pr-1.5 text-callout`: an icon (info `text-fg-muted`, success `text-success`, error `text-danger`, a spinner while it has progress), the text in `text-fg` (up to 3 lines), at - most one action as a secondary pill (`h-6 bg-fill`), and a close button. + most one action as accent text (`h-6 px-2 font-medium text-accent`, a + `bg-accent/10` hover) kept tight beside a quiet close button. Progress is a 2px accent bar along its foot. `Toaster` shows at most three (`state/toasts.ts` enforces the queue), newest on top: at rest only the - front card is fully shown, the others peeking 6px above it, and hovering or + front card is fully shown, the others taking its height with their text + hidden and peeking 6px above it, and hovering or focusing the stack fans them out 8px apart, upward. In the window's - bottom-right corner, 16px in, away from the transcript being read. An - auto-dismissing card drains a 1px accent hairline along its foot, which - stops with its clock; a card replaced in place from spinner to check settles + bottom-right corner, 16px in, away from the transcript being read. No timer + line: a card's clock is not drawn. A card replaced in place from spinner to check settles onto the check. The same message again refreshes its card and restarts its time instead of stacking; past three, the oldest is dropped. Info and success leave after 2.5s, errors after 5s. The pointer or focus on From e3944738dabd06e73ffa2acbdefc19c10b822368 Mon Sep 17 00:00:00 2001 From: LHaghfoss Date: Sun, 22 Nov 2026 01:21:15 +0100 Subject: [PATCH 2/4] fix(desktop): drop new comments from the toast --- apps/desktop/src/ui/Toaster.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apps/desktop/src/ui/Toaster.tsx b/apps/desktop/src/ui/Toaster.tsx index 8939f6de9..66f5fb616 100644 --- a/apps/desktop/src/ui/Toaster.tsx +++ b/apps/desktop/src/ui/Toaster.tsx @@ -211,8 +211,6 @@ function ToastCard({

{toast.text}

{toast.action && ( - // The one thing to do about the message, in the accent as text: it reads as the - // card's action without outweighing the message the way a filled pill did. - )} - + + {toast.action && }
{toast.persist && toast.progress !== undefined && ( @@ -246,6 +248,49 @@ function ToastCard({ ); } +const ACTION_ICONS: Record ReactNode> = { + Undo: Undo2, + Open: ArrowUpRight, + "Release page": ExternalLink, + Restart: RotateCcw, + "Move…": FolderOpen, +}; + +function ToastActionButton({ toast, compact }: { toast: Toast; compact: boolean }) { + const action = toast.action; + if (!action) return null; + const ActionIcon = ACTION_ICONS[action.label]; + const run = () => { + action.run(); + dismissToast(toast.id); + }; + if (!ActionIcon) { + return ( + + ); + } + return ( + + + + ); +} + export function Toaster() { const toasts = useApp((s) => s.toasts); const section = useRef(null); diff --git a/docs/design.md b/docs/design.md index 18109906a..1e97f23ef 100644 --- a/docs/design.md +++ b/docs/design.md @@ -674,8 +674,11 @@ a raw element. `?catalog` in a dev build shows them all on one page. - **Toast:** `.rc-toast rounded-2xl` (strong glass and a slight shadow), 380px wide, `py-1.5 pl-3 pr-1.5 text-callout`: an icon (info `text-fg-muted`, success `text-success`, error `text-danger`, a spinner while it has progress), the text in `text-fg` (up to 3 lines), at - most one action as accent text (`h-6 px-2 font-medium text-accent`, a - `bg-accent/10` hover) kept tight beside a quiet close button. + most one action, and a close button. Every card is at least two lines tall + (60px) with the text centred; the right edge is a column of 24px icon + buttons, × at the top and the action's icon in the accent below it (Undo ↶, + Open ↗, Release page, Restart, Move…), each named by a tooltip on its left. + An action without an icon stays accent text. Progress is a 2px accent bar along its foot. `Toaster` shows at most three (`state/toasts.ts` enforces the queue), newest on top: at rest only the front card is fully shown, the others taking its height with their text From 7e20cb319ef80ba97f6bd0a3eaf962b5badd9c89 Mon Sep 17 00:00:00 2001 From: LHaghfoss Date: Sun, 22 Nov 2026 10:52:18 +0100 Subject: [PATCH 4/4] fix(desktop): put a tinted Undo/Open button on the dismiss row --- apps/desktop/src/ui/Toaster.tsx | 67 ++++++++++++--------------------- docs/design.md | 8 ++-- 2 files changed, 28 insertions(+), 47 deletions(-) diff --git a/apps/desktop/src/ui/Toaster.tsx b/apps/desktop/src/ui/Toaster.tsx index 5618143f0..667798f47 100644 --- a/apps/desktop/src/ui/Toaster.tsx +++ b/apps/desktop/src/ui/Toaster.tsx @@ -31,7 +31,7 @@ import { Undo2, X, } from "./icons"; -import { cx, Spinner, Tooltip } from "./primitives"; +import { cx, Spinner } from "./primitives"; /** How far the cards behind the front one peek over its top edge, and how much smaller each is. */ const TOAST_PEEK = 6; @@ -201,11 +201,11 @@ function ToastCard({ data-toast-body aria-hidden={compact || undefined} className={cx( - "flex min-h-[60px] items-stretch gap-2 py-1.5 pr-1.5 pl-3 transition-opacity duration-150 ease-out", + "flex items-start gap-2 py-1.5 pr-1.5 pl-3 transition-opacity duration-150 ease-out", compact && "opacity-0", )} > -
+
{spinning ? ( @@ -221,19 +221,17 @@ function ToastCard({

{toast.text}

-
- - - +
{toast.action && } +
{toast.persist && toast.progress !== undefined && ( @@ -260,34 +258,19 @@ function ToastActionButton({ toast, compact }: { toast: Toast; compact: boolean const action = toast.action; if (!action) return null; const ActionIcon = ACTION_ICONS[action.label]; - const run = () => { - action.run(); - dismissToast(toast.id); - }; - if (!ActionIcon) { - return ( - - ); - } return ( - - - + ); } diff --git a/docs/design.md b/docs/design.md index 1e97f23ef..dd28acd0a 100644 --- a/docs/design.md +++ b/docs/design.md @@ -674,11 +674,9 @@ a raw element. `?catalog` in a dev build shows them all on one page. - **Toast:** `.rc-toast rounded-2xl` (strong glass and a slight shadow), 380px wide, `py-1.5 pl-3 pr-1.5 text-callout`: an icon (info `text-fg-muted`, success `text-success`, error `text-danger`, a spinner while it has progress), the text in `text-fg` (up to 3 lines), at - most one action, and a close button. Every card is at least two lines tall - (60px) with the text centred; the right edge is a column of 24px icon - buttons, × at the top and the action's icon in the accent below it (Undo ↶, - Open ↗, Release page, Restart, Move…), each named by a tooltip on its left. - An action without an icon stays accent text. + most one action as a tinted button on the close button's row (`h-6 + bg-accent/12 text-accent`, the action's icon before its label: Undo ↶, + Open ↗), and a quiet close button. The card is as tall as its text. Progress is a 2px accent bar along its foot. `Toaster` shows at most three (`state/toasts.ts` enforces the queue), newest on top: at rest only the front card is fully shown, the others taking its height with their text