Mockup Automations: swipes + reorder #927

Open
opened 2026-11-04 10:38:44 +00:00 by kayg · 2 comments
Owner

kayg 11-04: Automations list rows' long swipe did nothing; steps could not be removed or reordered.

Done (branch review/calendar-2, mockup):

  1. Row swipe right: "Turn off" (on rows) / "Turn on" (off rows). Long swipe now runs it (shared swipe-row, row stays, pulses, dims to "Off", toast with Undo). Short swipe + tap works too.
  2. Steps (When / If / Do): swipe left Delete (long swipe + Undo toast), right-click / hold menu (Delete, Duplicate, Move up/down), drag to reorder in place (hover handle, hold on touch; others glide aside on a spring; accent slot shows the landing). Dragging into another section: dims, that section says "Not here", drop goes back. Keyboard: focus a chip, Delete removes, Alt+↑/↓ moves.
  3. Add a trigger / condition / step all work; the new chip springs in (spec).

Specs: apps/mockup/tests/automations-swipes.spec.ts, 21 pass (chromium + webkit, Mac VM, CI=1 --retries=0).

Open: WebKit frame table (next comment): 5 of 10 swipe runs and 1 of 10 drag runs have a slow frame (30–216 ms) around the state flip/toast; the existing Tasks swipe and the delete toast controls are clean. Not at zero yet; needs a profile of the flip re-render.

kayg 11-04: Automations list rows' long swipe did nothing; steps could not be removed or reordered. **Done (branch `review/calendar-2`, mockup):** 1. Row swipe right: "Turn off" (on rows) / "Turn on" (off rows). Long swipe now runs it (shared `swipe-row`, row stays, pulses, dims to "Off", toast with Undo). Short swipe + tap works too. 2. Steps (When / If / Do): swipe left Delete (long swipe + Undo toast), right-click / hold menu (Delete, Duplicate, Move up/down), drag to reorder in place (hover handle, hold on touch; others glide aside on a spring; accent slot shows the landing). Dragging into another section: dims, that section says "Not here", drop goes back. Keyboard: focus a chip, Delete removes, Alt+↑/↓ moves. 3. Add a trigger / condition / step all work; the new chip springs in (spec). Specs: `apps/mockup/tests/automations-swipes.spec.ts`, 21 pass (chromium + webkit, Mac VM, `CI=1 --retries=0`). **Open:** WebKit frame table (next comment): 5 of 10 swipe runs and 1 of 10 drag runs have a slow frame (30–216 ms) around the state flip/toast; the existing Tasks swipe and the delete toast controls are clean. Not at zero yet; needs a profile of the flip re-render.
Author
Owner
gesture (Mac VM, no video, rAF deltas) runs frames p50 ms p95 ms max ms frames >25 ms
WebKit: long swipe right (wheel) → settled 10 ~106 17.0 19–22 22–30 (3 runs 48/216) 5 runs had 1–3 slow frames
WebKit: mouse drag a condition down + drop 10 ~58 17.0 19–21 21–24 (1 run 111) 1 run
CONTROL WebKit idle 1.8 s 10 ~106 17.0 19–21 21–24 0
CONTROL WebKit Tasks row long swipe (existing) 10 ~107 17.0 18–20 20–23 0
CONTROL WebKit delete long swipe + toast (Tasks / Automations) 12+12 1 of 24 (26 ms)
Chromium on the Mac VM is software-rendered: its deltas (33–150 ms even for existing swipes) only prove the gesture ran; not performance.
| gesture (Mac VM, no video, rAF deltas) | runs | frames | p50 ms | p95 ms | max ms | frames >25 ms | |---|---|---|---|---|---|---| | WebKit: long swipe right (wheel) → settled | 10 | ~106 | 17.0 | 19–22 | 22–30 (3 runs 48/216) | 5 runs had 1–3 slow frames | | WebKit: mouse drag a condition down + drop | 10 | ~58 | 17.0 | 19–21 | 21–24 (1 run 111) | 1 run | | CONTROL WebKit idle 1.8 s | 10 | ~106 | 17.0 | 19–21 | 21–24 | 0 | | CONTROL WebKit Tasks row long swipe (existing) | 10 | ~107 | 17.0 | 18–20 | 20–23 | 0 | | CONTROL WebKit delete long swipe + toast (Tasks / Automations) | 12+12 | | | | | 1 of 24 (26 ms) | Chromium on the Mac VM is software-rendered: its deltas (33–150 ms even for existing swipes) only prove the gesture ran; not performance.
Author
Owner

Slow frames: cause, fix, before/after (WebKit, Mac VM, rAF deltas, no video)

Method. One fresh browser context per run, 2.5 s idle before the gesture, runs of every arm interleaved (so machine noise hits all arms alike). Window = from the end of the scripted wheel (+650 ms) for swipes; the whole run for the drag. A "slow run" = a run with any frame over 30 ms. The idle control is clean in all 60 runs, so the harness itself is not the source.

What I ruled out (profiled, not guessed). A main-thread stall probe (3 ms interval) shows no JS stall at the slow frames, so it is rendering, not script. Bisect, same harness:

  • the flip itself (state write, row dim, .next text, switch snap): without the toast 1/12 slow runs; the switch snaps on an outside change (no animation), the list is not re-keyed;
  • the toast alone, with no state flip: 4/12; the existing Delete + toast swipe, which has no flip at all, has the same rate as the toggle (A 6/30 vs Delete 5/30);
  • the swipe-row itself: the existing Tasks row swipe is clean (0/30 and 0/10 earlier).

