diff --git a/docs/decisions/0019-every-toast-closes-by-itself.md b/docs/decisions/0019-every-toast-closes-by-itself.md index 34560d7..7cd4990 100644 --- a/docs/decisions/0019-every-toast-closes-by-itself.md +++ b/docs/decisions/0019-every-toast-closes-by-itself.md @@ -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. diff --git a/docs/decisions/README.md b/docs/decisions/README.md index a5f65ff..d36a672 100644 --- a/docs/decisions/README.md +++ b/docs/decisions/README.md @@ -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)