Glass design: frosted panes over a soft gradient (WIP)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 23:21:05 +00:00
parent 9436067bf2
commit 8ca3d3e467
37 changed files with 1901 additions and 67 deletions
+97
View File
@@ -0,0 +1,97 @@
# 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 `GlassGlow`s): the
still gradient `GlassBackdrop` paints behind every page from the three
`MaterialApp.builder`s. 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`),
strongest on the reading pane.
- `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 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.
- 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
PERF_PLACEHOLDER
## Captures
CAPTURES_PLACEHOLDER