port: Notes Float slice 7 — adaptive contrast #1097

Closed
kayg wants to merge 4 commits from port/notes-float-7-contrast into port/notes-float
Owner

Slice 7 of the Notes Float port (plan: docs/plans/notes-float-port.md).

  • packages/ui/lib/behind-glass.ts + contrast.ts (from calendar-2): each <Glass> learns how busy what is behind it is and adapts alpha (calm value -> --max), blur (24 -> 44 px) and inks (4.5:1 body, 3:1 secondary, with a 1.45 margin), eased over 120 ms. Over calm wallpaper the glass is exactly today's. Recomputes only on open, resize, scroll end, theme/backdrop change: zero at idle. Pictures under 48 px never trigger one.
  • Inert: the mockup's busy map hit-tested and lifted inert for each build. Here the map is a snapshot of rects (one chunked tree walk of words and pictures, cells filled by point-in-rect maths), so inert is never read or written and the lease fix (566966709) is not needed. Cost: words hidden behind an opaque card still count (errs toward denser glass).
  • apps/web/lib/behind.ts: the backdrop probe from the numbers that draw it (sky stops, meshes, solids; photos = full range), installed from applyTheme only when the picture, scheme, hue or hour changed.
  • tokens: glass tint / calm alphas / saturate+brightness as plain tokens (calm look unchanged); --ink-4 reaches 4:1 on every page colour. The product has no root Warm/Cool paper (page colours are per note, and --ink-2/3 already reach 4.7:1 on all of them), so the mockup's per-paper --ink-2 table has no target; the dark sidebar wash (0.77) is already in 1a's GlobalLayer.
  • Specs: adaptive-glass.spec.ts, chrome-contrast.spec.ts (window vs sidebar dE: floor 18 default backdrop, 6 others; new chrome-contrast project), behind-ink.test.ts.

