fix(style): page presets keep one frame #967

Closed
kayg wants to merge 0 commits from fix/style-page-presets into dev
Owner

Production bugs from the note's Style sheet → Page presets (prod = BM14e 12103f1c). One frame for every preset.

Causes and fixes

  1. Mismatched corner radius. The page's radius was var(--page-radius, 14px) but --page-radius was never defined, so the page was 14 px inside a 20 px frame with an 8 px inset (should be 12). Now one token in tokens.css: --page-radius: calc(var(--r-frame) - var(--frame-pad)), used by the page and its window. The see-through ring's hole was a content-box mask (square corners); it is now rounded to the same radius (four strips plus four corner gradients). Inner = outer − inset, everywhere.
  2. "Clear on photo". A look wrote calternal-width and calternal-frame: off into the note. Clear (narrow, frame off) removed the glass frame and floated a grey card: the rim and page separated. Renamed to Clear; it now only sets colour, see-through and frost, so it is a clear glass page with the same frame as every other preset.
  3. Detached rim. .editor-pane :is(.frame-fill, .frame-shadow) and .viewport later set transition: opacity / box-shadow, which replaced the --cl spring declared earlier on the same elements. The rim then jumped while the window glided (a gap and a second edge). Each element now has ONE transition list with the --cl spring and its fade together.
  4. Width changes. Same cause as 2: looks wrote Width and Frosted border. Looks no longer touch the page box; the thumbnails draw this note's own width and border.

No new components: the shared frame (.frame-fill, .frame-shadow, .viewport) and the one page element are unchanged in number.

