cmux NEXT: one layout grid (tokens) and a Chromium check that every surface sits on its lines
No capture: this PR adds tokens nothing renders with yet and a warn-level check; no surface draws differently.
Add one layout-grid schema, generated CSS variables, and a checked handwritten Swift copy so surface alignment fixes share the same lines. Menus retain their AppKit metrics. Edges and sizes use the 4 pt grid; derived centers may fall between grid lines, and named optical offsets start empty.
It also adds the alignment check, webviews/test/browser/grid-lines.test.ts: 80 Chromium cases across 20 gallery scenes (composer idle/running "↵ steer · ⌘↵ queue"/draft/attachments, quiet row, strip, trust bar, tray, queue, context and checkmark menus, model/effort/account pickers, transcript tool rows and actions, permission/question/summary/Session Info cards). Expected values come from the runtime --grid-* and --cmux-menu-* variables; text is measured at its first glyph and its optical center (baseline − cap height / 2); tolerance 0.5 px. Every surface starts at warn level (a ::warning annotation, the test passes); the surface fix PRs flip theirs to fail. Transcript rhythm tokens (block 24, inner 12, composer 16) are included. Spec: leo-workspace design/grid.md. No surface layout changes in this PR, so no before/after screenshots are applicable.
Leo's request:
"Plus, like this fing placeholder text is just fing misaligned. You always have these misalignments. I just literally said, like we need to have better grids, we need to have better fing grids. We need to have the fing stuff aligned on fing grids and lines and whatever the f. Make it fing satisfying. I have said that already. I've fing implied that already. I've asked you guys to all research and infer and look things up, and you haven't fing come with the fing conclusions on what to fing do. And you just keep fing circling the drain."
Validation so far: seven focused Python tests pass, including off-grid edges, derived centers, half-steps, bounded optical offsets, cyclic formulas and Swift drift. The CSS generation check and formatting check pass. Fleet browser/check results will replace this paragraph before handoff.
Changelog
none
Carried from Codex worker grid-tokens (its push left the branch unowned in the broker); published by claude-sr2/grid-system.
Agent session: agent session
![View with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png)
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Adds one 4 pt layout grid schema, generated CSS variables, and a checked handwritten Swift copy so surface alignment fixes share one set of lines. Also adds webviews/test/browser/grid-lines.test.ts, a Chromium check that every surface sits on its grid.
- Menus keep their AppKit metrics; edges and sizes are on the grid, derived centers may fall between lines, optical offsets start empty.
- Rhythm tokens (block 24, turn 32, inner 12, composer 16, foot 4) are included and the Swift copy is hand-maintained with drift caught by
gen-layout-grid.py --check. - The check runs 140 cases across 35 gallery scenes (two widths × two themes), measuring edges, centers, and text first-glyph and optical center against runtime
--grid-*and--cmux-menu-*tokens at 0.5 px tolerance. - Measurements use shared surface roles with selector fallbacks, visible placeholder ink counts, and repeated scenes keyed by measured root; effort levels are measured in the running model's side dropdown following #27948.
- The capture fixture's placeholder is a documented design absence (MarkdownField hides it when the field holds markdown), and the file gets a 600 s timeout.
- Every surface starts at warn level and passes; surface fix PRs flip their scene to fail. No surface layout changes in this PR.
Validation
gen-layout-grid.pyrejects off-grid edges, formula mismatches, cyclic formulas, unbounded optical offsets, and menu duplicates, and--checkruns in the webviews warning branch and the NEXT check pipeline.- Seven Python tests cover grid rules, idempotent generation, and Swift drift reporting.