fix(toast): a toast's time starts once it is painted, not when it is queued (#948) #950

Closed
kayg wants to merge 0 commits from fix/palette-notice-hold into dev
Owner

Fixes #948.

Root cause

apps/web/e2e/composer-tasks.spec.ts:115 ("a line about a person makes a contact card, Undo deletes it") failed 10/10 on WebKit on origin/dev. It is not a test problem. The bar toast's clock (inbar.svelte.ts tick()) started when the toast was queued, before its view existed. On a screen that draws about a frame a second (WebKit in software on a busy host, a slow phone), the toast's entry morph took ~4 s of wall time, Playwright's hover() waited 4 to 10 s for "visible and stable", and by the time the pointer could land and hold the clock the toast had used up its time (page snapshot at the timeout: contact created, no status). The same happens to a person on a slow screen: Undo for an action already written can run out before it has been painted. Evidence and probes are on #948.

Fix

The toast's view (bar/Toast.svelte) sets toastBar.settling on mount and clears it two frames later; the clock stands still while it is set (inbar.svelte.ts). A toast's time is now counted from when it has been painted, as the presenter's own doc already says ("for duration ms from when it's visible"). Unit test added (inbar.test.ts). The e2e spec is unchanged: no assertion, timeout or retry was touched.

(The branch history has one reverted commit: my first guess, a hover hold on the phone's palette row, was wrong for desktop; the net diff is the three files above.)

Fixes #948. ## Root cause `apps/web/e2e/composer-tasks.spec.ts:115` ("a line about a person makes a contact card, Undo deletes it") failed 10/10 on WebKit on origin/dev. It is not a test problem. The bar toast's clock (`inbar.svelte.ts tick()`) started when the toast was **queued**, before its view existed. On a screen that draws about a frame a second (WebKit in software on a busy host, a slow phone), the toast's entry morph took ~4 s of wall time, Playwright's `hover()` waited 4 to 10 s for "visible and stable", and by the time the pointer could land and hold the clock the toast had used up its time (page snapshot at the timeout: contact created, no `status`). The same happens to a person on a slow screen: Undo for an action already written can run out before it has been painted. Evidence and probes are on #948. ## Fix The toast's view (`bar/Toast.svelte`) sets `toastBar.settling` on mount and clears it two frames later; the clock stands still while it is set (`inbar.svelte.ts`). A toast's time is now counted from when it has been painted, as the presenter's own doc already says ("for `duration` ms from when it's visible"). Unit test added (`inbar.test.ts`). The e2e spec is unchanged: no assertion, timeout or retry was touched. (The branch history has one reverted commit: my first guess, a hover hold on the phone's palette row, was wrong for desktop; the net diff is the three files above.)
The row in the palette was cleared by a fixed 7 s timer; hovering it did not hold it, unlike the
bar's toast. Undo vanished under the pointer whenever anything took longer than 7 s.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The bar toast's clock ran from the moment it was queued. On a screen that draws about a frame a
second (WebKit in software on a busy machine, a slow phone) most of the time was gone before the
toast could be seen, let alone pointed at to hold it: the contact-card Undo test lost its toast
while Playwright was still waiting for the entry motion to settle. The toast's view now holds the
clock until two frames after it mounted.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Revert "fix(composer): the 'added · Undo' row waits while you point at it or focus it (#948)"
Some checks failed
CI / server (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
CI / web (pull_request) Has been cancelled
Markdown extraction contract / markdown-native-contract (pull_request) Has been cancelled
Markdown extraction contract / markdown-editor-contract (pull_request) Has been cancelled
4a6af83659
This reverts commit 1a805b2732.
Author
Owner

Gates (dev-01, CI=1 --retries=0 --workers=1, via ~/bin/slot, head 4a6af836, backend from the a11y tree, which has the same backend as dev)

  • composer-tasks.spec.ts:115 (the failing test), --repeat-each=10, webkit-1440: 10 passed. On origin/dev, same binary, same host: 10 failed of 10. The spec is unchanged.
  • composer-tasks, toast-bar, composer, bar-stays, bar-stable, lazy-ui on chromium-1440/390 + webkit-1440/390 (160 tests): 141 passed, 28 skipped, 1 failed: composer.spec:191 "nothing is clipped…" on webkit-390 hit the 30 s timeout ("browser closed"); --repeat-each=10 of it: 10/10 pass on this branch and 10/10 pass on origin/dev (flaky rule: not blocking; it does not touch the toast).
  • vitest ui: 90 passed (89 + the new "its time starts only once it has been painted" test); svelte-check: 2 errors + 15 warnings, identical to dev.

Not run: perf VMs or the Mac frame harness (the only runtime change is that the clock waits two frames for a toast that is mounting; nothing on the typing path or in any animation).

## Gates (dev-01, `CI=1 --retries=0 --workers=1`, via `~/bin/slot`, head `4a6af836`, backend from the a11y tree, which has the same backend as dev) - **`composer-tasks.spec.ts:115` (the failing test), `--repeat-each=10`, webkit-1440: 10 passed.** On origin/dev, same binary, same host: 10 failed of 10. The spec is unchanged. - `composer-tasks`, `toast-bar`, `composer`, `bar-stays`, `bar-stable`, `lazy-ui` on chromium-1440/390 + webkit-1440/390 (160 tests): **141 passed, 28 skipped, 1 failed**: `composer.spec:191` "nothing is clipped…" on webkit-390 hit the 30 s timeout ("browser closed"); `--repeat-each=10` of it: **10/10 pass on this branch and 10/10 pass on origin/dev** (flaky rule: not blocking; it does not touch the toast). - `vitest` ui: 90 passed (89 + the new "its time starts only once it has been painted" test); `svelte-check`: 2 errors + 15 warnings, identical to dev. Not run: perf VMs or the Mac frame harness (the only runtime change is that the clock waits two frames for a toast that is mounting; nothing on the typing path or in any animation).
Author
Owner

#950 per-PR gates: GREEN at 94fb425a

Head = 4a6af836 + merge of origin/dev b5e8dcb2 (no conflicts). Branch alone vs dev; CI=1 --retries=0 --workers=1 through ~/bin/slot.

gate result
lint / svelte-check pass / 2 errors, 16 warnings = dev's baseline
vitest web / ui primitives 107 / 56 pass
Chromium (dev-01) 1440+390: toast-bar, composer, composer-tasks, trash, select-rows 59 passed, 9 skipped, 0 failed
WebKit (dev-02) same specs run 1: 5 failed (all webkit-390, composer-tasks / composer, while 3 jobs shared the host). Rerun: 58 passed, 10 skipped, 0 failed. composer-tasks --repeat-each=10 on the branch: 60/60 passed. Does not reproduce: not blocking, for the flaky lane
perf/web.sh --bundle-only --gate pass. first-paint JS brotli 232.828 KB vs dev 232.862 (−34 B); first CSS 18.571 = dev
check-ui-primitives not on dev yet (#941)
Rust perf n/a
## #950 per-PR gates: GREEN at `94fb425a` Head = `4a6af836` + merge of origin/dev `b5e8dcb2` (no conflicts). Branch alone vs dev; `CI=1 --retries=0 --workers=1` through `~/bin/slot`. | gate | result | |---|---| | lint / svelte-check | pass / 2 errors, 16 warnings = dev's baseline | | vitest web / ui primitives | 107 / 56 pass | | Chromium (dev-01) 1440+390: toast-bar, composer, composer-tasks, trash, select-rows | 59 passed, 9 skipped, 0 failed | | WebKit (dev-02) same specs | run 1: 5 failed (all `webkit-390`, composer-tasks / composer, while 3 jobs shared the host). Rerun: 58 passed, 10 skipped, 0 failed. `composer-tasks` `--repeat-each=10` on the branch: 60/60 passed. **Does not reproduce: not blocking, for the flaky lane** | | `perf/web.sh --bundle-only --gate` | pass. first-paint JS brotli 232.828 KB vs dev 232.862 (−34 B); first CSS 18.571 = dev | | `check-ui-primitives` | not on dev yet (#941) | | Rust perf | n/a |
Author
Owner

Merged into dev by the orchestrator (U1 per-PR gates GREEN), dev head 34c14822.

Merged into dev by the orchestrator (U1 per-PR gates GREEN), dev head 34c14822.
kayg closed this pull request 2026-11-05 16:51:06 +00:00
Some checks failed
CI / server (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
CI / web (pull_request) Has been cancelled
Markdown extraction contract / markdown-native-contract (pull_request) Has been cancelled
Markdown extraction contract / markdown-editor-contract (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!950
No description provided.