Skip to content

cmux NEXT webviews: fail hand-set popup roles and raw design values in new code outside ui/ - #33701

Merged
teamleaderleo merged 4 commits into
feat-cmux-nextfrom
lane/ui-system-lint
Nov 3, 2026
Merged

teamleaderleo merged 4 commits into
feat-cmux-nextfrom
lane/ui-system-lint

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Part of the cmux NEXT design-system pass (Leo: "there's just tons of design systems related stuff for spacing gutters icons etc whatever like we don't yet feel "designed" yet"). This is the lint piece: new code outside webviews/src/ui/ can no longer hand-roll a popup widget or write a raw design value, while today's tree passes on a shrinking allowlist.

What changes

1. hand-set-role in scripts/check-ui-review.ts (fails)

  • Flags role="menu" | "menuitem" | "menuitemradio" | "menuitemcheckbox" | "listbox" | "option" | "dialog" | "tablist" | "tab" written in TSX outside src/ui/: a JSX attribute (including a conditional such as role={x ? "option" : undefined}) or a role: "option" property in a props object. querySelector('[role="menu"]') strings, other roles (group, alert, status), src/ui/, tests and gallery files are not flagged.
  • Fingerprint <role>|<tag or props>|<enclosing component>, so moving lines does not churn the allowlist.
  • Today's 55 occurrences (DiffToolbar, BranchBasePicker, the slash/palette/file-search listboxes, New Tab, History, Apps, the inspector tabs, and others) are in ui-review-allowlist.jsonl. The checker's own scan generated them.
  • hand-set-role is the one rule in FAILING_RULES. A new occurrence fails, and so does a stale entry (the code is fixed but the entry is still listed), so the list only shrinks. The copy and row rules still only warn, as before.
  • check:ui-review is already in check:pieces, so this adds no CI job or step.

2. Token literals in scripts/check-design-tokens.ts (fails, same ratchet)

The existing per-file baseline ratchet now also counts, in CSS and in TSX inline style={{}} objects:

kind flagged allowed
color raw #hex, rgb/rgba/hsl/hsla/hwb/lab/lch/oklab/oklch/color() var() and its fallback, a colour function or color-mix that takes a token, masks, --x: token definitions
spacing margin*, inset*, top/right/bottom/left (padding/gap as before) 0/4/8/12/16/24/32 + 40/48/56 layout gaps (abs value, so -4px is fine)
radius border-radius* 0/4/6/8/12/16, >= 999px capsules, tokens (menu 5 comes from --cmux-menu-*)
font-weight anything else, bold, and 700 400, 600, normal, var(); 700 for monograms lives in the baseline
duration a literal transition/animation duration other than 0 var(--cmux-motion-*)
easing cubic-bezier(), ease, ease-in, ease-out, ease-in-out var(--cmux-ease-out), linear
  • The token file pages/shared/desktop.css and generated CSS are not scanned for the new kinds. Font sizes stay with the existing type-scale ratchet (scripts/cmux-next/check-type-scale.py), which already counts every literal font size; this PR does not duplicate it.
  • Baseline: the 1,463 existing rows are byte-for-byte unchanged; 1,107 new rows record today's counts (spacing 2,220 occurrences incl. padding/gap, radius 415, font-weight 186, color 57, duration 40, easing 34). These match the static audit's totals (radius 403, font-weight 185, raw colour 87 including about 30 mask stops that are not colours).

How a migration PR shrinks the lists

After moving a surface onto ui/ and tokens, run from webviews/:

bun scripts/check-ui-review.ts --shrink-allowlist && bun scripts/check-design-tokens.ts --update-baseline

--shrink-allowlist drops only stale entries and never adds one; --update-baseline refuses to grow any count. Both checks fail until the fixed entries are removed, so no list ever grows back.

Overlap

Tests

test/check-ui-review.test.ts: positive (JSX, conditional, props object, every role), negative (other roles, selector strings, ui/, gallery, tests, .ts), allowlisted passes, new fails, stale entry fails until --shrink-allowlist, shrinking never adds, today's tree passes. test/design-tokens.test.ts: each kind positive and negative, var/fallback/token-composing colour, TSX inline styles, ratchet new/allowlisted/shrink.