Decisions

  • A look no longer writes calternal-width / calternal-frame. A note that already has them keeps them; the look ring ignores them.
  • A phone has no glass rim (the page is the screen's card): the spec checks page box, radius and edge there.

Tests

apps/web/e2e/style-presets.spec.ts cycles every look (forwards and back) and asserts the same page element and box, concentric radii (±0.5 px), one rim box, no second edge, and that the rim never came apart from the window in any frame of the switch.

🤖 Generated with Claude Code

Production bugs from the note's Style sheet → Page presets (prod = BM14e `12103f1c`). One frame for every preset. ## Causes and fixes 1. **Mismatched corner radius.** The page's radius was `var(--page-radius, 14px)` but `--page-radius` was never defined, so the page was 14 px inside a 20 px frame with an 8 px inset (should be 12). Now one token in `tokens.css`: `--page-radius: calc(var(--r-frame) - var(--frame-pad))`, used by the page and its window. The see-through ring's hole was a `content-box` mask (square corners); it is now rounded to the same radius (four strips plus four corner gradients). Inner = outer − inset, everywhere. 2. **"Clear on photo".** A look wrote `calternal-width` and `calternal-frame: off` into the note. Clear (narrow, frame off) removed the glass frame and floated a grey card: the rim and page separated. Renamed to **Clear**; it now only sets colour, see-through and frost, so it is a clear glass page with the same frame as every other preset. 3. **Detached rim.** `.editor-pane :is(.frame-fill, .frame-shadow)` and `.viewport` later set `transition: opacity` / `box-shadow`, which replaced the `--cl` spring declared earlier on the same elements. The rim then jumped while the window glided (a gap and a second edge). Each element now has ONE transition list with the `--cl` spring and its fade together. 4. **Width changes.** Same cause as 2: looks wrote Width and Frosted border. Looks no longer touch the page box; the thumbnails draw this note's own width and border. No new components: the shared frame (`.frame-fill`, `.frame-shadow`, `.viewport`) and the one page element are unchanged in number. ## Decisions - A look no longer writes `calternal-width` / `calternal-frame`. A note that already has them keeps them; the look ring ignores them. - A phone has no glass rim (the page is the screen's card): the spec checks page box, radius and edge there. ## Tests `apps/web/e2e/style-presets.spec.ts` cycles every look (forwards and back) and asserts the same page element and box, concentric radii (±0.5 px), one rim box, no second edge, and that the rim never came apart from the window in any frame of the switch. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A look no longer writes Width or Frosted border, so tapping through the looks keeps the same page box. Clear is renamed and keeps the frame.
The page radius is the frame's radius minus its inset (one token), the see-through rim's hole is rounded to match, and the rim, window and note share one --cl 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>
test(web): style-presets spec waits longer for the sheet to open (readiness, not speed)
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
5aba13d0ed
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Author
Owner

Screenshots: before (dev f299efc2) / after (ffe9b4f9)

Chromium (dev-01), every preset, 1440 and 390, light and dark, full page plus 2x crops of the frame's top-left corner. All 56 images are in the zip below (before/, after/), also on the control host at ~/Developer/Worktrees/shots/style-presets/. Shown here: 1440 light, Frosted card and Clear/Clear on photo, full page and corner.
Playwright WebKit paints no backdrop-filter, so these Chromium shots are for the frame and corner shapes only; blur was not judged from WebKit shots.

  • Clear before: a flat card with no frame, a stray vertical line at the left. After: clear glass page in the same frame as every other preset.
  • Paper / Frosted / Plain after: the rim hugs the page at every corner (radius 20 - 8 = 12).

style-presets-shots.zip
before-chromium-1440-light-Frosted_card-full.png
before-chromium-1440-light-Frosted_card-corner.png
after-chromium-1440-light-Frosted_card-full.png
after-chromium-1440-light-Frosted_card-corner.png
before-chromium-1440-light-Clear_on_photo-full.png
before-chromium-1440-light-Clear_on_photo-corner.png
after-chromium-1440-light-Clear-full.png
after-chromium-1440-light-Clear-corner.png
after-chromium-1440-light-Paper-corner.png

## Screenshots: before (dev `f299efc2`) / after (`ffe9b4f9`) Chromium (dev-01), every preset, 1440 and 390, light and dark, full page plus 2x crops of the frame's top-left corner. All 56 images are in the zip below (`before/`, `after/`), also on the control host at `~/Developer/Worktrees/shots/style-presets/`. Shown here: 1440 light, Frosted card and Clear/Clear on photo, full page and corner. Playwright WebKit paints no `backdrop-filter`, so these Chromium shots are for the frame and corner shapes only; blur was not judged from WebKit shots. - Clear before: a flat card with no frame, a stray vertical line at the left. After: clear glass page in the same frame as every other preset. - Paper / Frosted / Plain after: the rim hugs the page at every corner (radius 20 - 8 = 12). [style-presets-shots.zip](https://git.kayg.org/attachments/ee73bb45-e3bb-4522-a8e1-2e222238f338) ![before-chromium-1440-light-Frosted_card-full.png](https://git.kayg.org/attachments/bcf192bb-511f-4f91-af81-5b3bf5669bff) ![before-chromium-1440-light-Frosted_card-corner.png](https://git.kayg.org/attachments/0a90334a-8b42-421a-aa0b-51f0dcc31641) ![after-chromium-1440-light-Frosted_card-full.png](https://git.kayg.org/attachments/c413af04-8a32-4e21-b2dd-aa2f3e0333ac) ![after-chromium-1440-light-Frosted_card-corner.png](https://git.kayg.org/attachments/baa3b408-b6bd-4b3a-abf1-79f728595ed8) ![before-chromium-1440-light-Clear_on_photo-full.png](https://git.kayg.org/attachments/4c10ee0d-93b7-42c5-9a68-ec3046ce0acd) ![before-chromium-1440-light-Clear_on_photo-corner.png](https://git.kayg.org/attachments/6688242e-e386-4a78-bd8f-191c0baeec36) ![after-chromium-1440-light-Clear-full.png](https://git.kayg.org/attachments/672c0b49-b532-4231-b8d1-b51334124595) ![after-chromium-1440-light-Clear-corner.png](https://git.kayg.org/attachments/ba761973-6cb5-49fd-b55e-8596f2ad633d) ![after-chromium-1440-light-Paper-corner.png](https://git.kayg.org/attachments/23b2bd5b-f85f-454d-bcd8-5dba241f4284)
Author
Owner

Gates at head ffe9b4f9 (dev was f299efc2 at the last comparison)

Gate Command Result
New spec, Chromium, dev-01, 1440+390, x10 ~/bin/slot bunx playwright test e2e/style-presets.spec.ts --project=chromium-1440 --project=chromium-390 --workers=1 --repeat-each=10 20 passed
New spec, WebKit, dev-02, 1440+390, x10 same with webkit-* 20 passed
Existing specs, Chromium (style-sheet, bar-taps, note-bars, note-bars-fit, note-bars-motion, opacity) playwright test <those> --project=chromium-1440 --project=chromium-390 --workers=1 60 passed, 38 skipped, 0 failed
Existing specs, WebKit same with webkit-* 58 passed, 39 skipped, 1 failed (see flake below); an earlier run on the same style code: 59 passed
Unit tests bun run test (apps/web) 107 passed
svelte-check bunx svelte-check --tsconfig ./tsconfig.json 2 errors, 16 warnings: identical on dev (pre-existing). bun run check stops earlier on dev too: actions.gen.ts is out of date
New spec on dev code Chromium 1440 fails (at the rename check), so it guards the fix

Flakes (not blocking, flaky rule):

  • opacity.spec.ts:80 webkit-390 failed once (surface alpha read 0). --repeat-each=10 on the branch: 60 passed; on dev: 60 passed. Not reproduced on either.
  • note-bars.spec.ts:322 and note-bars-fit webkit-1440 timed out once each on dev-02 at load average 25 (the Style sheet took over 5 s to open). --repeat-each=10 on the branch: 50 passed; on dev: 50 passed.
  • My own new spec failed once on webkit-390 for the same slow-open reason (5 s wait). That was a setup wait in my spec; it now waits up to 20 s for readiness. 20/20 after.

First-paint bytes (bundle-size.mjs, "first"), dev vs branch

raw gzip brotli
JS -19 B -7 B -38 B
CSS -217 B -8 B -12 B

Smaller than dev on every measure. An earlier draft of the rim mask (eight gradients) added bytes; a content-box mask already rounds the hole to frame radius minus padding, so the original two-layer mask is kept. No budget touched.

Frames, Mac VM (WebKit 1440, real GPU), tapping through the looks, 700 ms windows, 5 alternating dev/branch runs

Frames over 20 ms per run (lower is better): dev 65, 54, 66, 65, 63; branch 54, 57, 55, 62, 60.
p95 (ms): dev 19, 19, 22, 19, 19; branch 19, 21, 18, 18, 18. p99 (ms): dev 39, 35, 38, 40, 44; branch 37, 38, 37, 28, 30.
Flat to slightly better than dev. (rAF deltas have 1 ms resolution here and run-to-run spread is about the size of the difference; I would not read more into it.)

Not judged: blur and glass in Playwright WebKit (it paints no backdrop-filter); the screenshots are Chromium.
Note for review: with Frosted card (60% see-through) a very faint soft arc shows just inside the page corner in Chromium; it comes from the page's own backdrop blur sampling the rim glass, and it is concentric with the corner, not a second edge.

## Gates at head `ffe9b4f9` (dev was `f299efc2` at the last comparison) | Gate | Command | Result | |---|---|---| | New spec, Chromium, dev-01, 1440+390, x10 | `~/bin/slot bunx playwright test e2e/style-presets.spec.ts --project=chromium-1440 --project=chromium-390 --workers=1 --repeat-each=10` | 20 passed | | New spec, WebKit, dev-02, 1440+390, x10 | same with `webkit-*` | 20 passed | | Existing specs, Chromium (style-sheet, bar-taps, note-bars, note-bars-fit, note-bars-motion, opacity) | `playwright test <those> --project=chromium-1440 --project=chromium-390 --workers=1` | 60 passed, 38 skipped, 0 failed | | Existing specs, WebKit | same with `webkit-*` | 58 passed, 39 skipped, 1 failed (see flake below); an earlier run on the same style code: 59 passed | | Unit tests | `bun run test` (apps/web) | 107 passed | | svelte-check | `bunx svelte-check --tsconfig ./tsconfig.json` | 2 errors, 16 warnings: identical on dev (pre-existing). `bun run check` stops earlier on dev too: `actions.gen.ts` is out of date | | New spec on dev code | Chromium 1440 | fails (at the rename check), so it guards the fix | **Flakes (not blocking, flaky rule):** - `opacity.spec.ts:80` webkit-390 failed once (surface alpha read 0). `--repeat-each=10` on the branch: 60 passed; on dev: 60 passed. Not reproduced on either. - `note-bars.spec.ts:322` and `note-bars-fit` webkit-1440 timed out once each on dev-02 at load average 25 (the Style sheet took over 5 s to open). `--repeat-each=10` on the branch: 50 passed; on dev: 50 passed. - My own new spec failed once on webkit-390 for the same slow-open reason (5 s wait). That was a setup wait in my spec; it now waits up to 20 s for readiness. 20/20 after. ## First-paint bytes (`bundle-size.mjs`, "first"), dev vs branch | | raw | gzip | brotli | |---|---|---|---| | JS | -19 B | -7 B | -38 B | | CSS | -217 B | -8 B | -12 B | Smaller than dev on every measure. An earlier draft of the rim mask (eight gradients) added bytes; a content-box mask already rounds the hole to frame radius minus padding, so the original two-layer mask is kept. No budget touched. ## Frames, Mac VM (WebKit 1440, real GPU), tapping through the looks, 700 ms windows, 5 alternating dev/branch runs Frames over 20 ms per run (lower is better): dev 65, 54, 66, 65, 63; branch 54, 57, 55, 62, 60. p95 (ms): dev 19, 19, 22, 19, 19; branch 19, 21, 18, 18, 18. p99 (ms): dev 39, 35, 38, 40, 44; branch 37, 38, 37, 28, 30. Flat to slightly better than dev. (rAF deltas have 1 ms resolution here and run-to-run spread is about the size of the difference; I would not read more into it.) Not judged: blur and glass in Playwright WebKit (it paints no backdrop-filter); the screenshots are Chromium. Note for review: with Frosted card (60% see-through) a very faint soft arc shows just inside the page corner in Chromium; it comes from the page's own backdrop blur sampling the rim glass, and it is concentric with the corner, not a second edge.
Author
Owner

Merged into dev by the orchestrator; corner crops checked at 2x. Rides tonight's daily train to prod.

Merged into dev by the orchestrator; corner crops checked at 2x. Rides tonight's daily train to prod.
kayg closed this pull request 2026-11-05 16:53:11 +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!967
No description provided.