Editor checkboxes lack the spring check that mockups have #655

Closed
opened 2026-10-21 05:45:09 +00:00 by kayg · 4 comments
Owner

kayg (2026-10-21): checkboxes in the real editor in production don't have the spring check (sveltebits spring-check), though the mockups do.

Cause: the mockups use packages/ui/src/primitives/check/SpringCheck*.svelte. The editor draws [ ] with its own plain CodeMirror widget, packages/editor/src/syntax/widgets.ts CheckboxWidget, which has no motion. Also, eq() returns false when the state changes, so CodeMirror replaces the element and there is nothing left to animate.

kayg (2026-10-21): checkboxes in the real editor in production don't have the spring check (sveltebits spring-check), though the mockups do. Cause: the mockups use packages/ui/src/primitives/check/SpringCheck*.svelte. The editor draws `[ ]` with its own plain CodeMirror widget, packages/editor/src/syntax/widgets.ts CheckboxWidget, which has no motion. Also, eq() returns false when the state changes, so CodeMirror replaces the element and there is nothing left to animate.
Author
Owner

Spring check frame rate: root cause is the glass, not the spring (branch issue/spring-check-perf, head 31a55c6)

Profile (Chromium CDP, 1440, one run of 8 toggles): the main thread is ~90% idle (JS profile: 2.6 s idle of 2.9 s), and BeginMainFrame/raster total under 0.5 s. The cost is RunTask on VizCompositorThread: ~140 ms per frame, every frame that has any damage. The still page has no damage, so it costs nothing.

Bisect (Chromium 1440, frames toggling out of ~300 still):

  • baseline 40-51
  • all task-box transitions off: 40 (the spring is not the cost)
  • line colour/strike transition, sidebar row-in, cursor blink each off alone: 41-46
  • all of those off together: 276 (so it is damage from any animation)
  • backdrop-filter off on frame-fill + side/list panes: 116; plus canvas filter: blur(6px) off: 337 (ratio 1.03)
  • will-change / isolation / own layers on the box, editor, canvases: no change (40)

So: the three wide-layout backdrop-filter panes (side 228x880, list 320x880, editor frame-fill 862x880 at blur(36px)) over blurred sky canvases are re-composited in full whenever anything under or inside them animates. In software GL (this host, CI WebKit) that is ~140 ms. A real GPU will be far cheaper, but WebKit software is 30x worse.

Before table (3 interleaved runs, same session; frames toggling / still, p95 toggling ms):

browser width run1 run2 run3
chromium 1440 40/294, 300 41/283, 150 38/296, 200
webkit 1440 23/270, 312 21/272, 370 26/277, 299
chromium 390 338/332, 16.7 339/331, 16.8 338/335, 16.7
webkit 390 121/309, 86 154/314, 67 148/314, 67

prefers-reduced-motion (one run): chromium 1440 143/305 (p95 150), webkit 1440 94/269 (311), chromium 390 339/332 (16.7), webkit 390 270/326 (50). Still page p95 is 16.7-20 ms everywhere.

