docs(decisions): clarify 0019, island's Toast runs the clock
Sonner 2 doesn't pause on focus, so island's Toast runs the clock and sonner only places the toast. The index line now says focus pauses a toast and that callers never pass duration Infinity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f4e9febad7
commit
636430640d
|
|
@ -3,15 +3,19 @@
|
|||
Status: Accepted · Area: design · Date: 2026-10-06 · Decided by: user
|
||||
|
||||
## Context
|
||||
|
||||
Action-error toasts stayed until dismissed (`duration: Infinity`), so one could follow the person to the next pages and never leave. The user asked for every toast to disappear after a delay.
|
||||
|
||||
## Decision
|
||||
|
||||
- Every toast closes on its own: success and info after 4 seconds (6 with an action), errors after 8 seconds (10 with their «تلاش دوباره» or reload button).
|
||||
- Island's `showToast` sets these defaults by tone; callers pass `duration` only for a reason they can name, never `Infinity`.
|
||||
- Hovering or focusing a toast, or leaving the tab, pauses its clock (sonner 2 does this itself).
|
||||
- Hovering or focusing a toast, or leaving the tab, pauses its clock. Island's `Toast` runs that clock, because sonner 2 doesn't pause on focus; sonner only places the toast.
|
||||
|
||||
## Alternatives
|
||||
|
||||
- Errors stay until dismissed: the skill's default; replaced at the user's request.
|
||||
|
||||
## Consequences
|
||||
|
||||
- What an error asks the person to do must also show on the page (a field error, the form alert or the state), not only in the toast, as the form rules already require.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
- 0002 Render every tag through island `Element`, flex layouts through `FlexBox`, grid layouts through `GridBox`; never native JSX tags or `flex`/`grid` classes, island included.
|
||||
- 0011 Serve Yekan Bakh FaNum (`font-sans`, all UI text) and Yekan Bakh (`font-latin`, شبا and bank codes only) from `public/fonts/` under fixed names declared in island `fonts.css`; no version, never hashed, never `next/font`; a changed font gets a new name.
|
||||
- 0019 Close every toast by itself: success and info after 4 s (6 with an action), errors after 8 s (10 with an action); hovering or a hidden tab pauses it; never `duration: Infinity`.
|
||||
- 0019 Close every toast by itself: success and info after 4 s (6 with an action), errors after 8 s (10 with an action); hovering, focus or a hidden tab pauses it; callers never pass `duration: Infinity`.
|
||||
|
||||
## Architecture (ADR)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue