Unify UI primitives in production (audit + plan) #912

Open
opened 2026-11-04 08:01:56 +00:00 by kayg · 1 comment
Owner

Request (kayg 11-04): "look for other areas like that, especially in production, and fix all of them by unifying, so the code is modular, extensible and reusable."

Basis: origin/dev @ 41f2efa3 (apps/web, packages/ui, packages/editor; 92 Svelte files in web), compared with the mockup on review/calendar-2 @ cfbca1cf (282 Svelte files). Counts are from grep on the style blocks and markup; no code was built or run (control host). Byte savings below are estimates, not measurements.

Overlap found (build on these, do not redo): #892 (cross-app audit, mockup side), #911 (mockup type + spacing scale), #693 (port colours/corners, Q3), PR #875 (port rows + shared press engine, open), the mockup's no-handmade-pills.mjs guard (mockup only). This issue is the production half: dev has no Pill, Toolbar or PageToolbar yet (they exist only in the mockup branch), so step 0 is porting them.

Summary

# Primitive Copies in prod Drift Shared thing PR order
0 Pill / Toolbar / PageToolbar 0 in dev; ~13 hand-rolled round buttons (see 1) n/a port Pill, Toolbar from mockup into packages/ui 1
1 Press feedback (scale on :active) 38 scale: rules: 26 in 20 files are :active presses (+ 4 enter/exit anims, 8 in cm/editor handles/ticks) 0.9 ×6, 0.92 ×3, 0.94 ×2, 0.96 ×10, 0.97 ×8, 0.98 ×1 (mockup: 0.9 ×30, 0.97 ×21 — also drifted) .press (base.css, 72 uses) bypassed; add --press-scale: .97 token + .press variants 2
2 Icon / round buttons ≥13 hand-built (.round, .back, .close, .act, .btn, .ra-act…) sizes 28/30/32/34/44/56; radii 50%, 8, 9, 10, 14 Pill (round), .ib (28px square, 30 uses) 3
3 Selection / hover / focus tints and radii 35 files use var(--hover)/--press; 70+10 uses; radii: 9px ×20, 10px ×20, 12px ×12, 11px ×4, 8px ×10 for the same "row/tint/field" job 4–5 near-equal values; tokens --r-control 7 / tile 9 / card 10 unused by most --r-select (mockup: 12 = frame − 10, 155 uses) + --r-card 14; port #693 tokens 4
4 Rows (list / settings / prop) .row/.line in 10 files (NoteList, TrashList, Settings, Sidebar, InstallHint, InviteSheet, KindLine, TopPills, BackdropGrid, bar/Sheet) padding 6/8/10/12/14, hover tint differs PropRow (1 user in prod), mockup ListRow/SettingRow/ListGroup → packages/ui 5
5 Text fields / filters 13 <input> rule sets: CommandBar, PropRow ×2, TagPicker, BackdropPicker, SignIn, NotePicker, InsertSheet, ListSearch, ComposerBody ×2, ListDock, InlineRename, ListFilter height/radius/padding differ per file ListFilter (2 users) + a Field 6
6 Toggles / switches Toggle (squish switch) has 0 imports in web; hand-rolled: Settings.svelte:745 .toggle, Inspector.svelte:215 .sw, ColorPicker .sw 3 looks Toggle/SquishSwitch 7
7 Segmented control Selector used 3×; .seg rules in chrome.css (2 users) 2 looks Selector 8
8 Headings / type sizes 27 heading rules; 32× 13*type-px, 32× 12.5*, 16× 13.5*, 11× each 11.5/15/16, 7× 14*, + 13 raw px next to the 7 --text-* tokens (used ~50×) ~12 one-off sizes in half-pixel steps --text-* scale from #911 + .h-* classes 9
9 Spacing gap 8/10/6/2/4/12/16/3/7/5/14 px; row padding 12 kinds 11 gap values --space-* tokens from #911 10
10 Glass / blur / backdrop <Glass> ×27 (good); but backdrop-filter hand-written in 13 files: blur 2/5/9/18/20/24px, --glass-blur, --page-blur, --glass-float-filter 6 literal blurs .glass (base.css), Glass, tokens --glass-blur/sat 11
11 Motion (durations, easings) durations 120 ×20, 160 ×15, 150 ×13, 380 ×7, 240, 200, 220, 140, 260, 90, 70, 60, 420, 450, 100, 180 ms; easings: var(--ease-out) 117, bare ease 57, bare ease-out 52, 12 literal cubic-béziers 17 durations, 3 spellings of ease-out --dur-fast/med/slow, --ease-out/-in-out/-drawer/-spring tokens 12
12 Sheets / popovers / menus ContextMenu ×1; KindLine own role=menu; 7 dialog/sheet shells (Palette, Morph, SheetBody, ListSearch, LinkCard, InviteSheet, TagPicker) each its own radius/shadow SheetBody (1 user) + share-sheet parts + Float 13
13 Empty states EmptyState 5 users; hand-made in NoteList ×5, TrashList ×3, TagPicker, NotePicker, InsertSheet, ListSearch, InviteSheet, AdminInvites text, spacing, icon differ EmptyState 14
14 Toasts toast() primitive (used 2×), hand-rolled none found clean keep; guard only —
15 Icon sizes <Icon> ×106 (good); --glyph token; only 2 inline <svg> (Backdrop) low Icon guard only