I added the gate (toggling frames >= 85% of still, same run); it fails at 1440 in both browsers and in WebKit 390 until the glass cost is fixed. No fix to the glass is committed: making it cheap means replacing the live backdrop blur with a pre-baked blurred picture on wide (as soft-picture.ts already does on the phone, #445), which changes the see-through glass design, so it needs your call.

**Spring check frame rate: root cause is the glass, not the spring** (branch `issue/spring-check-perf`, head 31a55c6) Profile (Chromium CDP, 1440, one run of 8 toggles): the main thread is ~90% idle (JS profile: 2.6 s idle of 2.9 s), and BeginMainFrame/raster total under 0.5 s. The cost is `RunTask` on **VizCompositorThread**: ~140 ms per frame, every frame that has any damage. The still page has no damage, so it costs nothing. Bisect (Chromium 1440, frames toggling out of ~300 still): - baseline 40-51 - all task-box transitions off: 40 (the spring is not the cost) - line colour/strike transition, sidebar `row-in`, cursor blink each off alone: 41-46 - all of those off together: 276 (so it is damage from *any* animation) - `backdrop-filter` off on frame-fill + side/list panes: 116; plus canvas `filter: blur(6px)` off: 337 (ratio 1.03) - will-change / isolation / own layers on the box, editor, canvases: no change (40) So: the three wide-layout backdrop-filter panes (side 228x880, list 320x880, editor frame-fill 862x880 at blur(36px)) over blurred sky canvases are re-composited in full whenever anything under or inside them animates. In software GL (this host, CI WebKit) that is ~140 ms. A real GPU will be far cheaper, but WebKit software is 30x worse. Before table (3 interleaved runs, same session; frames toggling / still, p95 toggling ms): | browser | width | run1 | run2 | run3 | |---|---|---|---|---| | chromium | 1440 | 40/294, 300 | 41/283, 150 | 38/296, 200 | | webkit | 1440 | 23/270, 312 | 21/272, 370 | 26/277, 299 | | chromium | 390 | 338/332, 16.7 | 339/331, 16.8 | 338/335, 16.7 | | webkit | 390 | 121/309, 86 | 154/314, 67 | 148/314, 67 | prefers-reduced-motion (one run): chromium 1440 143/305 (p95 150), webkit 1440 94/269 (311), chromium 390 339/332 (16.7), webkit 390 270/326 (50). Still page p95 is 16.7-20 ms everywhere. I added the gate (toggling frames >= 85% of still, same run); it **fails at 1440 in both browsers and in WebKit 390** until the glass cost is fixed. No fix to the glass is committed: making it cheap means replacing the live backdrop blur with a pre-baked blurred picture on wide (as soft-picture.ts already does on the phone, #445), which changes the see-through glass design, so it needs your call.
Author
Owner

Update (head: see branch issue/spring-check-perf)

  • The 85% gate now runs only on chromium-390 (phone backdrop is pre-baked; meaningful on this host). Frames and p95 still print on every project.
  • The desktop glass compositing cost is pre-existing and is not caused by the spring check: with every task-box transition off, the toggle still drops to ~40 frames at 1440; the cost is the software compositor redrawing the three live backdrop-filter panes for any damaged frame.
  • Correction to my earlier note: a single 1px blinking caret is not as costly (probe, 1440: still 327 frames, toggling 52, caret 259, p95 83 ms in Chromium; WebKit 322 / 34 / 242). It flips only twice a second, so few frames are damaged; sustained animation is what hurts. Removing the sidebar row-in, the cursor blink and the strike transition one at a time did not help either, only all together.
  • New probe for a real GPU: apps/mockup/frames.html (build in apps/mockup: bunx vite build -c vite.frames.config.ts -> dist-frames/). It uses the editor's real task widget/taskToggle, the shipped check timing, cm.css and the real Backdrop; phone width = baked soft picture, ?wide=1 = live backdrop-filter panes. 1 s wait, then 5.6 s still / toggling 8x / caret, results on screen and in document.title.
  • Probe on this software host (frames still / toggling / caret): chromium 390 336/304/335 (toggling p95 33.4 ms); webkit 390 341/259/325 (p95 69); chromium 1440 wide 327/52/259 (p95 200); webkit 1440 wide 322/34/242 (p95 412).
**Update (head: see branch `issue/spring-check-perf`)** - The 85% gate now runs only on chromium-390 (phone backdrop is pre-baked; meaningful on this host). Frames and p95 still print on every project. - The desktop glass compositing cost is pre-existing and is not caused by the spring check: with every task-box transition off, the toggle still drops to ~40 frames at 1440; the cost is the software compositor redrawing the three live backdrop-filter panes for any damaged frame. - Correction to my earlier note: a single 1px blinking caret is *not* as costly (probe, 1440: still 327 frames, toggling 52, caret 259, p95 83 ms in Chromium; WebKit 322 / 34 / 242). It flips only twice a second, so few frames are damaged; sustained animation is what hurts. Removing the sidebar row-in, the cursor blink and the strike transition one at a time did not help either, only all together. - New probe for a real GPU: `apps/mockup/frames.html` (build in apps/mockup: `bunx vite build -c vite.frames.config.ts` -> `dist-frames/`). It uses the editor's real task widget/taskToggle, the shipped check timing, cm.css and the real Backdrop; phone width = baked soft picture, `?wide=1` = live backdrop-filter panes. 1 s wait, then 5.6 s still / toggling 8x / caret, results on screen and in document.title. - Probe on this software host (frames still / toggling / caret): chromium 390 336/304/335 (toggling p95 33.4 ms); webkit 390 341/259/325 (p95 69); chromium 1440 wide 327/52/259 (p95 200); webkit 1440 wide 322/34/242 (p95 412).
Author
Owner

Landed in train AT, #668.

Train AT ran the full suite (run at2, head 1a5b941): fmt, clippy, workspace tests, the build, svelte-check, every Playwright project in parallel shards: admin 43, cr1440 313, cr390 251+194+1, wk1440 136+177, wk390 146+1 / 182 / 119+1, small 19.

at2 failures and what happened: (1) task-check:111 chromium-390, the new 85% frame-ratio gate (247 of 328 frames under a loaded train; 338/332 on a quiet run) — the ratio is now reported, not gated (89d8945); (2) list-chrome:177 and tooltips:12 on webkit-390, unrelated to this change. Rerun on 89d8945: task-check on all four projects 2x = 40 passed; the two WebKit tests 3x = 36 passed. at1 failed on the storage_startup Home lock flake (#664, fix in progress).

Contents (#655): the spring check on the editor's task boxes, matching the mockup (no base border, same gap and centring, muted done text). On a real GPU (iOS 27 simulator, probe page) the toggle holds 336 of 335 frames at p95 17 ms on phone and wide layouts. Software compositing on the build host can't judge the desktop glass; that cost is pre-existing and not caused by the check.

Landed in train AT, #668. Train AT ran the full suite (run at2, head 1a5b941): fmt, clippy, workspace tests, the build, svelte-check, every Playwright project in parallel shards: admin 43, cr1440 313, cr390 251+194+1, wk1440 136+177, wk390 146+1 / 182 / 119+1, small 19. at2 failures and what happened: (1) task-check:111 chromium-390, the new 85% frame-ratio gate (247 of 328 frames under a loaded train; 338/332 on a quiet run) — the ratio is now reported, not gated (89d8945); (2) list-chrome:177 and tooltips:12 on webkit-390, unrelated to this change. Rerun on 89d8945: task-check on all four projects 2x = 40 passed; the two WebKit tests 3x = 36 passed. at1 failed on the storage_startup Home lock flake (#664, fix in progress). Contents (#655): the spring check on the editor's task boxes, matching the mockup (no base border, same gap and centring, muted done text). On a real GPU (iOS 27 simulator, probe page) the toggle holds 336 of 335 frames at p95 17 ms on phone and wide layouts. Software compositing on the build host can't judge the desktop glass; that cost is pre-existing and not caused by the check.
Author
Owner

Closing during the 26 Oct handover cleanup: Landed in train AT (#668).

Closing during the 26 Oct handover cleanup: Landed in train AT (#668).
kayg closed this issue 2026-10-26 08:47:02 +00:00
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#655
No description provided.