Observed / Not run

  • Ran on the fleet (cmux-ci test): both test files, bun scripts/check-ui-review.ts, bun scripts/check-design-tokens.ts, vp check --no-fmt --no-lint. 64 tests pass, both checkers pass on today's tree, no type errors.
  • vp fmt --check clean. No runtime or rendering code changes, so no Performance table and no captures; no new loops, timers or observers.

Changelog

none

Agent session: agent session

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Adds two failing design-system lint rules so new code outside webviews/src/ui/ can't hand-roll a popup widget or write a raw design value.

hand-set-role in check-ui-review.ts

  • Flags menu, menuitem*, listbox, option, dialog, tablist, and tab roles set in TSX outside src/ui/ (tests, gallery, and ui/ files exempt).
  • Today's 55 occurrences are allowlisted by file + fingerprint; a new finding or a stale entry fails the check, while the copy and row rules still warn.
  • bun scripts/check-ui-review.ts --shrink-allowlist drops stale entries and never adds.

Token literals in check-design-tokens.ts

  • Flags raw color literals, off-scale spacing/radius/font-weight, and non-token durations/easings in CSS and TSX inline style={{}} objects.
  • The baseline was re-recorded against the current base, so it includes rows from surfaces that landed since (the next-step card, conversation margins, settings radii).
  • bun scripts/check-design-tokens.ts --update-baseline re-records counts and refuses to grow any, so a count can only shrink.

Written for commit 0d32b47. Summary will update on new commits.

View guided diff Turn on auto-fix

teamleaderleo and others added 2 commits November 3, 2026 03:02
check-ui-review gains a failing `hand-set-role` rule: role="menu|menuitem*|listbox|option|
dialog|tablist|tab" written in TSX outside src/ui/ (tests and gallery exempt). Today's 55
occurrences are allowlisted by file + fingerprint; a new one fails, and a stale entry fails
until `bun scripts/check-ui-review.ts --shrink-allowlist` drops it (it never adds). The copy
and row rules still only warn.

check-design-tokens extends its ratchet to raw colour literals, margin/inset/top/left
spacing, border-radius, font-weight, literal durations and easings, in CSS and in TSX inline
style objects. Today's counts go in the baseline (every pre-existing row is unchanged); a
count may only go down (`--update-baseline` refuses to grow).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-fb75b7af9902231028aa
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 0d32b47: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr33701 -f ref=lane/ui-system-lint -f platform=macos -f backend_mode=local

web and size checks: green

Shipped in:

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · session

@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Nov 3, 2026
@blacksmith-sh

blacksmith-sh Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
test_every_compile_job_names_its_warm_sources (main.ThisTree.test_every_compile_job
_names_its_warm_sources)/
test_every_compile_job_names_its_warm_sources (main.ThisTree.test_every_compile_job
_names_its_warm_sources)
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex, router-review): SHIP at 0bfb4d4

Reviewer: codex gpt-6.1-sol xhigh, fast tier.

Follow-ups: 3. Each lands as an issue in this repo that links this receipt; the lane that opened the PR fixes it forward.

SHIP at 0bfb4d4
Visual verdict: no images; Leo tries the build

  1. [P2] [follow-up] check-design-tokens.ts:376 — Unwrap assertions and parentheses around style objects before scanning. style={{ color: "#fff", marginTop: 6 } as React.CSSProperties} produces no findings because the expression is an AsExpression. This common assertion, used with custom CSS properties, disables enforcement for the entire object. Add regression coverage.

  2. [P2] [follow-up] check-design-tokens.ts:359 — Inspect logical fallback expressions alongside ??. style={{ color: customColor || "#fff", marginTop: customMargin || 6 }} produces no findings, allowing new raw values through the ratchet. Traverse the possible value branches and test these cases.