Details

1. Press feedback (the original bug)

:active { scale } rules in prod (file:line): Inspector:224 (.9), TrashList:291 (.96), BackdropGrid:170 (.97), LinkCard:290 (.97), CopyLink:70 (.97), SignIn:275 (.96) / :298 (.98) / :335 (.97), Settings:711 (.92), TrashPreview:152 (.97), TopPills:351 (.97) :393/:399/:447/:459 (.9) :532 (.92), editor.css:183 (.92), cm.css:309 (.86) :708 (.96), BulkBar:138 (.97), RowActions:237 (.94), ColorPicker:78 (.9), EmptyState:74 (.96), chrome.css:15/97/149 (.94/.96/.96), base.css:219 (.97, the shared .press), ToastRow:140, Selector:345, Morph:220 (.96).
Already shared and bypassed: .press in packages/ui/src/styles/base.css:213 (72 uses) and .ib in chrome.css (30 uses) — both carry their own number, neither reads a token. In the mockup --press-scale: 0.97 exists (tokens.css:299, 16 uses) but 65 rules still hard-code 0.9–0.985.
Target: --press-scale token (+ --press-scale-small: .9 for ≤24 px glyphs, if kayg wants the two-level rule; decide in the PR: default one value .97, small ticks keep their own documented value). All :active scale rules go through .press (or Pill, which has it). prefers-reduced-motion handled once.

2. Round / icon buttons

Hand-built round buttons: TrashPreview:138 (44 px, 50%), InviteSheet:230 (.back 44), AppCard:93 (30), TopPills:353/366/408 (.round/.back 44), ListDock:101, PullHint:59, ListSearch:371; rect buttons: Settings:852 and PasskeySection:234 (.btn, 34 px / 10 radius), InfoSheet:453 (.act, 32 / 9), BulkBar:106 (56 × 14), RowActions:188 (56 × 14), NoteList:443 (.pick-act, 999). Sizes 28–56, 5 radii.
Target: Pill (round, incl. alone glass form) for floating/bar buttons; .ib for in-row tool buttons; Button (new, thin: variant=solid|quiet|danger, size) for the text buttons in Settings/PasskeySection/InfoSheet/InviteSheet (they share one look today by copy). BulkBar/RowActions action tiles become one ActionTile.

3. Tints and radii