Cause found. The toast's text animated every letter (≈35 inline-block spans, each with its own blur(2px) filter keyframe): ~35 animated, blurred layers starting in one frame (41 running animations on the first slow frame, vs 15 now). Switching the letter animation off drops the slow runs 9/30 → 1/30; a blur on the whole sentence instead did not help (18/30), so the count of animated pieces is the cost. Per-word rise-and-fade (opacity + translate, 5 layers, no blur) measured 2/30 against 3/30 for no animation at all. Shipped that: packages/ui/.../toast/ToastRow.svelte (shared toast; the ripple now runs word by word and the per-letter blur is gone; a visible look change for every toast, say if you want the letters back).
Drag. The lifted step used filter: drop-shadow on the moving element (repainted every frame). Now a box-shadow on the chip (drawn once).

arm (30 runs each, two sessions) slow runs, session 1 worst ms slow runs, session 2 worst ms
BEFORE: toggle long swipe, per-letter toast 8/30 142 7/30 83
AFTER: toggle long swipe 2/30 143 3/30 63
AFTER: step drag reorder (whole run) 2/30 (before the shadow fix) 187 2/30 64
control: Delete swipe + toast (existing) 1/30 65 4/30 248
control: Tasks row swipe (existing) 0/30 27 1/30 467
control: idle page 0/30 26 0/30 26

Not at zero. Slow runs fell from about 1 in 4 to about 1 in 12, but the toggle swipe, the drag and the existing controls still show a single 40–250 ms frame in some runs. The existing controls (Delete + toast, Tasks swipe) do it too, so what is left is shared swipe/toast cost, not the Automations flip. Profile of the leftover: always rendering, never script; at the toast's first frames (7 running animations: the glass seed, words, tray fades) and a few at lift. Suspects left: the toast glass's backdrop-filter layer appearing next to a still-settling row, and its width/height spring (layout properties). Turning the glass blur off did not clearly help (4/30 vs 9/30), so I stopped before guessing further. Next step would be a Safari Web Inspector timeline on std; needs the interactive Mac session.

Pushed to review/calendar-2 (fast-forward): a188ef1c (toast per word), 8ba43819 (box-shadow lift).

## Slow frames: cause, fix, before/after (WebKit, Mac VM, rAF deltas, no video) **Method.** One fresh browser context per run, 2.5 s idle before the gesture, runs of every arm interleaved (so machine noise hits all arms alike). Window = from the end of the scripted wheel (+650 ms) for swipes; the whole run for the drag. A "slow run" = a run with any frame over 30 ms. The idle control is clean in all 60 runs, so the harness itself is not the source. **What I ruled out (profiled, not guessed).** A main-thread stall probe (3 ms interval) shows no JS stall at the slow frames, so it is rendering, not script. Bisect, same harness: - the flip itself (state write, row dim, `.next` text, switch snap): without the toast 1/12 slow runs; the switch snaps on an outside change (no animation), the list is not re-keyed; - the toast alone, with no state flip: 4/12; the existing **Delete + toast** swipe, which has no flip at all, has the same rate as the toggle (A 6/30 vs Delete 5/30); - the swipe-row itself: the existing Tasks row swipe is clean (0/30 and 0/10 earlier). **Cause found.** The toast's text animated **every letter** (≈35 inline-block spans, each with its own `blur(2px)` filter keyframe): ~35 animated, blurred layers starting in one frame (41 running animations on the first slow frame, vs 15 now). Switching the letter animation off drops the slow runs 9/30 → 1/30; a blur on the whole sentence instead did not help (18/30), so the count of animated pieces is the cost. Per-word rise-and-fade (opacity + translate, 5 layers, no blur) measured 2/30 against 3/30 for no animation at all. Shipped that: `packages/ui/.../toast/ToastRow.svelte` (shared toast; the ripple now runs word by word and the per-letter blur is gone; a visible look change for every toast, say if you want the letters back). **Drag.** The lifted step used `filter: drop-shadow` on the moving element (repainted every frame). Now a `box-shadow` on the chip (drawn once). | arm (30 runs each, two sessions) | slow runs, session 1 | worst ms | slow runs, session 2 | worst ms | |---|---|---|---|---| | BEFORE: toggle long swipe, per-letter toast | 8/30 | 142 | 7/30 | 83 | | AFTER: toggle long swipe | 2/30 | 143 | 3/30 | 63 | | AFTER: step drag reorder (whole run) | 2/30 (before the shadow fix) | 187 | 2/30 | 64 | | control: Delete swipe + toast (existing) | 1/30 | 65 | 4/30 | 248 | | control: Tasks row swipe (existing) | 0/30 | 27 | 1/30 | 467 | | control: idle page | 0/30 | 26 | 0/30 | 26 | **Not at zero.** Slow runs fell from about 1 in 4 to about 1 in 12, but the toggle swipe, the drag and the existing controls still show a single 40–250 ms frame in some runs. The existing controls (Delete + toast, Tasks swipe) do it too, so what is left is shared swipe/toast cost, not the Automations flip. Profile of the leftover: always rendering, never script; at the toast's first frames (7 running animations: the glass seed, words, tray fades) and a few at lift. Suspects left: the toast glass's `backdrop-filter` layer appearing next to a still-settling row, and its width/height spring (layout properties). Turning the glass blur off did not clearly help (4/30 vs 9/30), so I stopped before guessing further. Next step would be a Safari Web Inspector timeline on std; needs the interactive Mac session. Pushed to review/calendar-2 (fast-forward): `a188ef1c` (toast per word), `8ba43819` (box-shadow lift).
Sign in to join this conversation.
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#927
No description provided.