Follow-ups:

  • [P2] [follow-up] Unwrap asserted and parenthesized style objects.
  • [P2] [follow-up] Scan literals in logical fallback expressions.
  • [P2] [follow-up] Missing after images; Leo tries the build.

teamleaderleo and others added 2 commits November 3, 2026 03:43
Rows from base's own baseline are unchanged; the new kinds pick up what landed since
(the next-step card, conversation margins, settings radii).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-fb75b7af9902231028aa

@cmux-bot cmux-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmux-bot approves 0bfb4d4: an independent review passed this exact head (router-review receipt by teamleaderleo). A push needs a new review; a later BLOCK at this head dismisses this approval.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex, router-review): SHIP at 0d32b47

Reviewer: codex gpt-6-astra high, fast tier.

Follow-ups: 3. Each lands as an issue in this repo that links this receipt; the lane that opened the PR fixes it forward.

SHIP at 0d32b47
Visual verdict: no images; Leo tries the build

  1. [P2] [follow-up] check-design-tokens.ts:376: Unwrap style-object assertions before scanning. style={{ color: "#fff", padding: 6 } as React.CSSProperties} produces no findings because the expression is an AsExpression. This common syntax bypasses every inline-style rule.

  2. [P2] [follow-up] check-design-tokens.ts:348: Don’t represent arbitrary interpolations as tokens. For example, background: `rgba(255, 0, 0, ${opacity})` becomes rgba(255, 0, 0, var(--expr)) and passes despite its hard-coded color. Preserve the distinction between unknown expressions and actual CSS tokens.

The CSS scan matches its baseline. Bun tests could not run because Bun and dependencies are absent.

Follow-ups:

  • Unwrap asserted inline style objects and add regression coverage.
  • Detect raw colors with interpolated opacity.
  • [P2] [follow-up] Missing after images; Leo tries the build.

@cmux-bot cmux-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmux-bot approves 0d32b47: an independent review passed this exact head (router-review receipt by teamleaderleo). A push needs a new review; a later BLOCK at this head dismisses this approval.

@teamleaderleo
teamleaderleo merged commit f48f8ba into feat-cmux-next Nov 3, 2026
189 of 197 checks passed
@teamleaderleo
teamleaderleo deleted the lane/ui-system-lint branch November 3, 2026 12:32
lucasr1b added a commit that referenced this pull request Nov 3, 2026
…mns use it

listbox, tablist, their rows and an inline card in src/ui/, so the columns set no popup role by hand (#33701).
lucasr1b added a commit that referenced this pull request Nov 3, 2026
… once (#32980)

* feat(picker): model menu as columns with an account avatar

* test(picker): model menu tests follow the columns

* chore(gallery): model menu plays open the columns

* docs(whats-new): model menu columns highlight

* fix(picker): focus, footer keys, predicted model and type scale

* test(picker): gallery and browser checks follow the columns

* fix(picker): a picked model carries the chat's effort

ultracode carries as extra high; a level picked here carries to the next model. the chip focus waits a task where a page has no frames.

* fix(picker): the menu stays put as the model name changes

a quiet row packed to its end lines the menu up with the chip's end; the effort column has a fixed width. a reopen keeps the keyboard in the search field.

* feat(picker): a model click switches at once; the menu stays where it opened

* fix(picker): review fixes

a second pick of a model still on its way keeps its level; fast turns off on a model just picked; end alignment looks past the chip's own wrapper.

* fix(picker): ci reds for the columns menu

the search field takes focus only as it mounts; a star's hover leaves its row as it was; tests follow the columns and the carried level.

* fix(picker): design tokens in the columns css

* feat(ui): DrivenList, the lists a search field drives; the model columns use it

listbox, tablist, their rows and an inline card in src/ui/, so the columns set no popup role by hand (#33701).

* fix(picker): the columns show the chat's readiness under the search

the old menu's auth note, sign in again and check again (#31689), for every verdict, on every tab and during a search; review by leo.

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 0d32b47a Deployed Nov 3, 2026 by teamleaderleo via wait for same-key tree publisher #105842
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant