port: Notes Float slice 4 — Style sheet #1100

Closed
kayg wants to merge 8 commits from port/notes-float-s4-style into port/notes-float
Owner

Slice 4 of the Notes Float port (#1088, plan docs/plans/notes-float-port.md). Based on port/notes-float-1a (#1093, b9a319721); rebase when 1a moves. Notes only.

What

  • Page tab: theme row ("Same as app" + 12 themes, preview tiles), Frost tickbox, Grain (disabled while Frost is off), Wide page, Separator (None/Line/Dots/Doodle, drawn in the gap), page colour. Replaces the four looks (Presets, lib/looks.ts removed).
  • Background tab: one builder, None/Solid/Gradient/Image, 12 gradient presets + Start/End/Direction, Frost for images, Immersive|Faded on the sidebars' tint (GlobalLayer, two tints, opacity crossfade). Dim rows and the "busy photo, dim it?" nudge are gone.
  • Themes: pure lib/themes.ts (contrast guard: themes.test.ts, 26 tests); one generated stylesheet inserted once and lazily; a note's theme is a class on its card (pal-<id>), written as calternal-theme. Switch is instant, no crossfade; lib/settle.ts finishes the colour transitions the restyle starts (#1054).
  • Lines written: calternal-theme, -grain: on, -separator, -background-effect: faded, -backdrop: art:solid:#…|art:grad:#…:#…:tb.

Decisions / open

  • Frost is the tickbox with fixed values (80% / 20 px); deriving the lowest readable density from the backdrop belongs to slice 7.
  • Product default width is Full (1a kept it); --- only splits into cards at Narrow/Wide. Wide page: on = Full, off = Narrow. Captain: should Notes default to Narrow (mockup)?
  • Settings > Appearance keeps prod (other app): no app-level theme picker, so "Same as app" = Calternal today.
  • Separator marks are CSS on .cm-break for Narrow/Wide; phone keeps the full page.
  • Build guard lazy-ui-plugin count 33 -> 34 (themes chunk).

Gates and evidence follow in comments.

Slice 4 of the Notes Float port (#1088, plan `docs/plans/notes-float-port.md`). Based on `port/notes-float-1a` (#1093, b9a319721); rebase when 1a moves. Notes only. **What** - Page tab: theme row ("Same as app" + 12 themes, preview tiles), Frost tickbox, Grain (disabled while Frost is off), Wide page, Separator (None/Line/Dots/Doodle, drawn in the gap), page colour. Replaces the four looks (Presets, `lib/looks.ts` removed). - Background tab: one builder, None/Solid/Gradient/Image, 12 gradient presets + Start/End/Direction, Frost for images, Immersive|Faded on the sidebars' tint (`GlobalLayer`, two tints, opacity crossfade). Dim rows and the "busy photo, dim it?" nudge are gone. - Themes: pure `lib/themes.ts` (contrast guard: `themes.test.ts`, 26 tests); one generated stylesheet inserted once and lazily; a note's theme is a class on its card (`pal-<id>`), written as `calternal-theme`. Switch is instant, no crossfade; `lib/settle.ts` finishes the colour transitions the restyle starts (#1054). - Lines written: `calternal-theme`, `-grain: on`, `-separator`, `-background-effect: faded`, `-backdrop: art:solid:#…|art:grad:#…:#…:tb`. **Decisions / open** - Frost is the tickbox with fixed values (80% / 20 px); deriving the lowest readable density from the backdrop belongs to slice 7. - Product default width is Full (1a kept it); `---` only splits into cards at Narrow/Wide. Wide page: on = Full, off = Narrow. Captain: should Notes default to Narrow (mockup)? - Settings > Appearance keeps prod (other app): no app-level theme picker, so "Same as app" = Calternal today. - Separator marks are CSS on `.cm-break` for Narrow/Wide; phone keeps the full page. - Build guard `lazy-ui-plugin` count 33 -> 34 (themes chunk). Gates and evidence follow in comments.
kayg added 29 commits 2026-11-12 15:33:58 +00:00
Replaces Shell's grid and glass panes with components/window/WindowLayout; Backdrop gets a follower
mode for the second picture; tokens for the window; sidebar title row is the one title line.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A spring on the page card's own width re-laid the editor out every frame: zen cost 76 ms in
real Safari against 37 on dev. --f-l is a registered property so the window edge, the list card
and the clip spring as one value.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
--f-l as a registered, inherited property re-styled the whole document every spring frame.
The window edge, its shadow and the handle move by left; the page's clip by --cl; one spring.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
web: the phone's places screen keeps the padding its own rules set (my .sidebar.phone padding outranked them)
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
b9a319721a
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
web: the Aa-at-rest spec reads the Style tab strip only
Some checks failed
CI / server (pull_request) Has been cancelled
CI / rust (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
CI / web (pull_request) Has been cancelled
cfbd9d2f83
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Author
Owner

Slice 4 gates so far (head ff666ee11 + later spec fixes; see head in the final report)

Commands (dev-01, under ~/bin/slot, CI=1 --retries=0 --workers=1, own --output per project):
bunx playwright test e2e/style-sheet.spec.ts e2e/style-background.spec.ts e2e/opacity.spec.ts e2e/frontmatter-unreachable.spec.ts e2e/style-card-box.spec.ts e2e/note-bars.spec.ts e2e/window-layout.spec.ts --project=chromium-1440|chromium-390

gate result
svelte-check 0 errors, 19 warnings (13 files, none new from this slice's files)
web unit (vitest) 28 files, 287 tests passed (incl. themes.test.ts: 26 contrast/data tests)
chromium-1440 45 passed / 0 failed (run before the last two spec-only commits: 44 + window-layout)
chromium-390 43 passed, 1 failed (Faded check read .gl, which a phone has not): fixed in ff666ee11, rerun pending
webkit-1440/390 (dev-02) queued behind other jobs on dev-02's 3 slots for ~1 h: not run yet

Findings: the build's lazy-import guard counts 33 -> 34 (the themes chunk is imported from the idle screens); window-layout.spec.ts:89 failed once on chromium-1440 in a first run and passed in the rerun (not reproduced).
dev-02 has 46 GB free (floor is 50): flagged, my footprint is one worktree.

## Slice 4 gates so far (head ff666ee11 + later spec fixes; see head in the final report) Commands (dev-01, under `~/bin/slot`, `CI=1 --retries=0 --workers=1`, own `--output` per project): `bunx playwright test e2e/style-sheet.spec.ts e2e/style-background.spec.ts e2e/opacity.spec.ts e2e/frontmatter-unreachable.spec.ts e2e/style-card-box.spec.ts e2e/note-bars.spec.ts e2e/window-layout.spec.ts --project=chromium-1440|chromium-390` | gate | result | |---|---| | svelte-check | 0 errors, 19 warnings (13 files, none new from this slice's files) | | web unit (vitest) | 28 files, 287 tests passed (incl. `themes.test.ts`: 26 contrast/data tests) | | chromium-1440 | 45 passed / 0 failed (run before the last two spec-only commits: 44 + window-layout) | | chromium-390 | 43 passed, 1 failed (Faded check read `.gl`, which a phone has not): fixed in ff666ee11, rerun pending | | webkit-1440/390 (dev-02) | queued behind other jobs on dev-02's 3 slots for ~1 h: not run yet | Findings: the build's lazy-import guard counts 33 -> 34 (the themes chunk is imported from the idle screens); `window-layout.spec.ts:89` failed once on chromium-1440 in a first run and passed in the rerun (not reproduced). dev-02 has 46 GB free (floor is 50): flagged, my footprint is one worktree.
Author
Owner

Product screenshots, Style sheet (Chromium, Nord theme + Dots separator, narrow, two cards). Mockup pairs: not captured yet.

product-background-dark-1440.png

product-background-dark-390.png

product-background-light-1440.png

product-background-light-390.png

product-gradient-dark-1440.png

product-gradient-dark-390.png

product-gradient-light-1440.png

product-gradient-light-390.png

product-page-dark-1440.png

product-page-dark-390.png

product-page-light-1440.png

product-page-light-390.png

## Product screenshots, Style sheet (Chromium, Nord theme + Dots separator, narrow, two cards). Mockup pairs: not captured yet. **product-background-dark-1440.png** ![](https://git.kayg.org/attachments/83552e7f-db57-4628-a1f8-b4e81d4cd96f) **product-background-dark-390.png** ![](https://git.kayg.org/attachments/26a9d9c4-fe53-493d-b779-06547c30ac2f) **product-background-light-1440.png** ![](https://git.kayg.org/attachments/b8cb3d10-4544-4f2c-bae5-6cc1aac60b8e) **product-background-light-390.png** ![](https://git.kayg.org/attachments/ed720f62-2f43-4c60-9a7b-f58d0e0cb3ec) **product-gradient-dark-1440.png** ![](https://git.kayg.org/attachments/8d7fc98c-b663-43f6-879b-5231b1ef09c6) **product-gradient-dark-390.png** ![](https://git.kayg.org/attachments/5e1af83b-34f8-4ae6-bf03-9eb93a2b97ea) **product-gradient-light-1440.png** ![](https://git.kayg.org/attachments/8c10aaf5-739e-4105-9edb-05bd66099fb8) **product-gradient-light-390.png** ![](https://git.kayg.org/attachments/2e4b18e8-3db3-4569-9fdc-6c0378e0691a) **product-page-dark-1440.png** ![](https://git.kayg.org/attachments/3990e506-f5ff-4a54-80ce-abad06070ff8) **product-page-dark-390.png** ![](https://git.kayg.org/attachments/cb01d154-3d56-42b4-bd95-d66ac51add1b) **product-page-light-1440.png** ![](https://git.kayg.org/attachments/58ccc5f2-6edd-4086-a9ee-82c1c7f06d5e) **product-page-light-390.png** ![](https://git.kayg.org/attachments/271848ed-84b3-42ff-aca3-ed925b29e9a3)
Author
Owner

Slice 4 gates: final table (head 6e625cbab)

Commands: CI=1 bunx playwright test e2e/style-sheet.spec.ts e2e/style-background.spec.ts e2e/opacity.spec.ts e2e/frontmatter-unreachable.spec.ts e2e/style-card-box.spec.ts e2e/note-bars.spec.ts e2e/window-layout.spec.ts --project=<p> --workers=1 --retries=0 --output=/tmp/s4pw-out-<p> under ~/bin/slot; backend binary built from dev (a copy, ~/s4-bin/calternal).

gate result
svelte-check 0 errors
unit (vitest, web) 287 passed (28 files)
chromium-1440 (dev-01) 43 passed, 2 failed: window-layout.spec.ts:70 and :89 (slice 1a's spec; the same two fail intermittently on earlier runs and pass on others; it flips the shared test person's saved sidebar state, so one failure can chain). Not touched by this slice.
chromium-390 (dev-01) 44 passed
webkit-1440 (dev-02) 44 passed
webkit-390 (dev-02) 41 passed, 1 failed on an older head (Faded check read the window's .gl, a phone has none); fixed in ff666ee11, passes on chromium-390; webkit-390 not rerun at the final head

NOT done yet (say so, not green): real-Safari frames for the theme switch and opening the sheet (Mac VM); iPhone simulator shots; product-vs-mockup pairs (product shots are in the comment above, mockup shots not captured); first-paint bytes / budgets.json (idle-screens grows with the themes and builder; themes are a separate lazy chunk, but the number is not measured); contrast spec of the theme CSS inside the page (the pure palette contrast is covered by themes.test.ts).

## Slice 4 gates: final table (head 6e625cbab) Commands: `CI=1 bunx playwright test e2e/style-sheet.spec.ts e2e/style-background.spec.ts e2e/opacity.spec.ts e2e/frontmatter-unreachable.spec.ts e2e/style-card-box.spec.ts e2e/note-bars.spec.ts e2e/window-layout.spec.ts --project=<p> --workers=1 --retries=0 --output=/tmp/s4pw-out-<p>` under `~/bin/slot`; backend binary built from dev (a copy, `~/s4-bin/calternal`). | gate | result | |---|---| | svelte-check | 0 errors | | unit (vitest, web) | 287 passed (28 files) | | chromium-1440 (dev-01) | 43 passed, 2 failed: `window-layout.spec.ts:70` and `:89` (slice 1a's spec; the same two fail intermittently on earlier runs and pass on others; it flips the shared test person's saved sidebar state, so one failure can chain). Not touched by this slice. | | chromium-390 (dev-01) | 44 passed | | webkit-1440 (dev-02) | 44 passed | | webkit-390 (dev-02) | 41 passed, 1 failed on an older head (Faded check read the window's `.gl`, a phone has none); fixed in ff666ee11, passes on chromium-390; webkit-390 not rerun at the final head | **NOT done yet (say so, not green):** real-Safari frames for the theme switch and opening the sheet (Mac VM); iPhone simulator shots; product-vs-mockup pairs (product shots are in the comment above, mockup shots not captured); first-paint bytes / budgets.json (`idle-screens` grows with the themes and builder; themes are a separate lazy chunk, but the number is not measured); contrast spec of the theme CSS inside the page (the pure palette contrast is covered by `themes.test.ts`).
Author
Owner

Slice 4, final gates (head 9dcdcabb4; code identical to 2bccd20b2, then budgets only). Rebased on the merged 1a (port/notes-float eb9d0552b).

Decision applied (orchestrator 11-12): Notes default to Narrow (a phone's page stays full); "Wide page" = Full.

gate result
svelte-check 0 errors, 19 warnings (13 files, none new)
unit editor 574 passed; web unit passed (themes: 26)
e2e, 24 width/Style/editor-sensitive specs + style-background + note-bars (CI=1 --retries=0 --workers=1, own --output per project, ~/bin/slot) chromium-1440 (dev-01): 178 passed / 0 failed. chromium-390 (dev-01): 354 passed, 1 failed (backdrops.spec:78 "pick a photo", a flake: 1/14 on the integration base and 2/14 on this branch with --repeat-each=14). webkit-1440 (dev-02): 173 passed / 0 failed. webkit-390 (dev-02): 349 passed / 0 failed. (Skips are the specs' own project filters.)
width default side effects found and fixed: the opening glide made editor.spec "no layout shift while loading" fail at 1440 (now held off while a floating page opens), and a phone's pre-load page started Narrow and flipped to full (36 px shift at 390): its default is now full. Both pass.
first-paint / total bundle vs the merged base (perf/web.sh --bundle-only --gate, brotli) first JS 229984 -> 230780 B (+796 B), first CSS 19663 -> 19946 B (+283 B), idle-screens 58198 -> 61507 B (+3.2 KB; themes and the builder are in the idle chunk), total JS 510277 -> 513851 B. budgets.json set to the measured sizes (index 225.371, idle-screens 60.065, press 7.875 hash-name artefact, total 550.007). Note: the merged base is itself over its index budget (224.594 > 223.9).
iPhone Simulator (real iOS Safari) shots on #1088 (comment 94356)
product vs mockup pairs, 1440 and 390, light and dark on #1088 (comment 93989)
real-Safari frames (theme switch, sheet opening) NOT TAKEN, see below

Real Safari frames, blocked (infra): on macos-01, from 11-12 about 10:00 PST, every safaridriver session (about:blank, visible, focused, window in front, any size) gets 0.13 to 0.5 rAF/s against 58 to 60 yesterday (sb-out/*-raf.json); the VM is idle and the display is online. The maintainer saw 60.3 rAF/s once at 10:35 PST; mine measured again at ~11:55 PST and ~13:10 PST was still 0.27 to 0.46 (~/s4-frames/diag.sh). The nf lane's own diag at 10:15 PST also found pages not loading. The measuring script (~/s4-frames/frames_s4.py, open-sheet ABAB against the base build, theme switch with an idle baseline) and the two servers (base on 18765, this branch on 18766 on dev-01) are ready; it only needs a Mac that renders.

## Slice 4, final gates (head 9dcdcabb4; code identical to 2bccd20b2, then budgets only). Rebased on the merged 1a (`port/notes-float` eb9d0552b). Decision applied (orchestrator 11-12): Notes default to **Narrow** (a phone's page stays full); "Wide page" = Full. | gate | result | |---|---| | svelte-check | 0 errors, 19 warnings (13 files, none new) | | unit | editor 574 passed; web unit passed (themes: 26) | | e2e, 24 width/Style/editor-sensitive specs + style-background + note-bars (`CI=1 --retries=0 --workers=1`, own `--output` per project, `~/bin/slot`) | chromium-1440 (dev-01): 178 passed / 0 failed. chromium-390 (dev-01): 354 passed, 1 failed (`backdrops.spec:78` "pick a photo", a flake: 1/14 on the integration base and 2/14 on this branch with `--repeat-each=14`). webkit-1440 (dev-02): 173 passed / 0 failed. webkit-390 (dev-02): 349 passed / 0 failed. (Skips are the specs' own project filters.) | | width default side effects | found and fixed: the opening glide made `editor.spec` "no layout shift while loading" fail at 1440 (now held off while a floating page opens), and a phone's pre-load page started Narrow and flipped to full (36 px shift at 390): its default is now full. Both pass. | | first-paint / total bundle vs the merged base (`perf/web.sh --bundle-only --gate`, brotli) | first JS 229984 -> 230780 B (**+796 B**), first CSS 19663 -> 19946 B (+283 B), idle-screens 58198 -> 61507 B (+3.2 KB; themes and the builder are in the idle chunk), total JS 510277 -> 513851 B. `budgets.json` set to the measured sizes (index 225.371, idle-screens 60.065, press 7.875 hash-name artefact, total 550.007). Note: the merged base is itself over its index budget (224.594 > 223.9). | | iPhone Simulator (real iOS Safari) | shots on #1088 (comment 94356) | | product vs mockup pairs, 1440 and 390, light and dark | on #1088 (comment 93989) | | real-Safari frames (theme switch, sheet opening) | **NOT TAKEN**, see below | **Real Safari frames, blocked (infra):** on macos-01, from 11-12 about 10:00 PST, every safaridriver session (about:blank, visible, focused, window in front, any size) gets 0.13 to 0.5 rAF/s against 58 to 60 yesterday (`sb-out/*-raf.json`); the VM is idle and the display is online. The maintainer saw 60.3 rAF/s once at 10:35 PST; mine measured again at ~11:55 PST and ~13:10 PST was still 0.27 to 0.46 (`~/s4-frames/diag.sh`). The `nf` lane's own diag at 10:15 PST also found pages not loading. The measuring script (`~/s4-frames/frames_s4.py`, open-sheet ABAB against the base build, theme switch with an idle baseline) and the two servers (base on 18765, this branch on 18766 on dev-01) are ready; it only needs a Mac that renders.
Author
Owner

Slice 4, real-Safari frames: still blocked (checked 11-13 ~00:10 IST, head 9dcdcabb4)

The orphaned Safari/safaridriver was gone (no lock holder, no safaridriver; I quit the one leftover Safari under /tmp/mac-bench.lock). Memory at the start of the run: vm_stat about 0.4 GB free plus about 2.5 GB inactive, swap 0 (below the brief's 2 GB free line, so treat the rAF numbers as indicative; the 0.5 rAF/s is far below anything memory explains).

First gate, about:blank rAF rate in a fresh safaridriver session on macos-01 (Safari activated after the session opened, window 1440x900):

sample rAF/s
1 0.53
2 0.40
3 0.46

Expected about 60. It is still 0.4 to 0.5, the same as before the orphan was killed, so Safari is not rendering frames for the automation window. Per the brief I stopped here and did not loop. The theme-switch and Style-sheet-open frame comparisons are therefore NOT taken; the measuring script (open-sheet ABAB against eb9d0552b, theme switch with idle baseline) and the servers recipe are ready and only need a Mac session that renders.

Cleanup done: lock removed, own safaridriver and tunnel killed, Safari quit.

## Slice 4, real-Safari frames: still blocked (checked 11-13 ~00:10 IST, head 9dcdcabb4) The orphaned Safari/safaridriver was gone (no lock holder, no safaridriver; I quit the one leftover Safari under `/tmp/mac-bench.lock`). Memory at the start of the run: `vm_stat` about 0.4 GB free plus about 2.5 GB inactive, swap 0 (below the brief's 2 GB free line, so treat the rAF numbers as indicative; the 0.5 rAF/s is far below anything memory explains). First gate, `about:blank` rAF rate in a fresh safaridriver session on macos-01 (Safari activated after the session opened, window 1440x900): | sample | rAF/s | |---|---| | 1 | 0.53 | | 2 | 0.40 | | 3 | 0.46 | Expected about 60. It is still 0.4 to 0.5, the same as before the orphan was killed, so Safari is not rendering frames for the automation window. Per the brief I stopped here and did not loop. The theme-switch and Style-sheet-open frame comparisons are therefore NOT taken; the measuring script (open-sheet ABAB against `eb9d0552b`, theme switch with idle baseline) and the servers recipe are ready and only need a Mac session that renders. Cleanup done: lock removed, own safaridriver and tunnel killed, Safari quit.
Author
Owner

Slice 4 gate, 11-14: merged onto the new integration head. NOT READY: real-Safari "open the Style sheet" has hitches that dev does not have.

Head a2f824dee (= port/notes-float 4f0b58327 merged --no-ff at 4eca8a496, then a budgets commit). Base for "base" below: 4f0b58327; "dev": 796d80cba.

Merge

Three conflicts, resolved by hand:

  • GlobalLayer.svelte: the integration head replaced the one screen-sized layer with six plain pieces painting a viewport-fixed picture. Slice 4's Immersive/Faded tint is now ONE viewport-fixed gradient shared by the six pieces; its foot stop is a premultiplied color-mix of the wash and the neutral by a registered --fade (0/1), with a 240 ms transition on .gl. This replaces the two crossfading <i> layers (they would have covered the window the pieces avoid). style-background.spec reads --fade on .gl: still true.
  • cm.css: kept both the Separator marks and the caret-gap/lone-line rules.
  • perf/budgets.json: kept both approval notes; lines re-measured on the merged head (below).

Gates (own server binary built from the integration base 4f0b58327's crates; the crates tree is identical to this head's)

Commands: CI=1 bunx playwright test <20 specs> --project=<p> --workers=1 --retries=0, under ~/bin/slot, 20 spec files: style-sheet, style-background, style-card-box, style-presets, opacity, frontmatter-unreachable, note-bars, width, window-layout, adaptive-glass, glass, chrome-contrast, contrast, backdrops, backdrop-page, editor, tint, split-cards, lazy-styled, links-look.

gate result
svelte-check 0 errors, 19 warnings
web unit (vitest) 29 files, 293 tests passed
chromium-1440 (dev-01) 114 passed, 3 failed, 29 skipped: window-layout.spec.ts:73, :93, :165 (the integration head's known flaky window-layout specs). Re-run window-layout.spec.ts --repeat-each=3 on this head and on 4f0b58327: 24/24 passed on both. Not a regression.
chromium-390 (dev-01) 96 passed, 1 failed, 49 skipped: tint.spec.ts:313 (tagged, light, phone swipe). --repeat-each=8 of that test: 8/8 passed on this head and on 4f0b58327. Flake.
webkit-1440 (dev-02) 112 passed, 0 failed, 34 skipped
webkit-390 (dev-02) 92 passed, 0 failed, 54 skipped
bundle gate (perf/web.sh --bundle-only --gate, brotli) the merged base 4f0b58327 is itself over its own index line (228.164 vs 224.662). This head, same toolchain: first JS 228.164 → 229.013 (+0.849 KB), first CSS 19.567 → 19.843 (+0.276), idle-screens 56.844 → 60.055 (+3.211), total JS 539.904 → 543.673 (+3.769), WhenField 8.708 → 8.765. Lines in budgets.json set to these (index 229.02, WhenField 8.77, idle-screens 60.065 and total 550.007 unchanged); the gate now exits 0 for this slice's chunks. Growth is what #1100 said (+0.8 KB first paint, +3.2 KB idle).

Real Safari, macos-01 (nfa-frames harness, adapted: 3 arms dev | base | s4, ABAB rotating, 8 cycles, same session, 1440×900, DPR 1)

Blank page first: 143 frames in 2 s (≈71 rAF/s counting the 2 s window; mean 16.7 ms, worst 26), so the machine delivered ≥60 rAF/s. (An earlier attempt had a dev dist that did not build — missing gitignored public/fonts in my dev worktree — so the dev arm never loaded; I threw that run away and re-ran.) Free memory was about 0.25–0.65 GB (below the 2 GB line), swap 0; treat as indicative, but the idle baseline is clean (worst 22–24 ms in every arm, 0 hitches ≥50).

Worst frame per 1.2 s gesture window (median of 8 runs | max | runs with a ≥50 ms frame):

gesture dev base (4f0b58327) s4 (this head)
idle (baseline) 23.5 | 30 | 0 23.0 | 25 | 0 22.5 | 25 | 0
open the Style sheet 30.5 | 51 | 1 24.5 | 41 | 0 58.0 | 1298 | 6 of 8
close the sheet (Esc) 25.5 | 30 | 0 27.5 | 46 | 0 24.0 | 26 | 0
app scheme light→dark 55.5 | 62 | 6 58.5 | 80 | 5 63.0 | 76 | 7
app scheme dark→light 55.5 | 69 | 6 54.5 | 96 | 6 63.0 | 82 | 7
theme tile Nord (s4 only) – – 38.0 | 56 | 1
theme tile Same as app (s4 only) – – 48.5 | 58 | 4

Per-run worst frame on "open the sheet", ms: dev 43 35 21 26 23 35 51 21; base 30 22 25 23 41 24 28 23; s4 70 1298 51 63 53 48 45 75.

Must-fix: opening the Style sheet in this build hitches ≥50 ms in 6 of 8 runs; dev has 1 of 8 (51 ms) and the integration base 0. The 1298 ms is one outlier (outliers occur in every arm over a night's runs, not attributable), but the median 58 vs 24.5–30.5 is the effect. Likely cause (not profiled): the Page tab now builds the 13 theme tiles (each runs the contrast maths in swatch(), mini card + generated gradient per tile) in the sheet's open task; dev's Page tab has far less. Ideas: build the theme row in a later step of PageTab's own staging (after the sheet has opened), precompute swatch() per scheme once at idle, or render the tiles as plain CSS variables instead of per-tile JS.

App-scheme switch: all arms hitch (dev 6/8, base 5–6/8, s4 7/8; median 55–63 ms): the switch repaints everything and exists on dev, so it is not attributable to slice 4, but s4 is +8 ms median and +1 run over base; the new gradient/--fade transition on .gl is the obvious suspect and is worth a look when the sheet-open fix lands. The theme tile taps are 38 / 48.5 ms median (1 and 4 runs ≥50): near the Mac's noise floor; no dev equivalent.

Safari text sharpness (1440×900, DPR 1; the Mac VM's display has no 2x mode, so 2x is not checked here)

Same note, editor not focused (off) vs focused (on: the integration head promotes .wside/.wc-list to layers while typing; .typing class present on base and s4, absent on dev): list/sidebar text is as crisp in on as in off for both base and s4, and matches dev's unpromoted text by eye (shots below). I had no image tooling on hd01 for a pixel diff; judged by eye on the 1x shots. 2x stays an open item for kayg's retina.

iPhone Simulator (std, own sim s4t-sim, iOS 27.0 / iPhone 18 Pro, deleted on exit)

Reproduced the known bug: ?sheet=style with no tab opens with Page highlighted over the Text tab's content (Font, Text size, Tree lines). &tab=page shows the correct Page content (Theme row, Cover). It is not slice 4's code (StyleSheet.svelte is identical to dev's, and the pager's one-shot scrollLeft is the suspect), so I did not change it here: filed as #1111 with steps and the suspect.

Pooled ×3 typing/list CPU gate: not run, and why

The merge resolution touched a hot path (the six-piece GlobalLayer paint on the list/sidebar side, plus slice 4's Editor.svelte, cm.css, editing.svelte.ts which the typing path runs through), so a pooled ABAB ×3 on perf-01 IS owed. I did not spend it on this head because the must-fix above changes PageTab/ThemeRow (not the typing path, but the final GlobalLayer may change too if the scheme-switch hitch is chased). Run it once on the head that fixes sheet-open. Perf-01's queue also had two live tickets.

State

Pushed: 4eca8a496 (merge), a2f824dee (budgets). Not merged, per instructions. Nothing left running on dev-01, dev-02, the Mac or std from this lane except the units named in the final report (stopped there).

Shots

Mac Safari: Style sheet, this head, light

Mac Safari: Style sheet, this head, dark

Mac Safari: Style sheet, base 4f0b58327, light

Crisp, this head, editor focused (promoted layers)

Crisp, this head, editor not focused

Crisp, dev (no promotion)

iPhone Sim: ?sheet=style (no tab): Page highlighted, Text content (bug, #1111)

iPhone Sim: ?sheet=style (no tab), dark

iPhone Sim: ?sheet=style&tab=page (correct)

## Slice 4 gate, 11-14: merged onto the new integration head. **NOT READY: real-Safari "open the Style sheet" has hitches that dev does not have.** Head **a2f824dee** (= `port/notes-float` 4f0b58327 merged `--no-ff` at 4eca8a496, then a budgets commit). Base for "base" below: 4f0b58327; "dev": 796d80cba. ### Merge Three conflicts, resolved by hand: - `GlobalLayer.svelte`: the integration head replaced the one screen-sized layer with six plain pieces painting a viewport-fixed picture. Slice 4's Immersive/Faded tint is now ONE viewport-fixed gradient shared by the six pieces; its foot stop is a premultiplied `color-mix` of the wash and the neutral by a registered `--fade` (0/1), with a 240 ms transition on `.gl`. This replaces the two crossfading `<i>` layers (they would have covered the window the pieces avoid). `style-background.spec` reads `--fade` on `.gl`: still true. - `cm.css`: kept both the Separator marks and the caret-gap/lone-line rules. - `perf/budgets.json`: kept both approval notes; lines re-measured on the merged head (below). ### Gates (own server binary built from the integration base 4f0b58327's crates; the crates tree is identical to this head's) Commands: `CI=1 bunx playwright test <20 specs> --project=<p> --workers=1 --retries=0`, under `~/bin/slot`, 20 spec files: style-sheet, style-background, style-card-box, style-presets, opacity, frontmatter-unreachable, note-bars, width, window-layout, adaptive-glass, glass, chrome-contrast, contrast, backdrops, backdrop-page, editor, tint, split-cards, lazy-styled, links-look. | gate | result | |---|---| | svelte-check | 0 errors, 19 warnings | | web unit (vitest) | 29 files, 293 tests passed | | chromium-1440 (dev-01) | 114 passed, 3 failed, 29 skipped: `window-layout.spec.ts:73`, `:93`, `:165` (the integration head's known flaky window-layout specs). Re-run `window-layout.spec.ts --repeat-each=3` on this head and on 4f0b58327: **24/24 passed on both**. Not a regression. | | chromium-390 (dev-01) | 96 passed, 1 failed, 49 skipped: `tint.spec.ts:313` (tagged, light, phone swipe). `--repeat-each=8` of that test: **8/8 passed on this head and on 4f0b58327**. Flake. | | webkit-1440 (dev-02) | 112 passed, 0 failed, 34 skipped | | webkit-390 (dev-02) | 92 passed, 0 failed, 54 skipped | | bundle gate (`perf/web.sh --bundle-only --gate`, brotli) | the merged base 4f0b58327 is itself over its own index line (228.164 vs 224.662). This head, same toolchain: first JS 228.164 → **229.013 (+0.849 KB)**, first CSS 19.567 → 19.843 (+0.276), idle-screens 56.844 → 60.055 (+3.211), total JS 539.904 → 543.673 (+3.769), WhenField 8.708 → 8.765. Lines in `budgets.json` set to these (index 229.02, WhenField 8.77, idle-screens 60.065 and total 550.007 unchanged); the gate now exits 0 for this slice's chunks. Growth is what #1100 said (+0.8 KB first paint, +3.2 KB idle). | ### Real Safari, macos-01 (`nfa-frames` harness, adapted: 3 arms dev | base | s4, ABAB rotating, 8 cycles, same session, 1440×900, DPR 1) Blank page first: **143 frames in 2 s (≈71 rAF/s counting the 2 s window; mean 16.7 ms, worst 26)**, so the machine delivered ≥60 rAF/s. (An earlier attempt had a dev dist that did not build — missing gitignored `public/fonts` in my dev worktree — so the dev arm never loaded; I threw that run away and re-ran.) Free memory was about 0.25–0.65 GB (below the 2 GB line), swap 0; treat as indicative, but the idle baseline is clean (worst 22–24 ms in every arm, 0 hitches ≥50). Worst frame per 1.2 s gesture window (median of 8 runs | max | runs with a ≥50 ms frame): | gesture | dev | base (4f0b58327) | s4 (this head) | |---|---|---|---| | idle (baseline) | 23.5 \| 30 \| 0 | 23.0 \| 25 \| 0 | 22.5 \| 25 \| 0 | | **open the Style sheet** | 30.5 \| 51 \| 1 | 24.5 \| 41 \| 0 | **58.0 \| 1298 \| 6 of 8** | | close the sheet (Esc) | 25.5 \| 30 \| 0 | 27.5 \| 46 \| 0 | 24.0 \| 26 \| 0 | | app scheme light→dark | 55.5 \| 62 \| 6 | 58.5 \| 80 \| 5 | 63.0 \| 76 \| 7 | | app scheme dark→light | 55.5 \| 69 \| 6 | 54.5 \| 96 \| 6 | 63.0 \| 82 \| 7 | | theme tile Nord (s4 only) | – | – | 38.0 \| 56 \| 1 | | theme tile Same as app (s4 only) | – | – | 48.5 \| 58 \| 4 | Per-run worst frame on "open the sheet", ms: dev 43 35 21 26 23 35 51 21; base 30 22 25 23 41 24 28 23; **s4 70 1298 51 63 53 48 45 75**. **Must-fix:** opening the Style sheet in this build hitches ≥50 ms in 6 of 8 runs; dev has 1 of 8 (51 ms) and the integration base 0. The 1298 ms is one outlier (outliers occur in every arm over a night's runs, not attributable), but the median 58 vs 24.5–30.5 is the effect. Likely cause (not profiled): the Page tab now builds the 13 theme tiles (each runs the contrast maths in `swatch()`, mini card + generated gradient per tile) in the sheet's open task; dev's Page tab has far less. Ideas: build the theme row in a later step of `PageTab`'s own staging (after the sheet has opened), precompute `swatch()` per scheme once at idle, or render the tiles as plain CSS variables instead of per-tile JS. App-scheme switch: all arms hitch (dev 6/8, base 5–6/8, s4 7/8; median 55–63 ms): the switch repaints everything and exists on dev, so it is not attributable to slice 4, but s4 is +8 ms median and +1 run over base; the new gradient/`--fade` transition on `.gl` is the obvious suspect and is worth a look when the sheet-open fix lands. The theme tile taps are 38 / 48.5 ms median (1 and 4 runs ≥50): near the Mac's noise floor; no dev equivalent. ### Safari text sharpness (1440×900, DPR 1; the Mac VM's display has no 2x mode, so **2x is not checked here**) Same note, editor not focused (`off`) vs focused (`on`: the integration head promotes `.wside`/`.wc-list` to layers while typing; `.typing` class present on base and s4, absent on dev): list/sidebar text is as crisp in `on` as in `off` for both base and s4, and matches dev's unpromoted text by eye (shots below). I had no image tooling on hd01 for a pixel diff; judged by eye on the 1x shots. 2x stays an open item for kayg's retina. ### iPhone Simulator (std, own sim `s4t-sim`, iOS 27.0 / iPhone 18 Pro, deleted on exit) **Reproduced** the known bug: `?sheet=style` with no tab opens with Page highlighted over the Text tab's content (Font, Text size, Tree lines). `&tab=page` shows the correct Page content (Theme row, Cover). It is not slice 4's code (`StyleSheet.svelte` is identical to dev's, and the pager's one-shot `scrollLeft` is the suspect), so I did not change it here: filed as **#1111** with steps and the suspect. ### Pooled ×3 typing/list CPU gate: not run, and why The merge resolution touched a hot path (the six-piece `GlobalLayer` paint on the list/sidebar side, plus slice 4's `Editor.svelte`, `cm.css`, `editing.svelte.ts` which the typing path runs through), so a pooled ABAB ×3 on perf-01 IS owed. I did not spend it on this head because the must-fix above changes `PageTab`/`ThemeRow` (not the typing path, but the final `GlobalLayer` may change too if the scheme-switch hitch is chased). Run it once on the head that fixes sheet-open. Perf-01's queue also had two live tickets. ### State Pushed: 4eca8a496 (merge), a2f824dee (budgets). Not merged, per instructions. Nothing left running on dev-01, dev-02, the Mac or std from this lane except the units named in the final report (stopped there). ## Shots **Mac Safari: Style sheet, this head, light** ![](https://git.kayg.org/attachments/bacdeaa1-bcec-471a-83ef-ecb8bcf2bfb7) **Mac Safari: Style sheet, this head, dark** ![](https://git.kayg.org/attachments/ce2b94d5-dd7d-4a86-8d59-337e9e27d8c3) **Mac Safari: Style sheet, base 4f0b58327, light** ![](https://git.kayg.org/attachments/f984a468-ec12-458f-a095-aca0309fd171) **Crisp, this head, editor focused (promoted layers)** ![](https://git.kayg.org/attachments/adc1b3e4-eff3-496d-95b9-32ba9254cdbb) **Crisp, this head, editor not focused** ![](https://git.kayg.org/attachments/ab388d03-f1aa-4711-85d4-7cd1192da590) **Crisp, dev (no promotion)** ![](https://git.kayg.org/attachments/3c1b53d8-3d78-49e5-8ccc-a6c40c4406f4) **iPhone Sim: ?sheet=style (no tab): Page highlighted, Text content (bug, #1111)** ![](https://git.kayg.org/attachments/af28a303-e5bf-4022-9679-61b7b3c14a8b) **iPhone Sim: ?sheet=style (no tab), dark** ![](https://git.kayg.org/attachments/5a694313-3369-4599-ba70-557a9d071b98) **iPhone Sim: ?sheet=style&tab=page (correct)** ![](https://git.kayg.org/attachments/e48d1741-5177-4261-b8ad-cd6f06e767a4)
Author
Owner

Style sheet open hitch (Safari): fixed. Head 683b00eda (code = 08262ee8b + budgets). Not merged.

Follow-up to the gate report above (comment 95717). Base for "base" below: integration head 4f0b58327. "dev": 796d80cba. "s4": a2f824dee (the head that hitched).

What it was (profiled, then bisected in real Safari)

  • Chromium trace (dev-01, 4x throttle, unminified builds, 5 opens each): s4 added about +170 ms of style recalc, +120 ms of paint, +120 ms of rAF callbacks and +90 ms of forced layout over base. The rAF callbacks were ThemeRow's edges() reading scrollWidth and the first reveal() running scrollIntoView, both forcing layout inside the open. The contrast maths (tokens() × 13) was about 20–30 ms at 4x. I fixed those first (02ee2302e).

  • Real Safari didn't move on that fix (sheet open: s4 65 → 81.5 ms median), so I bisected in Safari, same session, 8 ABAB cycles each (worst frame per open: median | runs ≥50 ms):

    variant (on the fix) median ≥50 ms
    base 45.5 3/8
    fix (cached maths, no forced layout) 74.5 6/8
    no theme row at all 50.5 4/8
    row mask removed 78.5 8/8
    tiles without gradient/shadow/balance/mask 50.5 4/8
    only 4 tiles 39 2/8
    GlobalLayer from base 60.5 7/8

    and a second round on the staged build: dev 40.5 (0/8) · staged 77 (7/8) · no gradient 49.5 (4/8) · no card shadow 64 (6/8) · fill only on intent 60.5 (8/8) · 4 tiles + intent 52.5 (4/8).

  • Cause: Safari paints the theme tiles' 39 radial gradients (the largest part) and 13 blurred card shadows in the frames of the open. It's not the contrast maths, the row mask or the GlobalLayer gradient.

The fix (no look change)

  • lib/theme-thumbs.ts (new): each theme's tile picture, meaning the backdrop gradient plus the mini card's shadow, is drawn once on a canvas from the same numbers as the CSS. gradientPools() in themes.ts is now the one source for both the CSS string and the canvas. The result is kept as a decoded image, so a tile paints one cached image. The 1 px inset line and the card itself (paper, ink lines, dot) stay CSS, so the layering is unchanged. A tile whose picture isn't ready yet draws with CSS exactly as before.
  • Warming runs one picture per task, only while the user is quiet (no key, pointer or wheel for 1.5 s), so it never lands in typing, list scrolling or a gesture. Pictures are drawn at the screen's pixel ratio (2x to 3x).
  • The open builds only the tiles that can be on screen (the first 5, plus the chosen one and its neighbours). The others are same-width empty boxes (row size, scroll width and fades unchanged), filled one per frame 320 ms later, or all at once on scroll, pointer or focus.
  • swatch() solves only the body ink (the same call tokens() makes; a unit test checks every theme and scheme) and is cached. edges() reads geometry in its ResizeObserver callback (layout already clean), and the first reveal() runs there too; the default first tile needs none.
  • Commits: 02ee2302e, eeca6d78b, b2fd47e92, 07ece5961, 35e5fa10a, 08262ee8b (code); 3dd26fcd6, 20988183c, 683b00eda (budgets).

Real Safari, macos-01 (final session below): 1440×900, DPR 1, ABAB 8 cycles, same session, arms dev | base | s4 | final (35e5fa10a; 08262ee8b only adds the 3x branch, which is the same code at DPR 1)

Blank page first: 138 frames in 2 s (mean 17.25 ms, ≥60 rAF/s; one 115 ms frame in the 2 s, idle noise). Free memory 1.6 GB at start, 0.5 GB at end, swap 0. Idle baseline: worst 23–24 ms median in every arm, 0 frames ≥50 ms.

gesture (median of worst frame, ms | runs ≥50 ms) dev base s4 final
open the Style sheet 38.0 | 1/8 42.0 | 0/8 64.5 | 8/8 40.0 | 0/8
close (Esc) 27 | 0 23 | 0 22 | 0 23 | 0
theme tile Nord – – 39 | 0 28 | 0
theme tile Same as app – – 33 | 0 32 | 0
app scheme → dark 59 | 7/7 70 | 7/7 69 | 7/7 66 | 7/7
app scheme → light 53 | 7/7 53 | 7/7 67 | 7/7 68 | 7/7

Per-run worst frame on open: dev 40 33 23 45 45 36 24 58 · base 33 49 36 49 46 38 48 36 · s4 66 64 70 59 60 60 79 65 · final 41 34 37 41 37 39 41 42. (Scheme rows: 7 cycles, because my wrapper's ssh dropped mid-run; the script kept going and finished the open/close rows.) The theme pictures were in use on every measured open (13/13 .thumb.pic).

Two earlier full sessions on 07ece5961 / b2fd47e92 agree: final 42.0 (1/8) vs dev 34.5 (1/8), base 42.5 (1/8), s4 61.5 (8/8); bake 39 (3/8) vs dev 27 (1/8), base 34 (2/8), s4 57.5 (4/8).

Verdict on the brief's pass line: sheet open now has no extra ≥50 ms hitches (0/8 vs dev 1/8) and sits at the integration base's level. Its median is within 2 ms of dev in the final session, but across sessions it tracks base rather than dev: base itself is +4 to +8 ms over dev in every session, and that gap is the integration head's, not slice 4's.

Scheme switch: I tried the --fade change (crossfading a static ::after layer's opacity instead of transitioning a registered custom property; it composites to the same pixels, Faded strips matched within 1–2 levels). In Safari it was worse (scheme → dark 75.5 vs s4 66.5; → light 75 vs 63), so I dropped it, as the brief says (branch deleted). The scheme switch hitches in every arm (dev included). s4 and final sit about 0–14 ms above base on → light depending on the session (sessions: +3/+2, +5/+5, +14/+15), so it's still an open item, not touched by this fix.

Look: the theme row, s4 (CSS tiles) vs final (canvas pictures), diffed in Safari's own canvas over the row's box (43,885 px). Light: mean |Δ| 0.95, 869 px over 4 levels. Dark: mean 0.29, 175 px over 4. The differences are sub-pixel edges (the card's right edge, the tile rim) and name-glyph antialiasing (the names are CSS in both arms). Crops below: top = s4, middle = final, bottom = |Δ| × 4.

Gates (head code 08262ee8b; budgets head 683b00eda)

Server binary: dev-01 nf-base-bin (crates identical to this head: git diff of crates/Cargo.lock = 0 lines; only a re-written Cargo.lock in that tree), dev-02 a copy of nf-toolbar's binary (crates identical, same check). 19 spec files (style-presets.spec.ts was deleted by slice 4): CI=1 bunx playwright test <19 specs> --project=<p> --workers=1 --retries=0, under ~/bin/slot.

gate result
chromium-1440 (dev-01) 117 passed, 29 skipped, 0 failed
chromium-390 (dev-01) 97 passed, 49 skipped, 0 failed (on 3dd26fcd6 one run hit tint.spec.ts:313 phone swipe: --repeat-each=8 → 48/48 on this head, 46/48 on base 4f0b58327: an existing flake in the integration head)
webkit-1440 (dev-02) 112 passed, 34 skipped, 0 failed
webkit-390 (dev-02) 92 passed, 54 skipped, 0 failed
svelte-check 0 errors, 19 warnings (same as before)
vitest 29 files, 295 tests passed (+2: the swatch cache equals tokens() for all themes/schemes; gradient() unchanged by the pools refactor)
bundle (perf/web.sh --bundle-only --gate) exit 0. vs a2f824dee, same toolchain: first JS 229.013 → 229.041 (index code byte-identical unminified, same exports; hash jitter only), first CSS 19.843 → 19.843, idle-screens 60.055 → 61.072 (+1.017, the pictures module), total 543.673 → 545.007. Lines: index 229.11, idle-screens 61.08; total set to the sum of the chunk lines (554.777), as the gate requires. The merged head a2f824dee already summed to 553.672 against a total of 550.007, so its gate also failed that check.
pooled ×3 typing/list, perf-01 (~/bin/perf-turn s4h-1100, perf-02 lock held by a watcher, dev vs dev2 control vs this head, 8 each per session; measured dist = 35e5fa10a, which is identical code on every path but the 3x branch) typing CPU/key −1.18% (95% CI −2.35..−0.01; control +1.06%), typing script −2.25% (control +2.83%). List CPU +2.49% (CI +0.99..+4.00; control +0.90%, CI −0.34..+2.14), list layout +5.89% (control +2.84%), list recalc +5.43% (control +4.57%).

The list number is against dev, so it includes the whole integration head. Nothing in this fix runs on the list path (ThemeRow is mounted only in the Style sheet; warming waits for 1.5 s of no input). To attribute it, I've queued a second turn with the integration base as a fourth arm (s4h-1100-attr: dev, dev2, base, new; ×3) and will post it here when it lands.

Open / for kayg in the morning

  • iPhone: not shot in the Simulator this time (the look is the same by construction, and the 3x picture branch only runs on a 3x screen). Please glance at the Style sheet's theme row on the phone: the tiles should look as before, crisp.
  • Scheme switch: s4 is a few ms over base on → light in some sessions; the --fade change I tried made it worse. Still open.
  • List CPU vs dev: attribution turn pending (see above).

Shots

Theme row, light: top s4 (CSS), middle final (pictures), bottom |Δ|×4, 3× zoom

Theme row, dark: top s4 (CSS), middle final (pictures), bottom |Δ|×4, 3× zoom

## Style sheet open hitch (Safari): fixed. Head **683b00eda** (code = 08262ee8b + budgets). Not merged. Follow-up to the gate report above (comment 95717). Base for "base" below: integration head 4f0b58327. "dev": 796d80cba. "s4": a2f824dee (the head that hitched). ### What it was (profiled, then bisected in real Safari) - **Chromium trace** (dev-01, 4x throttle, unminified builds, 5 opens each): s4 added about +170 ms of style recalc, +120 ms of paint, +120 ms of rAF callbacks and +90 ms of forced layout over base. The rAF callbacks were ThemeRow's `edges()` reading `scrollWidth` and the first `reveal()` running `scrollIntoView`, both forcing layout inside the open. The contrast maths (`tokens()` × 13) was about 20–30 ms at 4x. I fixed those first (02ee2302e). - **Real Safari didn't move on that fix** (sheet open: s4 65 → 81.5 ms median), so I bisected in Safari, same session, 8 ABAB cycles each (worst frame per open: median | runs ≥50 ms): | variant (on the fix) | median | ≥50 ms | |---|---|---| | base | 45.5 | 3/8 | | fix (cached maths, no forced layout) | 74.5 | 6/8 | | no theme row at all | 50.5 | 4/8 | | row mask removed | 78.5 | 8/8 | | tiles without gradient/shadow/balance/mask | 50.5 | 4/8 | | only 4 tiles | 39 | 2/8 | | GlobalLayer from base | 60.5 | 7/8 | and a second round on the staged build: dev 40.5 (0/8) · staged 77 (7/8) · **no gradient 49.5 (4/8)** · no card shadow 64 (6/8) · fill only on intent 60.5 (8/8) · 4 tiles + intent 52.5 (4/8). - **Cause:** Safari paints the theme tiles' 39 radial gradients (the largest part) and 13 blurred card shadows in the frames of the open. It's not the contrast maths, the row mask or the GlobalLayer gradient. ### The fix (no look change) - `lib/theme-thumbs.ts` (new): each theme's tile picture, meaning the backdrop gradient plus the mini card's shadow, is drawn **once on a canvas** from the same numbers as the CSS. `gradientPools()` in `themes.ts` is now the one source for both the CSS string and the canvas. The result is kept as a decoded image, so a tile paints one cached image. The 1 px inset line and the card itself (paper, ink lines, dot) stay CSS, so the layering is unchanged. A tile whose picture isn't ready yet draws with CSS exactly as before. - Warming runs one picture per task, **only while the user is quiet** (no key, pointer or wheel for 1.5 s), so it never lands in typing, list scrolling or a gesture. Pictures are drawn at the screen's pixel ratio (2x to 3x). - The open builds only the tiles that can be on screen (the first 5, plus the chosen one and its neighbours). The others are same-width empty boxes (row size, scroll width and fades unchanged), filled one per frame 320 ms later, or all at once on scroll, pointer or focus. - `swatch()` solves only the body ink (the same call `tokens()` makes; a unit test checks every theme and scheme) and is cached. `edges()` reads geometry in its ResizeObserver callback (layout already clean), and the first `reveal()` runs there too; the default first tile needs none. - Commits: 02ee2302e, eeca6d78b, b2fd47e92, 07ece5961, 35e5fa10a, 08262ee8b (code); 3dd26fcd6, 20988183c, 683b00eda (budgets). ### Real Safari, macos-01 (final session below): 1440×900, DPR 1, ABAB 8 cycles, same session, arms dev | base | s4 | final (35e5fa10a; 08262ee8b only adds the 3x branch, which is the same code at DPR 1) Blank page first: 138 frames in 2 s (mean 17.25 ms, ≥60 rAF/s; one 115 ms frame in the 2 s, idle noise). Free memory 1.6 GB at start, 0.5 GB at end, swap 0. Idle baseline: worst 23–24 ms median in every arm, 0 frames ≥50 ms. | gesture (median of worst frame, ms \| runs ≥50 ms) | dev | base | s4 | **final** | |---|---|---|---|---| | **open the Style sheet** | 38.0 \| 1/8 | 42.0 \| 0/8 | 64.5 \| 8/8 | **40.0 \| 0/8** | | close (Esc) | 27 \| 0 | 23 \| 0 | 22 \| 0 | 23 \| 0 | | theme tile Nord | – | – | 39 \| 0 | 28 \| 0 | | theme tile Same as app | – | – | 33 \| 0 | 32 \| 0 | | app scheme → dark | 59 \| 7/7 | 70 \| 7/7 | 69 \| 7/7 | 66 \| 7/7 | | app scheme → light | 53 \| 7/7 | 53 \| 7/7 | 67 \| 7/7 | 68 \| 7/7 | Per-run worst frame on open: dev 40 33 23 45 45 36 24 58 · base 33 49 36 49 46 38 48 36 · s4 66 64 70 59 60 60 79 65 · **final 41 34 37 41 37 39 41 42**. (Scheme rows: 7 cycles, because my wrapper's ssh dropped mid-run; the script kept going and finished the open/close rows.) The theme pictures were in use on every measured open (13/13 `.thumb.pic`). Two earlier full sessions on 07ece5961 / b2fd47e92 agree: final 42.0 (1/8) vs dev 34.5 (1/8), base 42.5 (1/8), s4 61.5 (8/8); bake 39 (3/8) vs dev 27 (1/8), base 34 (2/8), s4 57.5 (4/8). **Verdict on the brief's pass line:** sheet open now has no extra ≥50 ms hitches (0/8 vs dev 1/8) and sits at the integration base's level. Its median is within 2 ms of dev in the final session, but across sessions it tracks base rather than dev: base itself is +4 to +8 ms over dev in every session, and that gap is the integration head's, not slice 4's. **Scheme switch:** I tried the `--fade` change (crossfading a static `::after` layer's opacity instead of transitioning a registered custom property; it composites to the same pixels, Faded strips matched within 1–2 levels). In Safari it was **worse** (scheme → dark 75.5 vs s4 66.5; → light 75 vs 63), so I dropped it, as the brief says (branch deleted). The scheme switch hitches in every arm (dev included). s4 and final sit about 0–14 ms above base on → light depending on the session (sessions: +3/+2, +5/+5, +14/+15), so it's still an open item, not touched by this fix. **Look:** the theme row, s4 (CSS tiles) vs final (canvas pictures), diffed in Safari's own canvas over the row's box (43,885 px). Light: mean |Δ| 0.95, 869 px over 4 levels. Dark: mean 0.29, 175 px over 4. The differences are sub-pixel edges (the card's right edge, the tile rim) and name-glyph antialiasing (the names are CSS in both arms). Crops below: top = s4, middle = final, bottom = |Δ| × 4. ### Gates (head code 08262ee8b; budgets head 683b00eda) Server binary: dev-01 `nf-base-bin` (crates identical to this head: `git diff` of crates/Cargo.lock = 0 lines; only a re-written Cargo.lock in that tree), dev-02 a copy of `nf-toolbar`'s binary (crates identical, same check). 19 spec files (style-presets.spec.ts was deleted by slice 4): `CI=1 bunx playwright test <19 specs> --project=<p> --workers=1 --retries=0`, under `~/bin/slot`. | gate | result | |---|---| | chromium-1440 (dev-01) | 117 passed, 29 skipped, 0 failed | | chromium-390 (dev-01) | 97 passed, 49 skipped, 0 failed (on 3dd26fcd6 one run hit `tint.spec.ts:313` phone swipe: `--repeat-each=8` → **48/48 on this head, 46/48 on base 4f0b58327**: an existing flake in the integration head) | | webkit-1440 (dev-02) | 112 passed, 34 skipped, 0 failed | | webkit-390 (dev-02) | 92 passed, 54 skipped, 0 failed | | svelte-check | 0 errors, 19 warnings (same as before) | | vitest | 29 files, 295 tests passed (+2: the swatch cache equals `tokens()` for all themes/schemes; `gradient()` unchanged by the pools refactor) | | bundle (`perf/web.sh --bundle-only --gate`) | exit 0. vs a2f824dee, same toolchain: first JS 229.013 → 229.041 (index code byte-identical unminified, same exports; hash jitter only), first CSS 19.843 → 19.843, idle-screens 60.055 → 61.072 (+1.017, the pictures module), total 543.673 → 545.007. Lines: index 229.11, idle-screens 61.08; **total set to the sum of the chunk lines (554.777)**, as the gate requires. The merged head a2f824dee already summed to 553.672 against a total of 550.007, so its gate also failed that check. | | pooled ×3 typing/list, perf-01 (`~/bin/perf-turn s4h-1100`, perf-02 lock held by a watcher, dev vs dev2 control vs this head, 8 each per session; measured dist = 35e5fa10a, which is identical code on every path but the 3x branch) | **typing CPU/key −1.18%** (95% CI −2.35..−0.01; control +1.06%), typing script −2.25% (control +2.83%). **List CPU +2.49%** (CI +0.99..+4.00; control +0.90%, CI −0.34..+2.14), list layout +5.89% (control +2.84%), list recalc +5.43% (control +4.57%). | **The list number is against dev, so it includes the whole integration head.** Nothing in this fix runs on the list path (ThemeRow is mounted only in the Style sheet; warming waits for 1.5 s of no input). To attribute it, I've queued a second turn with the integration base as a fourth arm (`s4h-1100-attr`: dev, dev2, base, new; ×3) and will post it here when it lands. ### Open / for kayg in the morning - iPhone: **not shot in the Simulator** this time (the look is the same by construction, and the 3x picture branch only runs on a 3x screen). Please glance at the Style sheet's theme row on the phone: the tiles should look as before, crisp. - Scheme switch: s4 is a few ms over base on → light in some sessions; the `--fade` change I tried made it worse. Still open. - List CPU vs dev: attribution turn pending (see above). ## Shots **Theme row, light: top s4 (CSS), middle final (pictures), bottom |Δ|×4, 3× zoom** ![](https://git.kayg.org/attachments/da222929-83a7-4082-8991-a5996b89fb79) **Theme row, dark: top s4 (CSS), middle final (pictures), bottom |Δ|×4, 3× zoom** ![](https://git.kayg.org/attachments/9edcb041-d0da-4467-b2f7-2b9560d49d65)
Author
Owner

Correction + clean verdict: sheet-open fix passes on a quiet Mac. Head 683b00eda. Not merged.

1. My earlier Safari numbers are invalid (overlap with the Mail lane's Mac job)

The Mail lane's job on macos-01 checked out its worktree at 13:40:49 PST (03:10:49 IST) and was writing cargo build output until 14:48:15 PST (04:18:15 IST). My Safari sessions ran 13:25–15:53 PST. Sessions 1–5 (the first five-arm run, both variant bisects, the "stage" run and the "bake" run) overlapped that window completely, and I can't prove the machine was quiet for 6–8 either. Every Safari frame number in comment 95791 is withdrawn as a measurement. My script took the lock with mkdir only, but I'm now using exactly until mkdir /tmp/mac-bench.lock 2>/dev/null; do sleep 30; done and never writing into a lock dir I didn't create. Each run now also logs the load average and the top CPU processes, so contention is visible in the data. The bisect direction (the tile gradients and shadows painted in the open) is what the code change is based on; the clean runs below confirm the outcome.

2. Also found: the comparison wasn't like for like

Slice 4 makes a note with no width line render as the Narrow card (widthOf() → "narrow", orchestrator 11-12 "mockup values win"), while dev and base render the same note Full. The harness note frame-00 has no width line, so s4/final were opening the sheet over a floating card while dev/base opened it over a full page. The clean re-runs therefore seed two extra notes in every arm, calternal-width: full and calternal-width: narrow, and measure each.

3. Clean real-Safari verdict (macos-01, 1440×900, DPR 1, ABAB 8 cycles per session; lock taken by my own mkdir, released at exit; load 1.0–2.3, top CPU only WebKit/Safari)

Worst frame per sheet open: median | runs ≥50 ms.

note dev base s4 final (683b00eda)
Full (17:16–17:27 PST) 32.0 | 2/8 40.0 | 3/8 34.0 | 1/8 25.5 | 2/8
Narrow (17:39–17:50 PST) 41.0 | 2/8 46.0 | 4/8 47.0 | 4/8 35.5 | 0/8
no width line (16:51–17:03 PST; Full in dev/base, Narrow in s4/final) 23.0 | 0/8 24.0 | 0/8 43.0 | 0/8 34.5 | 0/8
  • Pass: on the same page, final opens the sheet below dev's median with no extra ≥50 ms hitches, on both Full and Narrow.
  • The third row is the cost of the Narrow default for notes without a width line (a product decision, not this PR's code). It's the same comparison the gate report made.
  • An earlier Narrow session (17:27–17:38 PST) agrees (final 41.0 | 2/8 vs dev 57.5 | 5/8), but macOS's mediaanalysisd was at 96% CPU during it, so I discarded it and re-ran (the row above).
  • Theme pictures in use on every measured open: 13/13.
  • Theme taps (final vs s4, Narrow): Nord 26.0 vs 32.0, Same as app 31.0 vs 35.5, 0 runs ≥50 ms.
  • App scheme switch: every arm hitches. On Full: final 52.5/53 (dark/light) vs dev 59.5/54.5 vs base 60.5/56. On Narrow: final 53/52.5 vs dev 51.5/55.5 vs base 61/53. Final is at dev/base level, so I'm withdrawing my earlier "+few ms on → light" note (it came from contaminated sessions). The --fade change stays dropped.
  • A bisect on the final head (clean, 17:05–17:15 PST) showed the theme row is no longer what costs the open: final with the row removed measured the same as final (45.5 vs 44.0 on the no-width-line note).

Look check (clean): theme row, s4 (CSS) vs final (pictures), diffed in Safari over the row's box: light mean |Δ| 0.71 (625 of 43,885 px over 4 levels), dark 0.31 (198 px). Same sub-pixel edges as before.

4. Typing/list attribution (perf-01, ~/bin/perf-turn s4h-1100-attr, perf-02 lock held by a watcher 20:31:22–21:18:51 EST; arms dev, dev2 control, base 4f0b58327, new = this head's dist; 6 per arm per session, ×3)

metric new vs dev base vs dev control dev2 vs dev new vs base
typing CPU/key −0.06% [−1.42..+1.30] +0.90% +1.35% −0.95% [−2.31..+0.40]
list CPU +0.79% [+0.01..+1.57] +0.24% −1.08% [−1.85..−0.32] +0.55% [−0.23..+1.32]
list script +3.23% [+1.55..+4.90] +1.81% −0.47% +1.38% [−0.19..+2.96]
list layout +0.14% −0.62% −1.87% +0.77% [−1.46..+3.00]
list recalc +1.31% +0.05% −1.27% +1.28% [−0.78..+3.35]
  • The first turn's list CPU +2.49% didn't reproduce (+0.79% here).
  • The dev-vs-dev control swings by about ±1.1% between turns.
  • new vs base isn't significant on any metric. Typing is at dev.
  • list script vs dev (+3.2%, CI excludes 0) is about half the integration base's own (+1.8%) and half new-vs-base (+1.4%, CI includes 0). It's about 6 ms on a ~2.5 s scroll. Nothing in this fix runs while scrolling: ThemeRow mounts only in the Style sheet, and the picture warm-up waits for 1.5 s with no input. If the orchestrator wants that last half-point chased, the candidate is slice 4's own list-side change (the GlobalLayer gradient), not the sheet fix.

Gates on the code head (unchanged since comment 95791)

chromium-1440 117 passed / 0 failed · chromium-390 97 / 0 · webkit-1440 112 / 0 · webkit-390 92 / 0 · svelte-check 0 errors (19 warnings, as before) · vitest 295 passed · bundle gate exit 0 (first JS 229.041, idle-screens 61.072, total 545.007; lines index 229.11, idle-screens 61.08, total = sum 554.777).

Open for kayg

  • iPhone Simulator not shot (3x pictures only change sharpness on a 3x screen). Please glance at the theme row on the phone.
  • A note with no width line now opens the sheet over the Narrow card (slice 4's default, orchestrator 11-12). It's costlier than over Full in every build, but final over Narrow (35.5) is still below dev over Narrow (41.0).
## Correction + clean verdict: sheet-open fix passes on a quiet Mac. Head **683b00eda**. Not merged. ### 1. My earlier Safari numbers are invalid (overlap with the Mail lane's Mac job) The Mail lane's job on macos-01 checked out its worktree at **13:40:49 PST (03:10:49 IST)** and was writing cargo build output until **14:48:15 PST (04:18:15 IST)**. My Safari sessions ran 13:25–15:53 PST. Sessions 1–5 (the first five-arm run, both variant bisects, the "stage" run and the "bake" run) overlapped that window completely, and I can't prove the machine was quiet for 6–8 either. **Every Safari frame number in comment 95791 is withdrawn as a measurement.** My script took the lock with `mkdir` only, but I'm now using exactly `until mkdir /tmp/mac-bench.lock 2>/dev/null; do sleep 30; done` and never writing into a lock dir I didn't create. Each run now also logs the load average and the top CPU processes, so contention is visible in the data. The bisect *direction* (the tile gradients and shadows painted in the open) is what the code change is based on; the clean runs below confirm the outcome. ### 2. Also found: the comparison wasn't like for like Slice 4 makes a note with **no width line** render as the **Narrow** card (`widthOf()` → `"narrow"`, orchestrator 11-12 "mockup values win"), while dev and base render the same note **Full**. The harness note `frame-00` has no width line, so s4/final were opening the sheet over a floating card while dev/base opened it over a full page. The clean re-runs therefore seed two extra notes in every arm, `calternal-width: full` and `calternal-width: narrow`, and measure each. ### 3. Clean real-Safari verdict (macos-01, 1440×900, DPR 1, ABAB 8 cycles per session; lock taken by my own `mkdir`, released at exit; load 1.0–2.3, top CPU only WebKit/Safari) Worst frame per sheet open: median | runs ≥50 ms. | note | dev | base | s4 | **final (683b00eda)** | |---|---|---|---|---| | **Full** (17:16–17:27 PST) | 32.0 \| 2/8 | 40.0 \| 3/8 | 34.0 \| 1/8 | **25.5 \| 2/8** | | **Narrow** (17:39–17:50 PST) | 41.0 \| 2/8 | 46.0 \| 4/8 | 47.0 \| 4/8 | **35.5 \| 0/8** | | no width line (16:51–17:03 PST; Full in dev/base, Narrow in s4/final) | 23.0 \| 0/8 | 24.0 \| 0/8 | 43.0 \| 0/8 | 34.5 \| 0/8 | - **Pass:** on the same page, final opens the sheet **below dev's median with no extra ≥50 ms hitches**, on both Full and Narrow. - The third row is the cost of the Narrow default for notes without a width line (a product decision, not this PR's code). It's the same comparison the gate report made. - An earlier Narrow session (17:27–17:38 PST) agrees (final 41.0 \| 2/8 vs dev 57.5 \| 5/8), but macOS's `mediaanalysisd` was at 96% CPU during it, so I discarded it and re-ran (the row above). - Theme pictures in use on every measured open: 13/13. - Theme taps (final vs s4, Narrow): Nord 26.0 vs 32.0, Same as app 31.0 vs 35.5, 0 runs ≥50 ms. - App scheme switch: every arm hitches. On Full: final 52.5/53 (dark/light) vs dev 59.5/54.5 vs base 60.5/56. On Narrow: final 53/52.5 vs dev 51.5/55.5 vs base 61/53. Final is at dev/base level, so I'm withdrawing my earlier "+few ms on → light" note (it came from contaminated sessions). The `--fade` change stays dropped. - A bisect on the final head (clean, 17:05–17:15 PST) showed the theme row is no longer what costs the open: final with the row removed measured the same as final (45.5 vs 44.0 on the no-width-line note). **Look check (clean):** theme row, s4 (CSS) vs final (pictures), diffed in Safari over the row's box: light mean |Δ| 0.71 (625 of 43,885 px over 4 levels), dark 0.31 (198 px). Same sub-pixel edges as before. ### 4. Typing/list attribution (perf-01, `~/bin/perf-turn s4h-1100-attr`, perf-02 lock held by a watcher 20:31:22–21:18:51 EST; arms dev, dev2 control, base 4f0b58327, new = this head's dist; 6 per arm per session, ×3) | metric | new vs dev | base vs dev | control dev2 vs dev | **new vs base** | |---|---|---|---|---| | typing CPU/key | −0.06% [−1.42..+1.30] | +0.90% | +1.35% | **−0.95%** [−2.31..+0.40] | | list CPU | +0.79% [+0.01..+1.57] | +0.24% | −1.08% [−1.85..−0.32] | **+0.55%** [−0.23..+1.32] | | list script | +3.23% [+1.55..+4.90] | +1.81% | −0.47% | +1.38% [−0.19..+2.96] | | list layout | +0.14% | −0.62% | −1.87% | +0.77% [−1.46..+3.00] | | list recalc | +1.31% | +0.05% | −1.27% | +1.28% [−0.78..+3.35] | - The first turn's list CPU +2.49% didn't reproduce (+0.79% here). - The dev-vs-dev control swings by about ±1.1% between turns. - **new vs base isn't significant on any metric.** Typing is at dev. - list script vs dev (+3.2%, CI excludes 0) is about half the integration base's own (+1.8%) and half new-vs-base (+1.4%, CI includes 0). It's about 6 ms on a ~2.5 s scroll. Nothing in this fix runs while scrolling: ThemeRow mounts only in the Style sheet, and the picture warm-up waits for 1.5 s with no input. If the orchestrator wants that last half-point chased, the candidate is slice 4's own list-side change (the GlobalLayer gradient), not the sheet fix. ### Gates on the code head (unchanged since comment 95791) chromium-1440 117 passed / 0 failed · chromium-390 97 / 0 · webkit-1440 112 / 0 · webkit-390 92 / 0 · svelte-check 0 errors (19 warnings, as before) · vitest 295 passed · bundle gate exit 0 (first JS 229.041, idle-screens 61.072, total 545.007; lines index 229.11, idle-screens 61.08, total = sum 554.777). ### Open for kayg - iPhone Simulator not shot (3x pictures only change sharpness on a 3x screen). Please glance at the theme row on the phone. - A note with no width line now opens the sheet over the Narrow card (slice 4's default, orchestrator 11-12). It's costlier than over Full in every build, but final over Narrow (35.5) is still below dev over Narrow (41.0).
Author
Owner

Merged into port/notes-float with --no-ff at 200db310d by the orchestrator. Gates: comment 95791 + correction 95864 (clean Safari re-runs: sheet open at or below dev, typing at dev, list at base). Open for the final review: iPhone-sim look of the theme row; list script residual is tracked by the residuals lane. Closing.

Merged into `port/notes-float` with `--no-ff` at `200db310d` by the orchestrator. Gates: comment 95791 + correction 95864 (clean Safari re-runs: sheet open at or below dev, typing at dev, list at base). Open for the final review: iPhone-sim look of the theme row; list script residual is tracked by the residuals lane. Closing.
kayg closed this pull request 2026-11-14 02:20:44 +00:00
Some checks failed
CI / server (pull_request) Has been cancelled
CI / rust (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
CI / web (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!1100
No description provided.