Based on port/notes-float-1a (#1093) until it merges; rebase when it moves. Tracking: #1088. Gate results are posted as comments below.

🤖 Generated with Claude Code

Slice 7 of the Notes Float port (plan: docs/plans/notes-float-port.md). - `packages/ui/lib/behind-glass.ts` + `contrast.ts` (from calendar-2): each `<Glass>` learns how busy what is behind it is and adapts alpha (calm value -> `--max`), blur (24 -> 44 px) and inks (4.5:1 body, 3:1 secondary, with a 1.45 margin), eased over 120 ms. Over calm wallpaper the glass is exactly today's. Recomputes only on open, resize, scroll end, theme/backdrop change: zero at idle. Pictures under 48 px never trigger one. - **Inert:** the mockup's busy map hit-tested and lifted `inert` for each build. Here the map is a snapshot of rects (one chunked tree walk of words and pictures, cells filled by point-in-rect maths), so `inert` is never read or written and the lease fix (566966709) is not needed. Cost: words hidden behind an opaque card still count (errs toward denser glass). - `apps/web/lib/behind.ts`: the backdrop probe from the numbers that draw it (sky stops, meshes, solids; photos = full range), installed from `applyTheme` only when the picture, scheme, hue or hour changed. - tokens: glass tint / calm alphas / saturate+brightness as plain tokens (calm look unchanged); `--ink-4` reaches 4:1 on every page colour. The product has no root Warm/Cool paper (page colours are per note, and `--ink-2/3` already reach 4.7:1 on all of them), so the mockup's per-paper `--ink-2` table has no target; the dark sidebar wash (0.77) is already in 1a's GlobalLayer. - Specs: `adaptive-glass.spec.ts`, `chrome-contrast.spec.ts` (window vs sidebar dE: floor 18 default backdrop, 6 others; new `chrome-contrast` project), `behind-ink.test.ts`. Based on `port/notes-float-1a` (#1093) until it merges; rebase when it moves. Tracking: #1088. Gate results are posted as comments below. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
kayg added 25 commits 2026-11-12 14:47:14 +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>
glass.css lifts the alpha from its calm value toward --max and the blur from 24 to 44 px only as far as app words or pictures sit behind a glass; pictures under 48 px never trigger a rebuild; nothing runs at idle.

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: specs for the adaptive glass (calm, idle, small pictures, no inert writes), ink maths unit tests, window-vs-sidebar chrome contrast (floor 18 default, 6 others) (port slice 7)
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
8979f28e42
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Author
Owner

Slice 7 gates (head 5e6537792, on port/notes-float-1a b76a037a2)

Server binary: built from origin/port/notes-float (be968d9df) on dev-01 through ~/bin/slot, one binary for every run. Own --output dir per project, CI=1 --retries=0.

gate result
svelte-check 0 errors
unit tests (incl. new behind-ink.test.ts) pass
chromium-1440 (x86) 18 passed, 8 skipped
chromium-390 15 passed, 11 skipped
webkit-1440 (Linux WebKit, dev-01) 18 passed, 8 skipped
webkit-390 14 passed, 12 skipped
chrome-contrast (x86 chromium, new project, --no-deps) 16 passed
product contrast audits (contrast.spec, tasks-contrast) see below

Specs run: adaptive-glass, glass, composer-open, search-palette. WebKit ran on dev-01 (dev-02 had 48 GB free, under the floor, and no aarch64 binary).

chrome-contrast: window vs flat sidebar area (CIE dE), floor 18 default / 6 others

light: calm 22.7, haze 12.3, bloom 16.5, tide 6.2, ember 8.0, aurora 11.2, dune 13.3, orbit 9.1
dark: calm 20.0, haze 11.8, bloom 16.2, tide 7.9, ember 8.0, aurora 11.6, dune 13.1, orbit 10.0
The product's default backdrop (Calm) was pale (calm: 9.8 light, 11.1 dark; tide light 5.1), so this slice takes the approved mockup's stronger Calm colours (mockup 84b9123ab) and nudges Tide's chroma +0.04. The dark sidebar wash (0.77) is already in 1a's GlobalLayer.

Product contrast audits: parity with the base

On the 1a head, contrast.spec and tasks-contrast fail 5 of 10 with a Playwright strict-mode error (.backdrop[data-painted="true"] resolves to 3 elements, the follower backdrops 1a added): that is a 1a spec slip, not this slice (captain: please fix it in 1a). With that one selector patched locally (not committed) on BOTH heads: the 1a head passes 9 of 10 and this branch 9 of 10; the same single failure on both (contrast.spec:66 "text and icons on the glass keep their contrast at every sky hour"). The palette-over-photo / huge-words / bar-sheet audits pass on this branch.

Adaptive glass behaviour (real Safari, palette over the long note)

state alpha (dense palette glass) blur --glass-busy
base (1a), calm 0.48 light, 0.48 dark 24 px none
this slice, nothing busy behind unchanged: 0.48 / 0.48 24 px 0
this slice, over the note's text rises toward the top of its range rises toward 44 px 1
mockup, same case 0.66 44 px 1
Range per level (glass.css): float 0.42 (dark 0.50) to 0.55; dense 0.48 to 0.66; blur 24 to 44 px; eased over 120 ms, never per frame. (A first build of this slice topped out at 0.82; it now uses the mockup's own ceilings, 0.55 / 0.66.)

Frames, real Safari on the Mac VM (ABAB, one session, 15 samples a side, 1440x900)

Base = 1a head b9a319721, candidate = this branch at ed7e190c3 (the later commits only change alpha ceilings, Tide's colours and the rebase).

metric base slice 7
⌘K worst frame, cold, median (ms) 150 117
⌘K worst frame, warm, median (ms) 100 98
first frame after the key, median (ms) 51 43
idle worst frame, median (ms) 27 25
adaptive-glass recomputes during 5 s of idle n/a 0 in all 15 runs
No regression.

Port notes

  • inert is never read or written: the busy map is a snapshot of rects, so the mockup's lift/restore and its lease fix (566966709) are not needed. A spec counts inert writes across a palette open, resize and close.
  • Pictures under 48 px never trigger a recompute (spec asserts the trigger itself).
  • Found in real Safari: wrapping the recipe in @media (prefers-reduced-transparency: no-preference) made Safari drop it (it does not know the feature); reduced transparency now overrides it instead.
  • Found in WebKit: the map was built before the note arrived and stayed calm; it is now rebuilt when the app is ready, on route change, and when a floating glass opens (never for the always-there glasses, so nothing runs at idle).
  • Quiet ink --ink-4 now reaches 4:1 on every page colour (it was 2.4 to 3.2). The product has no root Warm/Cool paper, and --ink-2/3 already reach 4.7:1 on all page colours, so the mockup's per-paper --ink-2 table has no target here.
  • Playwright's Linux WebKit paints no backdrop blur and does not apply the adaptive recipe (it sits inside @supports backdrop-filter); the densify spec checks ranges only where blur paints.
## Slice 7 gates (head `5e6537792`, on `port/notes-float-1a` b76a037a2) Server binary: built from `origin/port/notes-float` (be968d9df) on dev-01 through `~/bin/slot`, one binary for every run. Own `--output` dir per project, `CI=1 --retries=0`. | gate | result | |---|---| | svelte-check | 0 errors | | unit tests (incl. new `behind-ink.test.ts`) | pass | | chromium-1440 (x86) | 18 passed, 8 skipped | | chromium-390 | 15 passed, 11 skipped | | webkit-1440 (Linux WebKit, dev-01) | 18 passed, 8 skipped | | webkit-390 | 14 passed, 12 skipped | | chrome-contrast (x86 chromium, new project, `--no-deps`) | 16 passed | | product `contrast` audits (`contrast.spec`, `tasks-contrast`) | see below | Specs run: `adaptive-glass`, `glass`, `composer-open`, `search-palette`. WebKit ran on dev-01 (dev-02 had 48 GB free, under the floor, and no aarch64 binary). ### chrome-contrast: window vs flat sidebar area (CIE dE), floor 18 default / 6 others light: calm 22.7, haze 12.3, bloom 16.5, tide 6.2, ember 8.0, aurora 11.2, dune 13.3, orbit 9.1 dark: calm 20.0, haze 11.8, bloom 16.2, tide 7.9, ember 8.0, aurora 11.6, dune 13.1, orbit 10.0 The product's default backdrop (Calm) was pale (calm: 9.8 light, 11.1 dark; tide light 5.1), so this slice takes the approved mockup's stronger Calm colours (mockup `84b9123ab`) and nudges Tide's chroma +0.04. The dark sidebar wash (0.77) is already in 1a's GlobalLayer. ### Product contrast audits: parity with the base On the 1a head, `contrast.spec` and `tasks-contrast` fail 5 of 10 with a Playwright strict-mode error (`.backdrop[data-painted="true"]` resolves to 3 elements, the follower backdrops 1a added): that is a 1a spec slip, not this slice (captain: please fix it in 1a). With that one selector patched locally (not committed) on BOTH heads: the 1a head passes 9 of 10 and this branch 9 of 10; the same single failure on both (`contrast.spec:66` "text and icons on the glass keep their contrast at every sky hour"). The palette-over-photo / huge-words / bar-sheet audits pass on this branch. ### Adaptive glass behaviour (real Safari, palette over the long note) | state | alpha (dense palette glass) | blur | `--glass-busy` | |---|---|---|---| | base (1a), calm | 0.48 light, 0.48 dark | 24 px | none | | this slice, nothing busy behind | unchanged: 0.48 / 0.48 | 24 px | 0 | | this slice, over the note's text | rises toward the top of its range | rises toward 44 px | 1 | | mockup, same case | 0.66 | 44 px | 1 | Range per level (glass.css): float 0.42 (dark 0.50) to 0.55; dense 0.48 to 0.66; blur 24 to 44 px; eased over 120 ms, never per frame. (A first build of this slice topped out at 0.82; it now uses the mockup's own ceilings, 0.55 / 0.66.) ### Frames, real Safari on the Mac VM (ABAB, one session, 15 samples a side, 1440x900) Base = 1a head b9a319721, candidate = this branch at ed7e190c3 (the later commits only change alpha ceilings, Tide's colours and the rebase). | metric | base | slice 7 | |---|---|---| | ⌘K worst frame, cold, median (ms) | 150 | 117 | | ⌘K worst frame, warm, median (ms) | 100 | 98 | | first frame after the key, median (ms) | 51 | 43 | | idle worst frame, median (ms) | 27 | 25 | | adaptive-glass recomputes during 5 s of idle | n/a | **0 in all 15 runs** | No regression. ### Port notes - `inert` is never read or written: the busy map is a snapshot of rects, so the mockup's lift/restore and its lease fix (566966709) are not needed. A spec counts inert writes across a palette open, resize and close. - Pictures under 48 px never trigger a recompute (spec asserts the trigger itself). - Found in real Safari: wrapping the recipe in `@media (prefers-reduced-transparency: no-preference)` made Safari drop it (it does not know the feature); reduced transparency now overrides it instead. - Found in WebKit: the map was built before the note arrived and stayed calm; it is now rebuilt when the app is ready, on route change, and when a floating glass opens (never for the always-there glasses, so nothing runs at idle). - Quiet ink `--ink-4` now reaches 4:1 on every page colour (it was 2.4 to 3.2). The product has no root Warm/Cool paper, and `--ink-2/3` already reach 4.7:1 on all page colours, so the mockup's per-paper `--ink-2` table has no target here. - Playwright's Linux WebKit paints no backdrop blur and does not apply the adaptive recipe (it sits inside `@supports backdrop-filter`); the densify spec checks ranges only where blur paints.
Author
Owner

Slice 7, final re-gate on the rebased head 06f2259bc (on port/notes-float-1a c09ee1312)

Same server binary (built from be968d9df), own --output per project. Specs: adaptive-glass, glass, composer-open, search-palette, window-layout.

project result
chromium-1440 (x86) 25 passed, 8 skipped
chromium-390 15 passed, 18 skipped
webkit-1440 25 passed, 8 skipped
webkit-390 14 passed, 19 skipped
chrome-contrast (x86, --no-deps) 16 passed (floor 18 default / 6 others)
svelte-check / unit 0 errors / all pass (28 files, 267 tests; editor 574)

(The earlier contrast.spec parity result above stands: the one failure there is the same on the 1a head. It was measured on 1a b76a037a2; not re-run after 1a moved again.)

## Slice 7, final re-gate on the rebased head `06f2259bc` (on `port/notes-float-1a` c09ee1312) Same server binary (built from be968d9df), own `--output` per project. Specs: `adaptive-glass`, `glass`, `composer-open`, `search-palette`, `window-layout`. | project | result | |---|---| | chromium-1440 (x86) | 25 passed, 8 skipped | | chromium-390 | 15 passed, 18 skipped | | webkit-1440 | 25 passed, 8 skipped | | webkit-390 | 14 passed, 19 skipped | | chrome-contrast (x86, `--no-deps`) | 16 passed (floor 18 default / 6 others) | | svelte-check / unit | 0 errors / all pass (28 files, 267 tests; editor 574) | (The earlier `contrast.spec` parity result above stands: the one failure there is the same on the 1a head. It was measured on 1a b76a037a2; not re-run after 1a moved again.)
Author
Owner

Merged by git into port/notes-float at 4f0b583278 (head b7efba5d20 is an ancestor); closing. Housekeeping 14 Nov.

Merged by git into `port/notes-float` at 4f0b58327825 (head b7efba5d2036 is an ancestor); closing. Housekeeping 14 Nov.
kayg closed this pull request 2026-11-13 19:32:28 +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!1097
No description provided.