Prod radii: 999px ×36, 50% ×36, 9px ×20, 10px ×20, 12px ×12, 14px ×11, 8px ×10, 5px ×8, 3px ×8, 18px ×5, 16px ×5, 11px ×4, plus 8 token forms. Prod tokens (tokens.css:122): --r-control 7, --r-tile 9, --r-card 10, --r-sheet 18, --r-frame 20 — different numbers from the approved mockup (--r-card 14, --r-frame 22, --r-select = frame − 10 = 12). The mockup sweep (comment on #892, 6 commits) already made the mockup 153× --r-select. Port = #693 (token values) and then replace raw 8/9/10/11/12 px with --r-select, raw 14/16/18 with --r-card/--r-sheet.
Rule for the guard: a selection/hover tint's radius is calc(container radius − inset); --r-select is the default; anything else needs a comment /* radius: why */.

4–5. Rows and fields

Rows: NoteList:468, TrashList:223, Settings:460, Sidebar:437, InstallHint:122, InviteSheet:268, KindLine:78, TopPills:508, BackdropGrid:129, bar/Sheet:54. PropRow (apps/web/src/components/PropRow.svelte) is imported by 1 file. Mockup has ListRow, ListGroup, SettingRow, PropRow — port the first three to packages/ui (rows get radius --r-select, hover --hover, press via .press).
Fields: 13 input rule sets listed in the table; ListFilter and InlineRename in packages/ui already do most of it.

6–7. Toggle, Selector

Toggle (packages/ui/controls) wraps SquishSwitch but nothing in web imports it; Settings and Inspector draw their own. Selector (3 users) vs .seg in chrome.css (2 users); the mockup has MiniBar still waiting to become a Selector.

8–9. Type and spacing

Prod defines --text-title/subtitle/heading/body/ui/label/section (tokens.css:93–99) but 150+ declarations use calc(N*var(--type-px)) with N ∈ {10.5, 11, 11.5, 12, 12.5, 13, 13.5, 14, 15, 16, 17, 18, 21, 28, 34}. #911 designs the new scale in the mockup; prod port should follow #911 once approved, not invent another.

10–13. Glass, motion, sheets, empty states

see table. Motion tokens (--ease-out, --ease-in-out, --ease-drawer) exist; 109 bare ease/ease-out and 12 literal béziers bypass them. No duration tokens exist at all.

Plan: one PR per row, into dev

Order = most-copied and most-visible first. Every PR has the same four parts:

  1. Guard ci/check-ui-primitives.mjs (node, no deps; runs in bun run lint and the web CI job, no continue-on-error). It extends the mockup's no-handmade-pills.mjs idea with one rule per row: no scale: in :active outside .press/Pill; no border-radius: 8|9|10|11|12px outside tokens; no font-size: calc(N*var(--type-px)) outside tokens.css; no backdrop-filter outside glass.css; no bare ease/ease-out; no <input rule sets outside Field; a LEFT_ALONE map with a reason per allowed place (as in the mockup guard). Count may only go down.
  2. Pixel diff before/after on the affected screens (Playwright screenshots, Chromium + WebKit, light/dark, 1440 and 390 px) posted in the PR; expected diff is zero except where the mockup value deliberately wins (radius, press).
  3. Perf gate (kayg 11-03: no regressions): first-paint JS/CSS gz bytes (apps/web/scripts/bundle-size.mjs) must be ≤ dev; typing latency and rAF frame deltas flat on the Mac VM for any PR touching bar/pills/editor chrome. Report all deltas.
  4. Docs: the component's header comment is its doc; TASTE.md line if a rule changed.
PR Content Expected bytes (estimate, gz)
1 Port Pill + Toolbar + PageToolbar from review/calendar-2; move TopPills, PhoneFoot, ListDock, BulkBar, TrashPreview onto them ±0 (new code ≈ +1 KB, removed copies ≈ −1 KB)
2 --press-scale, all 26 :active presses via .press/Pill; guard −0.4 KB CSS
3 Button/ActionTile; .ib as the in-row icon button −1 KB CSS
4 #693 tokens + radius sweep (--r-select, --r-card) −0.5 KB CSS
5 ListRow/ListGroup/SettingRow; PropRow everywhere −2 KB CSS+JS
6 Field + ListFilter −1 KB CSS
7–8 Toggle, Selector adoption −0.5 KB
9–10 Type + spacing tokens after #911 approval −1.5 KB CSS (shorter declarations)
11–13 glass, motion tokens, sheet shells, EmptyState −1.5 KB

Total expected: about −8 KB gz across CSS/JS, no first-paint growth (PR 1's new code loads with the chrome that already ships). These are guesses from rule counts; each PR reports the real number from bundle-size.mjs.

Decisions I made (flagging for review)

  • Prod gets the mockup's shared components, not new ones (reuse rule); Pill/Toolbar port is PR 1 because 8 other PRs depend on it.
  • The guard allow-list approach (counted, with a reason) is copied from the mockup guard so prod and mockup rules stay identical.
  • The press value: default 0.97 everywhere. 0.9 is used 6× in prod and 30× in the mockup for small round things (switches, tick boxes); I kept an optional --press-scale-small for those pending kayg's call.

Open risks

  • #875 (open) also changes press/menus in packages/ui; PR 2 must land after it or rebase on it.
  • #911 type scale is not approved yet; PR 9–10 wait for it.
  • Tasks/Contacts/Calendar UI PRs (#832, #888, #889, #893, #842) add more hand-made pieces now; the guard (PR 2) should merge early so they fix on rebase.
Request (kayg 11-04): "look for other areas like that, especially in production, and fix all of them by unifying, so the code is modular, extensible and reusable." **Basis:** `origin/dev` @ `41f2efa3` (apps/web, packages/ui, packages/editor; 92 Svelte files in web), compared with the mockup on `review/calendar-2` @ `cfbca1cf` (282 Svelte files). Counts are from `grep` on the style blocks and markup; no code was built or run (control host). Byte savings below are estimates, not measurements. **Overlap found (build on these, do not redo):** #892 (cross-app audit, mockup side), #911 (mockup type + spacing scale), #693 (port colours/corners, Q3), PR #875 (port rows + shared press engine, open), the mockup's `no-handmade-pills.mjs` guard (mockup only). This issue is the *production* half: dev has no `Pill`, `Toolbar` or `PageToolbar` yet (they exist only in the mockup branch), so step 0 is porting them. ## Summary | # | Primitive | Copies in prod | Drift | Shared thing | PR order | |---|---|---|---|---|---| | 0 | Pill / Toolbar / PageToolbar | 0 in dev; ~13 hand-rolled round buttons (see 1) | n/a | port `Pill`, `Toolbar` from mockup into `packages/ui` | 1 | | 1 | Press feedback (`scale` on `:active`) | **38 `scale:` rules**: 26 in 20 files are `:active` presses (+ 4 enter/exit anims, 8 in cm/editor handles/ticks) | 0.9 ×6, 0.92 ×3, 0.94 ×2, 0.96 ×10, 0.97 ×8, 0.98 ×1 (mockup: 0.9 ×30, 0.97 ×21 — also drifted) | `.press` (base.css, 72 uses) bypassed; add `--press-scale: .97` token + `.press` variants | 2 | | 2 | Icon / round buttons | ≥13 hand-built (`.round`, `.back`, `.close`, `.act`, `.btn`, `.ra-act`…) | sizes 28/30/32/34/44/56; radii 50%, 8, 9, 10, 14 | `Pill` (round), `.ib` (28px square, 30 uses) | 3 | | 3 | Selection / hover / focus tints and radii | 35 files use `var(--hover)`/`--press`; 70+10 uses; radii: 9px ×20, 10px ×20, 12px ×12, 11px ×4, 8px ×10 for the same "row/tint/field" job | 4–5 near-equal values; tokens `--r-control 7 / tile 9 / card 10` unused by most | `--r-select` (mockup: 12 = frame − 10, 155 uses) + `--r-card 14`; port #693 tokens | 4 | | 4 | Rows (list / settings / prop) | `.row`/`.line` in 10 files (NoteList, TrashList, Settings, Sidebar, InstallHint, InviteSheet, KindLine, TopPills, BackdropGrid, bar/Sheet) | padding 6/8/10/12/14, hover tint differs | `PropRow` (1 user in prod), mockup `ListRow`/`SettingRow`/`ListGroup` → `packages/ui` | 5 | | 5 | Text fields / filters | 13 `<input>` rule sets: CommandBar, PropRow ×2, TagPicker, BackdropPicker, SignIn, NotePicker, InsertSheet, ListSearch, ComposerBody ×2, ListDock, InlineRename, ListFilter | height/radius/padding differ per file | `ListFilter` (2 users) + a `Field` | 6 | | 6 | Toggles / switches | `Toggle` (squish switch) has **0 imports in web**; hand-rolled: Settings.svelte:745 `.toggle`, Inspector.svelte:215 `.sw`, ColorPicker `.sw` | 3 looks | `Toggle`/`SquishSwitch` | 7 | | 7 | Segmented control | `Selector` used 3×; `.seg` rules in chrome.css (2 users) | 2 looks | `Selector` | 8 | | 8 | Headings / type sizes | 27 heading rules; **32× `13*type-px`, 32× `12.5*`, 16× `13.5*`, 11× each 11.5/15/16, 7× `14*`, + 13 raw px** next to the 7 `--text-*` tokens (used ~50×) | ~12 one-off sizes in half-pixel steps | `--text-*` scale from #911 + `.h-*` classes | 9 | | 9 | Spacing | `gap` 8/10/6/2/4/12/16/3/7/5/14 px; row `padding` 12 kinds | 11 gap values | `--space-*` tokens from #911 | 10 | | 10 | Glass / blur / backdrop | `<Glass>` ×27 (good); but `backdrop-filter` hand-written in 13 files: blur 2/5/9/18/20/24px, `--glass-blur`, `--page-blur`, `--glass-float-filter` | 6 literal blurs | `.glass` (base.css), `Glass`, tokens `--glass-blur/sat` | 11 | | 11 | Motion (durations, easings) | durations 120 ×20, 160 ×15, 150 ×13, 380 ×7, 240, 200, 220, 140, 260, 90, 70, 60, 420, 450, 100, 180 ms; easings: `var(--ease-out)` 117, bare `ease` 57, bare `ease-out` 52, 12 literal cubic-béziers | 17 durations, 3 spellings of ease-out | `--dur-fast/med/slow`, `--ease-out/-in-out/-drawer/-spring` tokens | 12 | | 12 | Sheets / popovers / menus | `ContextMenu` ×1; `KindLine` own `role=menu`; 7 dialog/sheet shells (Palette, Morph, SheetBody, ListSearch, LinkCard, InviteSheet, TagPicker) | each its own radius/shadow | `SheetBody` (1 user) + share-sheet parts + `Float` | 13 | | 13 | Empty states | `EmptyState` 5 users; hand-made in NoteList ×5, TrashList ×3, TagPicker, NotePicker, InsertSheet, ListSearch, InviteSheet, AdminInvites | text, spacing, icon differ | `EmptyState` | 14 | | 14 | Toasts | `toast()` primitive (used 2×), hand-rolled none found | clean | keep; guard only | — | | 15 | Icon sizes | `<Icon>` ×106 (good); `--glyph` token; only 2 inline `<svg>` (Backdrop) | low | `Icon` | guard only | ## Details ### 1. Press feedback (the original bug) `:active { scale }` rules in prod (file:line): Inspector:224 (.9), TrashList:291 (.96), BackdropGrid:170 (.97), LinkCard:290 (.97), CopyLink:70 (.97), SignIn:275 (.96) / :298 (.98) / :335 (.97), Settings:711 (.92), TrashPreview:152 (.97), TopPills:351 (.97) :393/:399/:447/:459 (.9) :532 (.92), editor.css:183 (.92), cm.css:309 (.86) :708 (.96), BulkBar:138 (.97), RowActions:237 (.94), ColorPicker:78 (.9), EmptyState:74 (.96), chrome.css:15/97/149 (.94/.96/.96), base.css:219 (.97, the shared `.press`), ToastRow:140, Selector:345, Morph:220 (.96). Already shared and bypassed: `.press` in `packages/ui/src/styles/base.css:213` (72 uses) and `.ib` in `chrome.css` (30 uses) — both carry their own number, neither reads a token. In the mockup `--press-scale: 0.97` exists (tokens.css:299, 16 uses) but 65 rules still hard-code 0.9–0.985. **Target:** `--press-scale` token (+ `--press-scale-small: .9` for ≤24 px glyphs, if kayg wants the two-level rule; decide in the PR: default **one value .97**, small ticks keep their own documented value). All `:active` scale rules go through `.press` (or `Pill`, which has it). `prefers-reduced-motion` handled once. ### 2. Round / icon buttons Hand-built round buttons: TrashPreview:138 (44 px, 50%), InviteSheet:230 (.back 44), AppCard:93 (30), TopPills:353/366/408 (.round/.back 44), ListDock:101, PullHint:59, ListSearch:371; rect buttons: Settings:852 and PasskeySection:234 (.btn, 34 px / 10 radius), InfoSheet:453 (.act, 32 / 9), BulkBar:106 (56 × 14), RowActions:188 (56 × 14), NoteList:443 (.pick-act, 999). Sizes 28–56, 5 radii. **Target:** `Pill` (round, incl. `alone` glass form) for floating/bar buttons; `.ib` for in-row tool buttons; `Button` (new, thin: `variant=solid|quiet|danger`, `size`) for the text buttons in Settings/PasskeySection/InfoSheet/InviteSheet (they share one look today by copy). BulkBar/RowActions action tiles become one `ActionTile`. ### 3. Tints and radii Prod radii: `999px` ×36, `50%` ×36, `9px` ×20, `10px` ×20, `12px` ×12, `14px` ×11, `8px` ×10, `5px` ×8, `3px` ×8, `18px` ×5, `16px` ×5, `11px` ×4, plus 8 token forms. Prod tokens (`tokens.css:122`): `--r-control 7, --r-tile 9, --r-card 10, --r-sheet 18, --r-frame 20` — different numbers from the approved mockup (`--r-card 14, --r-frame 22, --r-select = frame − 10 = 12`). The mockup sweep (comment on #892, 6 commits) already made the mockup 153× `--r-select`. **Port = #693** (token values) and then replace raw 8/9/10/11/12 px with `--r-select`, raw 14/16/18 with `--r-card`/`--r-sheet`. Rule for the guard: a selection/hover tint's radius is `calc(container radius − inset)`; `--r-select` is the default; anything else needs a comment `/* radius: why */`. ### 4–5. Rows and fields Rows: NoteList:468, TrashList:223, Settings:460, Sidebar:437, InstallHint:122, InviteSheet:268, KindLine:78, TopPills:508, BackdropGrid:129, bar/Sheet:54. `PropRow` (apps/web/src/components/PropRow.svelte) is imported by 1 file. Mockup has `ListRow`, `ListGroup`, `SettingRow`, `PropRow` — port the first three to `packages/ui` (rows get radius `--r-select`, hover `--hover`, press via `.press`). Fields: 13 input rule sets listed in the table; `ListFilter` and `InlineRename` in `packages/ui` already do most of it. ### 6–7. Toggle, Selector `Toggle` (packages/ui/controls) wraps `SquishSwitch` but nothing in web imports it; Settings and Inspector draw their own. `Selector` (3 users) vs `.seg` in chrome.css (2 users); the mockup has `MiniBar` still waiting to become a Selector. ### 8–9. Type and spacing Prod defines `--text-title/subtitle/heading/body/ui/label/section` (tokens.css:93–99) but 150+ declarations use `calc(N*var(--type-px))` with N ∈ {10.5, 11, 11.5, 12, 12.5, 13, 13.5, 14, 15, 16, 17, 18, 21, 28, 34}. #911 designs the new scale in the mockup; prod port should follow #911 once approved, not invent another. ### 10–13. Glass, motion, sheets, empty states see table. Motion tokens (`--ease-out`, `--ease-in-out`, `--ease-drawer`) exist; 109 bare `ease`/`ease-out` and 12 literal béziers bypass them. No duration tokens exist at all. ## Plan: one PR per row, into dev Order = most-copied and most-visible first. Every PR has the same four parts: 1. **Guard** `ci/check-ui-primitives.mjs` (node, no deps; runs in `bun run lint` and the web CI job, no `continue-on-error`). It extends the mockup's `no-handmade-pills.mjs` idea with one rule per row: no `scale:` in `:active` outside `.press`/`Pill`; no `border-radius: 8|9|10|11|12px` outside tokens; no `font-size: calc(N*var(--type-px))` outside tokens.css; no `backdrop-filter` outside glass.css; no bare `ease`/`ease-out`; no `<input` rule sets outside `Field`; a `LEFT_ALONE` map with a reason per allowed place (as in the mockup guard). Count may only go down. 2. **Pixel diff** before/after on the affected screens (Playwright screenshots, Chromium + WebKit, light/dark, 1440 and 390 px) posted in the PR; expected diff is zero except where the mockup value deliberately wins (radius, press). 3. **Perf gate** (kayg 11-03: no regressions): first-paint JS/CSS gz bytes (`apps/web/scripts/bundle-size.mjs`) must be ≤ dev; typing latency and rAF frame deltas flat on the Mac VM for any PR touching bar/pills/editor chrome. Report all deltas. 4. **Docs**: the component's header comment is its doc; `TASTE.md` line if a rule changed. | PR | Content | Expected bytes (estimate, gz) | |---|---|---| | 1 | Port `Pill` + `Toolbar` + `PageToolbar` from `review/calendar-2`; move TopPills, PhoneFoot, ListDock, BulkBar, TrashPreview onto them | ±0 (new code ≈ +1 KB, removed copies ≈ −1 KB) | | 2 | `--press-scale`, all 26 `:active` presses via `.press`/`Pill`; guard | −0.4 KB CSS | | 3 | `Button`/`ActionTile`; `.ib` as the in-row icon button | −1 KB CSS | | 4 | #693 tokens + radius sweep (`--r-select`, `--r-card`) | −0.5 KB CSS | | 5 | `ListRow`/`ListGroup`/`SettingRow`; `PropRow` everywhere | −2 KB CSS+JS | | 6 | `Field` + `ListFilter` | −1 KB CSS | | 7–8 | `Toggle`, `Selector` adoption | −0.5 KB | | 9–10 | Type + spacing tokens after #911 approval | −1.5 KB CSS (shorter declarations) | | 11–13 | `glass`, motion tokens, sheet shells, `EmptyState` | −1.5 KB | Total expected: about −8 KB gz across CSS/JS, no first-paint growth (PR 1's new code loads with the chrome that already ships). These are guesses from rule counts; each PR reports the real number from `bundle-size.mjs`. ## Decisions I made (flagging for review) - Prod gets the mockup's shared components, not new ones (reuse rule); `Pill`/`Toolbar` port is PR 1 because 8 other PRs depend on it. - The guard allow-list approach (counted, with a reason) is copied from the mockup guard so prod and mockup rules stay identical. - The press value: default 0.97 everywhere. 0.9 is used 6× in prod and 30× in the mockup for small round things (switches, tick boxes); I kept an optional `--press-scale-small` for those pending kayg's call. ## Open risks - #875 (open) also changes press/menus in `packages/ui`; PR 2 must land after it or rebase on it. - #911 type scale is not approved yet; PR 9–10 wait for it. - Tasks/Contacts/Calendar UI PRs (#832, #888, #889, #893, #842) add more hand-made pieces now; the guard (PR 2) should merge early so they fix on rebase.
Author
Owner

Prod findings from the consistency audit (#933), measured on origin/dev @ 6be86ba0 (13 routes x 2 viewports + trigger clicks; thin data). Which PR of this plan covers each:

Found in prod PR
Off-scale text 11.5, 12.5, 13.5, 18, 21, 23 (Settings section title h2.sec), phone 16; no --fs-* scale 9 (type sizes)
Row / tile / field tint radii 8, 8.8, 9, 10, 11, 12; frame 18 / 20 (mockup 22) 4 (tints and radii)
Icons in pills and buttons 15, 16, 17 (mockup: one 20 desktop / 22 phone) 3 (icon / round buttons)
Heights: .ib 28, rows 32-34, fields 32, tabs 30 / 34 3, 5, 6
Gaps 10 / 8 / 2 / 4 / 12 / 16 / 1 / 6 (no scale) 10 (spacing)
Blur: frame 32, float 24 (mockup 20 / 28, one set of tokens) 11 (glass)

Also: the mockup branch now has packages/ui using --text-ui / --text-label instead of 13.5 / 12.5 / 11.5 literals (de7ef933); when prod takes the package those sizes become 14 / 12 / 12, so add that to PR 9's "what changes" list. docs/design/consistency.md (PR into dev) is the table PRs 3, 4, 9, 10 and 11 should check against.

Prod findings from the consistency audit (#933), measured on `origin/dev` @ `6be86ba0` (13 routes x 2 viewports + trigger clicks; thin data). Which PR of this plan covers each: | Found in prod | PR | |---|---| | Off-scale text 11.5, 12.5, 13.5, 18, 21, 23 (Settings section title `h2.sec`), phone 16; no `--fs-*` scale | 9 (type sizes) | | Row / tile / field tint radii 8, 8.8, 9, 10, 11, 12; frame 18 / 20 (mockup 22) | 4 (tints and radii) | | Icons in pills and buttons 15, 16, 17 (mockup: one 20 desktop / 22 phone) | 3 (icon / round buttons) | | Heights: `.ib` 28, rows 32-34, fields 32, tabs 30 / 34 | 3, 5, 6 | | Gaps 10 / 8 / 2 / 4 / 12 / 16 / 1 / 6 (no scale) | 10 (spacing) | | Blur: frame 32, float 24 (mockup 20 / 28, one set of tokens) | 11 (glass) | Also: the mockup branch now has `packages/ui` using `--text-ui` / `--text-label` instead of 13.5 / 12.5 / 11.5 literals (de7ef933); when prod takes the package those sizes become 14 / 12 / 12, so add that to PR 9's "what changes" list. `docs/design/consistency.md` (PR into dev) is the table PRs 3, 4, 9, 10 and 11 should check against.
Sign in to join this conversation.
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#912
No description provided.