Files
pipelines/app/notes/design-glass.md
T
2026-12-04 01:17:19 +00:00

6.9 KiB

Glass design

Translucent frosted panes over a soft, still gradient (Settings > Design > Glass): the opposite of Terminal. A pale lavender/peach/sky/mint mesh by day, a deep indigo/plum/teal/night-blue one by night; panes are tints over it, floating pieces are rounded glass cards with a light top edge and soft layered shadows, and the open list row is a bright slab with a glow in its chat colour. The interface sans throughout, titles and labels semibold.

Tokens

One new token, AppDesignTokens.glass (GlassStyle?, null for every other design, so nothing else changes), plus one new row style:

  • glass.backdrop (GlassBackdropMesh: a base and four GlassGlows): the still gradient GlassBackdrop paints behind every page from the three MaterialApp.builders. Its own RepaintBoundary; under other designs it paints nothing and keeps the same tree shape, so a live switch never remounts the app.
  • glass.rail, glass.pane, glass.detail: the tints of the navigation rail, a list pane and the open item's reading pane (ListDetailPanes). Glass bakes the list's veil into the mesh colours (rail and pane are clear: no full-window blend per frame) and tints only the reading pane.
  • The mesh is drawn once into a 96px image per window shape (GlassMeshPainter.meshImage) and stretched with low filtering: one image draw per frame. Four full-window radial gradients per frame cost about twice Default's raster time on the CPU path and stalled the fixture.
  • glass.bar: the frosted fill of GlassPill (bars, composer, floating pieces) over its blur; glass.solid the opaque stand-in (high contrast, floating windows, find bars, the terminal, phone stack discs, the container transform's page) through AppDesignTokens.solidFill.
  • glass.card, glass.highlight, glass.edge, glass.shadow: inset glass cards (tool chip, follow-up notes) and the GlassBorder edge: a 1px line that is highlight at the top and falls off into edge within the top corners.
  • glass.slab, glass.glow: the open row's slab and the alpha of its glow ring (SelectedRowStyle.glow, AppListRowGlow).
  • glass.cornerScale (1.5) / cornerCap (20): tokens.corners() and tokens.shape() grow every widget's own radius by the same factor up to the cap (8 -> 12, 12 -> 18, 16 -> 20, 28 stays), so the outer > inner hierarchy holds; stadiums and circles stay.
  • SelectedRowStyle.glow: the row is a slab inset 8px from the pane's sides and 2px from its neighbours, 14px corners; a coloured row is its faint tint with a short rounded mark; the open row is slab washed 8% with the accent, a 1px ring at 55% and a 16px glow at glass.glow.

Glass also sets snapSwitch (main's token): a live switch into or out of Glass snaps instead of blending clear pages with an opaque design's (the blend stalled skwasm in the browser bench).

Glass keeps transcript: bubbles, composer: pill, radius: null (each widget keeps its own shape, grown), flat: false, and sets ANSI accents and a roomier reading line (ReadingType(height: 1.55)).

Colour scheme

glass_palette.dart: the page roles (surface, inverseSurface) are opaque, because widgets blend with them; the container roles (surfaceContainer*, secondaryContainer, outlineVariant) are translucent, so a settings group, a code block, a bubble or a chip is a pane of glass over the backdrop instead of a grey block. Scaffolds are clear. test/ui/theme/glass_design_test.dart checks body text >= 7:1, muted text and the accent >= 4.5:1 on every pane over the base and each glow at full strength, in light and dark.

Surfaces themed

  • Backdrop behind every page, the rail, list and reading panes.
  • Bars, composer and floating pieces: GlassPill with the glass bar tint (the only blur: sigma GlassPill.blurSigma, one grouped filter per piece, as Classic already has). Panes, rows, bubbles, cards and the transcript never blur.
  • Dialogs (20px), sheets (20px top), menus and popup menus (16px, 6px inner padding, 10px item corners), cards (16px, each variant keeps its fill), tooltips (10px, inverse glass), snack bars (floating, 14px), the FAB, chips (pill, glass edge), search bar, fields (14px), segmented buttons, tab slab, sliders, badges, progress: glass_theme.dart, glass_controls.dart.
  • Chat: operator bubbles are frosted pills (translucent container tinted with the chat colour, glass edge); agent text on the pane; code blocks are inset glass cards (12px, glass edge); the tool-activity chip is a slim glass card; follow-up and auto-continue notes are small glass cards; the chat header is clear so the pane runs to the top.
  • The open list row (AppListRowGlow).
  • Floating windows: opaque glass card, corners 18px (frame, outline and page clip agree), outline a GlassBorder catching light along the title bar.
  • Phone chat stack discs and labels stay opaque (solidFill); the usage ring follows the circular Send button (radius is null).

Still default

  • Graph nodes keep Card.filled / Card.outlined (now with the glass edge and 16px corners from the card theme); the edge hover card is the inverse surface in grown corners.
  • Graph nodes in dark read as near-black cards (Card.outlined keeps the opaque surface).
  • The phone chat page keeps the workspace's opaque surface behind its panes (it backs the chat swipe motion).
  • Sticky section headings and the run detail's Input/Output strips paint the opaque surface (they hide what scrolls under them).
  • Native desktop page slides (Linux, Windows, macOS/iOS Cupertino) show the page below through a clear page during the 200 ms slide; web and Android use the zoom transition.

Perf

Widget budget (test/perf/design_bench_test.dart): passes. Glass: scrollRebuildsPerRow 93.1 (Default 83.5), scrollLayersPerFrame 11.0 (11.2), scrollSaveLayersPerFrame 7.3 (7.4), switchFramesPerSwitch 4.5 (4.5), no unrelated theme rebuilds; layers {opacity 438, clipRect 60, clipPath 163} vs Default {443, 60, 167}.

Browser (design_bench.mjs --designs glass, skwasm, 3 repeats, medians; mean build / raster ms per frame, Glass vs Default):

scenario CPU (no --gpu) GPU (--gpu)
scroll 8.94 / 39.86 vs 8.69 / 35.84 1.82 / 2.50 vs 1.94 / 2.58
switch 8.91 / 42.51 vs 8.49 / 34.95 2.27 / 3.49 vs 1.74 / 2.57
runs 1.43 / 9.39 vs 1.49 / 7.63 1.70 / 1.53 vs 1.77 / 1.52
graph 2.06 / 19.14 vs 2.31 / 15.79 1.14 / 2.15 vs 1.14 / 2.22
design 6.78 / 20.35 vs 14.57 / 24.40 3.91 / 2.09 vs 10.36 / 7.72

Both PASS; heap growth over 120 live switches 0.43 MB (Default 0.63); no off-origin request beyond Default's own (Roboto, Noto Sans Symbols).

Captures

/tmp/glass-review/final-{light,dark}-{1440,560}/ (01 chat with tool chip, bubbles, code card and the composer's usage ring, 02 activity dialog, 03 follow-up notes, 04 runs, 05 run 7, 06 run graph, 07 pipelines, 08 settings, 09 the design picker), recipe /tmp/glass-review/cap.sh.