One floating glass: a shared Glass and its tokens for every floating surface (#319) #446

Closed
kayg wants to merge 0 commits from issue/319-one-glass into dev
Owner

Closes #319. One translucent material, float-glass, for every floating surface: a class and a <Glass /> component in @calternal/ui (styles/glass.css, components/Glass.svelte), with its values in tokens.css. Every surface draws it, and their own copies of the values are gone.

The material: the search mockup's lighter glass (#330): tint 0.30 light / 0.36 dark, blur 20 px, saturation 180 / 170%. Readability comes from three things, never from going solid:

  • a soft inner shade (new --glass-float-shade), which fills a pill almost to its middle but leaves a big panel's middle clear;
  • the on-glass inks (--glass-ink-2/3/4, the ones the panes already use) for the words and icons on the glass;
  • one denser step (0.56 / 0.60) where lines of words sit on the glass: menus, the link and tag pickers, and the bar's sheets.

Surfaces: the bar in every mode (tab bar, note tools, formatting bar, block bar, Turn into / Style, sheets, toasts), search (the palette), context menus, the [[ / @ link picker (it was the bar's tint painted on the tooltip itself; now it's the dense glass drawn behind its list), the tag picker, and the toast capsule (its hard-coded fallbacks are gone). The primitives harness reads tokens.css instead of keeping copies. Card and gallery toolbars aren't in the app yet; they use <Glass /> when they land.

#287 kept: the glass never holds the contents. Morph's glass and clip still carry data-morph-until. The tabs' glass stays frosted. Menus and the tag picker used to fade and blur themselves while opening and closing, and with the glass as a child that would cut it off from the page. Now they only scale (springy, in place), and the glass and the rows fade each on their own. From the keyboard, nothing animates.

Floating element Before: tint light / dark Before: filter After: tint light / dark After: filter, shade
Tab bar, note tools, formatting bar, block format bar (the bottom bar's rows) --glass-float 0.40 / 0.42 blur 44px, saturate 200 / 190%, brightness 1.04 / 0.92 --glass-float 0.30 / 0.36 blur 20px, saturate 180 / 170%, brightness 1.04 / 0.90; new inner shade
Block customization (Turn into → Style) and the bar's sheets (Style, Insert, Info, Move, Link) 0.40 / 0.42 (the bar's) as the bar dense 0.56 / 0.60 (eases in with the morph) as the bar
Toasts (in the bar) 0.40 / 0.42 as the bar 0.30 / 0.36 as the bar
Toast capsule (outside the bar) tokens, with hard-coded fallbacks (0.72, blur 30px, saturate 180%) 0.30 / 0.36, no fallbacks as the bar
Search (the palette) 0.40 / 0.42 as the bar 0.30 / 0.36 as the bar
Context menus and submenus --glass-float-dense 0.76 / 0.78 as the bar dense 0.56 / 0.60 as the bar
[[ / @ link picker 0.40 / 0.42, painted on the tooltip itself as the bar dense 0.56 / 0.60, drawn behind the list as the bar
Tag picker 0.40 / 0.42 as the bar dense 0.56 / 0.60 as the bar
Card and gallery toolbars not in the app yet (mockup only) use <Glass /> when they land
Primitives harness its own copies of the old values reads tokens.css
Every surface, reduced transparency 0.97 0.97 (unchanged)

Unchanged on every surface: the hairline edge (--glass-float-edge) and the lift (--shadow-float). New on every surface: --glass-float-shade, inset 0 0 22px of the tint at 34% (light rgb(253 250 245 / 0.34), dark rgb(24 21 18 / 0.34)), and the on-glass inks (--glass-ink-2/3/4) for the words and icons on the glass.

Not floating, so not changed: the places and list panes and the Settings card (--glass, --glass-pane), the phone's top band (.glassy), the page's own blur, the sign-in card, and the warm tooltips (solid on purpose).

Perf (the #327 harness's scroll fling in the 50,000-word note, Chromium with the CPU slowed 4x, 10k Home, three interleaved dev/branch rounds; the host ran at load 25 to 35). Off-main CPU is the compositor thread (VizCompositorThread), where a backdrop blur is paid in this software-GL box. Medians of the three rounds:

look frames p50 / p95, dev → branch main-thread CPU, dev → branch compositor CPU, dev → branch
default sky 16.7 / 200 ms → 16.7 / 333 ms 6.5 s → 8.0 s 17.1 s → 17.7 s
photo, dark 16.7 / 200 ms → 16.7 / 167 ms 6.6 s → 6.5 s 8.3 s → 8.3 s
photo, Insert sheet open 67 / 250 ms → 67 / 167 ms 7.9 s → 6.7 s 14.3 s → 12.4 s

Round to round the same build varies more than dev differs from the branch (default main CPU: 6.5, 6.5 and 7.5 s on dev; 6.5, 8.0 and 8.5 s on the branch), so the only reading is: no regression. A big glass over a moving page (the sheet) costs the compositor about 13% less, from the blur going from 44 to 20 px. Nothing new repaints on scroll: the glass is still one childless layer, and only its tint differs between modes. The #327 baseline (glass on: 66.6 / 150 ms, main thread 3.7 s) was a different, quieter run, so compare within these rounds. The branch rounds ran on its first build. The later changes (the sheets' dense step and the on-glass inks) change only colours, not blur or layers.

Tests (this host, --workers 1):

  • chromium-390: 453 passed.
  • chromium-1440: 23 passed (the phone specs skip at 1440).
  • webkit-390: 449 passed, 3 failed, all pre-existing:
    • bar-focus.spec:42 (390 and 430) times out at 30 s on dev too: 2 of 2 failed on dev, 2 of 2 on this branch.
    • phone-bars.spec:106 fails on a different look each run, on dev as well (3 on dev, 2 on the branch, never the same one).
  • The new glass.spec test, "every floating surface is the one glass", passes on all three projects. It checks that the bar, search, menus and the link picker share one blur, shade, edge and shadow; that the tints are base or dense as designed; that each glass holds nothing; and that a menu opening and closing never cuts its glass off on any frame.
  • Primitives: 96 passed (Chromium and WebKit). svelte-check: 0 errors. Editor tsc: clean.

Screenshots (before above, after below, over Mountains and the bright canal photo, 320 / 390 / 900 / 1440, light and dark, Chromium) are on #319.

🤖 Generated with Claude Code

https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T

Closes #319. One translucent material, `float-glass`, for every floating surface: a class and a `<Glass />` component in `@calternal/ui` (styles/glass.css, components/Glass.svelte), with its values in tokens.css. Every surface draws it, and their own copies of the values are gone. **The material:** the search mockup's lighter glass (#330): tint 0.30 light / 0.36 dark, blur 20 px, saturation 180 / 170%. Readability comes from three things, never from going solid: - a soft inner shade (new `--glass-float-shade`), which fills a pill almost to its middle but leaves a big panel's middle clear; - the on-glass inks (`--glass-ink-2/3/4`, the ones the panes already use) for the words and icons on the glass; - one denser step (0.56 / 0.60) where lines of words sit on the glass: menus, the link and tag pickers, and the bar's sheets. **Surfaces:** the bar in every mode (tab bar, note tools, formatting bar, block bar, Turn into / Style, sheets, toasts), search (the palette), context menus, the `[[` / `@` link picker (it was the bar's tint painted on the tooltip itself; now it's the dense glass drawn behind its list), the tag picker, and the toast capsule (its hard-coded fallbacks are gone). The primitives harness reads tokens.css instead of keeping copies. Card and gallery toolbars aren't in the app yet; they use `<Glass />` when they land. **#287 kept:** the glass never holds the contents. Morph's glass and clip still carry `data-morph-until`. The tabs' glass stays frosted. Menus and the tag picker used to fade and blur *themselves* while opening and closing, and with the glass as a child that would cut it off from the page. Now they only scale (springy, in place), and the glass and the rows fade each on their own. From the keyboard, nothing animates. | Floating element | Before: tint light / dark | Before: filter | After: tint light / dark | After: filter, shade | |---|---|---|---|---| | Tab bar, note tools, formatting bar, block format bar (the bottom bar's rows) | `--glass-float` 0.40 / 0.42 | blur 44px, saturate 200 / 190%, brightness 1.04 / 0.92 | `--glass-float` **0.30 / 0.36** | blur **20px**, saturate **180 / 170%**, brightness 1.04 / **0.90**; new inner shade | | Block customization (Turn into → Style) and the bar's sheets (Style, Insert, Info, Move, Link) | 0.40 / 0.42 (the bar's) | as the bar | **dense 0.56 / 0.60** (eases in with the morph) | as the bar | | Toasts (in the bar) | 0.40 / 0.42 | as the bar | 0.30 / 0.36 | as the bar | | Toast capsule (outside the bar) | tokens, with hard-coded fallbacks (0.72, blur 30px, saturate 180%) | | 0.30 / 0.36, **no fallbacks** | as the bar | | Search (the palette) | 0.40 / 0.42 | as the bar | **0.30 / 0.36** | as the bar | | Context menus and submenus | `--glass-float-dense` 0.76 / 0.78 | as the bar | **dense 0.56 / 0.60** | as the bar | | `[[` / `@` link picker | 0.40 / 0.42, painted on the tooltip itself | as the bar | **dense 0.56 / 0.60**, drawn behind the list | as the bar | | Tag picker | 0.40 / 0.42 | as the bar | **dense 0.56 / 0.60** | as the bar | | Card and gallery toolbars | not in the app yet (mockup only) | | use `<Glass />` when they land | | | Primitives harness | its own copies of the old values | | reads tokens.css | | | Every surface, reduced transparency | 0.97 | | 0.97 (unchanged) | | Unchanged on every surface: the hairline edge (`--glass-float-edge`) and the lift (`--shadow-float`). New on every surface: `--glass-float-shade`, `inset 0 0 22px` of the tint at 34% (light `rgb(253 250 245 / 0.34)`, dark `rgb(24 21 18 / 0.34)`), and the on-glass inks (`--glass-ink-2/3/4`) for the words and icons on the glass. Not floating, so not changed: the places and list panes and the Settings card (`--glass`, `--glass-pane`), the phone's top band (`.glassy`), the page's own blur, the sign-in card, and the warm tooltips (solid on purpose). **Perf** (the #327 harness's scroll fling in the 50,000-word note, Chromium with the CPU slowed 4x, 10k Home, three interleaved dev/branch rounds; the host ran at load 25 to 35). Off-main CPU is the compositor thread (VizCompositorThread), where a backdrop blur is paid in this software-GL box. Medians of the three rounds: | look | frames p50 / p95, dev → branch | main-thread CPU, dev → branch | compositor CPU, dev → branch | |---|---|---|---| | default sky | 16.7 / 200 ms → 16.7 / 333 ms | 6.5 s → 8.0 s | 17.1 s → 17.7 s | | photo, dark | 16.7 / 200 ms → 16.7 / 167 ms | 6.6 s → 6.5 s | 8.3 s → 8.3 s | | photo, Insert sheet open | 67 / 250 ms → 67 / 167 ms | 7.9 s → 6.7 s | 14.3 s → 12.4 s | Round to round the same build varies more than dev differs from the branch (default main CPU: 6.5, 6.5 and 7.5 s on dev; 6.5, 8.0 and 8.5 s on the branch), so the only reading is: no regression. A big glass over a moving page (the sheet) costs the compositor about 13% less, from the blur going from 44 to 20 px. Nothing new repaints on scroll: the glass is still one childless layer, and only its tint differs between modes. The #327 baseline (glass on: 66.6 / 150 ms, main thread 3.7 s) was a different, quieter run, so compare within these rounds. The branch rounds ran on its first build. The later changes (the sheets' dense step and the on-glass inks) change only colours, not blur or layers. **Tests** (this host, `--workers 1`): - chromium-390: 453 passed. - chromium-1440: 23 passed (the phone specs skip at 1440). - webkit-390: 449 passed, 3 failed, all pre-existing: - `bar-focus.spec:42` (390 and 430) times out at 30 s on dev too: 2 of 2 failed on dev, 2 of 2 on this branch. - `phone-bars.spec:106` fails on a different look each run, on dev as well (3 on dev, 2 on the branch, never the same one). - The new `glass.spec` test, "every floating surface is the one glass", passes on all three projects. It checks that the bar, search, menus and the link picker share one blur, shade, edge and shadow; that the tints are base or dense as designed; that each glass holds nothing; and that a menu opening and closing never cuts its glass off on any frame. - Primitives: 96 passed (Chromium and WebKit). svelte-check: 0 errors. Editor tsc: clean. Screenshots (before above, after below, over Mountains and the bright canal photo, 320 / 390 / 900 / 1440, light and dark, Chromium) are on #319. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
One floating glass: a shared Glass and its tokens for every floating surface (#319)
Some checks failed
CI / server (pull_request) Successful in 1m11s
CI / rust (pull_request) Successful in 3m7s
CI / web (pull_request) Failing after 58m57s
cea0a4e46a
- packages/ui: styles/glass.css (the `float-glass` class, its dense step and
  the `float-glass-behind` form for elements made elsewhere) and
  components/Glass.svelte (a childless layer). tokens.css loads glass.css.
- Tokens: the lighter material from the search mockup (#330): tint 0.30 light /
  0.36 dark, blur(20px) saturate 180/170% brightness 1.04/0.90, plus a new soft
  inner shade (--glass-float-shade). One denser step, 0.56 / 0.60, for lines of
  words: menus, the link and tag pickers and the bar's sheets.
- Words and icons on the glass use the on-glass inks, so quiet labels and icons
  read over dark and bright patches of a photo.
- The bar (all its modes, its sheets, toasts), search, context menus, the `[[` /
  `@` link picker, the tag picker and the toast capsule all draw it; their own
  copies of the values are gone, and so are the toast's hard-coded fallbacks
  and the primitives harness's copies.
- Menus and the tag picker no longer fade or blur themselves while opening or
  closing (that cut their glass off from the page): they scale, and the glass
  and the rows fade each on their own (#287).
- glass.spec: every floating surface is the same material, with the dense tint
  only on menus and the picker, the glass holds nothing, and a menu never cuts
  its glass off on any frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Author
Owner

Landed in dev via train o.

Landed in dev via train o.
kayg closed this pull request 2026-10-15 22:39:21 +00:00
Some checks failed
CI / server (pull_request) Successful in 1m11s
CI / rust (pull_request) Successful in 3m7s
CI / web (pull_request) Failing after 58m57s

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!446
No description provided.