Skip to content

cmux NEXT webviews: icons draw on one scale (12/14/16/20), with a ratcheting icon-scale check - #33595

Merged
teamleaderleo merged 4 commits into
feat-cmux-nextfrom
lane/design-system-grid-debt
Nov 3, 2026
Merged

teamleaderleo merged 4 commits into
feat-cmux-nextfrom
lane/design-system-grid-debt

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Leo-ask: ask-65aae6c0e2

"there's just tons of design systems related stuff for spacing guttters icons etc whatever like we don't yet feel "designed" yet nawmean"

This PR handles the icons part of that ask. Icons are the one design-system scale with no check. The spec (design/grid.md, "Icon sizes") puts icons at 12, 14, 16 or 20 (artwork at 24 or larger), but nothing enforced it, so the webviews still drew icons at 13, 15, 10 and 11 px. Icons that should match then sit 1–2 px apart.

What changes

  • A new icon-scale check (webviews/scripts/check-icon-scale.ts, bun run check:icon-scale, with test/check-icon-scale.test.ts). It reads three ways an icon size is set: a component size={N}, a square inline <svg width height>, and a square CSS box whose selector names an svg, icon, glyph, chevron or spinner. A size under 24 that isn't 12, 14, 16 or 20 fails unless its line says icon-scale-allow: <reason> or scripts/icon-scale-baseline.tsv records it. Like the design-token ratchet, the baseline can only shrink. Dots (::before/::after), buttons, <input size>, gallery files and prototypes are skipped.
  • 20 icons move onto the scale, each to the nearest step:
    • 13 → 14: the diff viewer's base-picker search and row icons, the toolbar menu check, the jump palette search, the file header menu, and New Tab's All chats search
    • 15 → 16: the diff file icon and the model picker rail's Starred star
    • 10/11 → 12: the chevrons in Files, New Tab and the folder popover, the feature tip's close mark, the question card check, the reply image lock, the video play mark, and the subagent stepper's +/−
  • The design-token check had a bug that worked against the icon scale. check-design-tokens.ts judged every height as a control height (20/24/28/32), so a 14 or 16 px icon counted as debt and an off-scale 13 px icon looked no worse. Now an icon box's height is judged by the icon scale. Its baseline loses those false rows (about 30 entries across 13 files).
  • What I left alone, with reasons:
    • Allow comments: the composer's own 18 px glyph set (the named exception), the 10 px check inside the 12 px plan mark, the 10 px check inside the 14 px markdown checkbox, and the classic diff pill's 19 px.
    • Kept in the baseline: the Chief area (pages/chief-views), the AppKit-metric 6 px menu chevrons, the 8 px close marks in attachment chips (they sit in tight corner badges and need a visual pass first), and the remaining 18 px harness and artwork marks.

design/grid.md (leo-workspace) gets a line pointing to the check.

Risk

Low. The change is CSS and SVG size attributes on icons (+1 or +2 px each), plus a new lint and a lint fix. No logic changes. Per the cmux rule against new CI gates, check:icon-scale is a package script and is not added to check:pieces; its regression test runs with the webview tests.

Changelog

none

Observed / Not run

  • Ran: bun test test/check-icon-scale.test.ts test/design-tokens.test.ts test/check-menu-gutters.test.ts (19 pass), bun scripts/check-icon-scale.ts, bun scripts/check-design-tokens.ts (pass after --update-baseline, which only shrank rows), scripts/web-lint.sh (pass; this host skips the type-aware vp lint/vp check, so CI runs those), and prepush-gate.py (no new violations).
  • Not run: gallery captures. These are +1/+2 px icon changes.

🤖 Generated with Claude Code

Agent session: agent session


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


Summary by cubic

Draws webview icons at one scale (12, 14, 16 or 20 px; artwork 24+) so matching marks that previously sat 1–2 px apart now align, and adds a lint that enforces the scale.

  • New check:icon-scale script fails any icon under 24 px that isn't 12, 14, 16 or 20 unless allowed inline or recorded in a baseline that only shrinks; it's not added to the CI gate, and its test runs with the webview tests.
  • Moves 20 off-scale icons (13→14, 15→16, 10/11→12) across pickers, menus, chevrons, close marks and checks; leaves the composer's 18 px glyph set and a few recorded exceptions.
  • Fixes check-design-tokens so an icon box's height is judged by the icon scale instead of the control-height scale (20/24/28/32), removing false design-token debt rows.

The feat-cmux-next merge keeps the newtab chevron on the base's 12 px size and records ChiefWorkPanel's 10 px icon in the baseline, so no delivered code sits off the scale.

Written for commit 4f0787f. Summary will update on new commits.

View guided diff Turn on auto-fix

…on-scale check

Leo-ask: ask-65aae6c0e2

- New scripts/check-icon-scale.ts (bun run check:icon-scale) and its test: a
  component `size={N}`, a square inline svg, or a square CSS icon box off the
  icon scale (design/grid.md) fails unless it says icon-scale-allow: <reason>
  or is in scripts/icon-scale-baseline.tsv, which only shrinks.
- Moves 20 off-scale icons onto the scale: 13 -> 14 (diff viewer pickers,
  menus, New Tab search), 15 -> 16 (file icon, model picker star),
  10/11 -> 12 (chevrons, close marks, checks, the stepper's +/-).
- check-design-tokens judged every icon `height` as a control height
  (20/24/28/32), so icons on the icon scale read as debt; an icon box's height
  is now judged by the icon scale, and its baseline shrinks by those rows.

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

cursor Bot commented Nov 3, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (subagent claude-opus-5-5 medium): SHIP at 408bdfe

Checked the checker's regexes (min-width/stroke-width don't match, <input size> skipped, -icon-button judged as a control), the baseline ratchet's refusal to grow, and that each resized icon fits its container (checkbox interior 14, feature-tip close 20, header menu button 22, picker row boxes 14). Tests and both checkers pass.

Visual verdict: no images; +1/+2 px icon sizes only [follow-up].
Follow-ups: "mark" in the header comment but not in ICON_SELECTOR; icon-height leniency for non-button containers (*-wrap, *-slot, *-cell, *-track); misses for !important, props containing =>, and comma-bearing :is()/:not(); hoist counts(found) out of the stale-row loop.

…-system-grid-debt

# Conflicts:
#	webviews/scripts/design-tokens-baseline.jsonl
@cursor

cursor Bot commented Nov 3, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@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 4f0787f: 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=pr33595 -f ref=lane/design-system-grid-debt -f platform=macos -f backend_mode=local

Gallery before/after for 4f0787f: 16 states rendered, 32 images differ, 3394 more touched states not rendered. Images are in the run's artifact, not on this public PR; the independent review of this head reads them on its own, so the PR needs no hand-made screenshots of these states.

gh run download 41690949515 -R manaflow-ai/cmux -n gallery-advisory-33595-4f0787f82e79a955ce75e4830311aed5dad8e0c5 (then read gallery-review.json)

States
State Theme Status Diff Picked by
agent-pane.all-chats-list/page-failed Apple System Colors Light changed 0.158% own AllChatsList.tsx
agent-pane.all-chats-list/page-failed Apple System Colors changed 0.156% own AllChatsList.tsx
agent-pane.all-chats-list/page-recovered Apple System Colors Light changed 0.158% own AllChatsList.tsx
agent-pane.all-chats-list/page-recovered Apple System Colors changed 0.156% own AllChatsList.tsx
agent-pane.all-chats-list/long-values Apple System Colors Light changed 0.197% own AllChatsList.tsx
agent-pane.all-chats-list/long-values Apple System Colors changed 0.195% own AllChatsList.tsx
agent-pane.all-chats-list/leads Apple System Colors Light changed 0.158% own AllChatsList.tsx
agent-pane.all-chats-list/leads Apple System Colors changed 0.156% own AllChatsList.tsx
agent-pane.all-chats-list/page-empty Apple System Colors Light changed 0.166% own AllChatsList.tsx
agent-pane.all-chats-list/page-empty Apple System Colors changed 0.164% own AllChatsList.tsx
agent-pane.all-chats-loading/first-page Apple System Colors Light changed 0.264% own AllChatsList.tsx
agent-pane.all-chats-loading/first-page Apple System Colors changed 0.261% own AllChatsList.tsx
agent-pane.all-chats-loading/indexing Apple System Colors Light changed 0.264% own AllChatsList.tsx
agent-pane.all-chats-loading/indexing Apple System Colors changed 0.261% own AllChatsList.tsx
agent-pane.all-chats-loading/loaded Apple System Colors Light changed 0.264% own AllChatsList.tsx
agent-pane.all-chats-loading/loaded Apple System Colors changed 0.261% own AllChatsList.tsx
agent-pane.all-chats-loading/empty Apple System Colors Light changed 0.76% own AllChatsList.tsx
agent-pane.all-chats-loading/empty Apple System Colors changed 0.752% own AllChatsList.tsx
agent-pane.all-chats-loading/failed Apple System Colors Light changed 0.731% own AllChatsList.tsx
agent-pane.all-chats-loading/failed Apple System Colors changed 0.722% own AllChatsList.tsx
agent-pane.chat-inspector/full Apple System Colors Light changed 0.0747% own SubagentLimitStepper.tsx
agent-pane.chat-inspector/full Apple System Colors changed 0.0076% own SubagentLimitStepper.tsx
agent-pane.chat-inspector/compact-more Apple System Colors Light changed 0.039% own SubagentLimitStepper.tsx
agent-pane.chat-inspector/compact-more Apple System Colors changed 0.0076% own SubagentLimitStepper.tsx
agent-pane.chat-inspector/compact-more-open Apple System Colors Light changed 0.0079% own SubagentLimitStepper.tsx
agent-pane.chat-inspector/compact-more-open Apple System Colors changed 0.0076% own SubagentLimitStepper.tsx
agent-pane.chat-inspector/compact-folded Apple System Colors Light changed 0.0517% own SubagentLimitStepper.tsx
agent-pane.chat-inspector/compact-folded Apple System Colors changed 0.0076% own SubagentLimitStepper.tsx
agent-pane.chat-inspector/compact-capped Apple System Colors Light changed 0.056% own SubagentLimitStepper.tsx
agent-pane.chat-inspector/compact-capped Apple System Colors changed 0.0076% own SubagentLimitStepper.tsx
agent-pane.chat-inspector/workflow-running Apple System Colors Light changed 0.0072% own SubagentLimitStepper.tsx
agent-pane.chat-inspector/workflow-running Apple System Colors changed 0.006% own SubagentLimitStepper.tsx

Pick other states with a Gallery: entry.id, entry.id/variant line in the PR body.

Shipped in:

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

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6.1-sol high, sweep, via the review router; full diff from merge base 5dee1ab to this head): SHIP at a571f2f

[P2] [follow-up] webviews/package.json:11 - The aggregate check:pieces command never runs the newly added check:icon-scale checker, so CI does not enforce the icon-scale invariant - add bun run check:icon-scale to the check:pieces chain.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (subagent claude-opus-5-5 medium): SHIP at a571f2f

This head is a base merge only. Every file except the regenerated design-tokens-baseline.jsonl has the same lines as the 408bdfe review. The baseline only shrank against base's copy. Both checkers and 17 tests pass, and all 8 webview verdict shards are green.

The gallery health "own reds" (pages.settings#font-picker, agent-pane.changes-git-actions, viewer-empty.path-picker#rtl) load none of the CSS or components this diff touches.

Visual verdict: no images; the icon sizes change by +1 or +2 px only [follow-up].
Follow-ups: #33605.

@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 3, 2026 11:03 Inactive
@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 3, 2026 11:07 Inactive
@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 (next-review patch-id; carried): SHIP at 7c3e517

The independent SHIP at a571f2f carries to this head: the PR's own change (git diff $(git merge-base feat-cmux-next HEAD) HEAD) has the same git patch-id --verbatim (e5c1e3f5859a535c) at both heads, and no merge between them was resolved by hand. Nothing new to review. A newer BLOCK, or any change to the PR's own diff, ends the carry.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · session

Conflicts: newtab/screen.css takes base's --grid-glyph chevron size (12px);
design-tokens baseline regenerated (shrink only). ChiefWorkPanel.tsx's
size={10} icon from base is recorded in the icon-scale baseline.

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

Copy link
Copy Markdown
Collaborator Author

Review (subagent claude-opus-5-5 medium): SHIP at 4f0787f

Checked the base merge only: the PR's diff vs base is unchanged apart from newtab/screen.css dropping out, because base already sizes .nt-chats-filter-chevron with var(--grid-glyph) (12px, same as the PR's intent). The regenerated design-tokens baseline only shrinks against base (902 vs 903 rows, no count grew). The new ChiefWorkPanel.tsx 10 1 icon-scale row covers base's <Spinner size={10} />. check-icon-scale.ts and check-design-tokens.ts both pass at this head.
Follow-ups: none.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex, router-review): SHIP at 4f0787f

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

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

SHIP at 4f0787f

Visual verdict: no introduced visual regression in the 16 supplied before/after pairs.

  1. [P2] [follow-up] webviews/scripts/check-icon-scale.ts:81 — Parse JSX expressions when locating size props. <Check onClick={() => foo()} size={13} /> returns no finding because [^<>]*? stops at the arrow’s >. Moving an unrelated prop before size therefore bypasses enforcement. Add coverage for this case.

  2. [P2] [follow-up] webviews/scripts/check-icon-scale.ts:180 — Require stale baseline allowances to shrink. Currently removing an off-scale icon passes both the command and repository test without updating its allowance; restoring that icon later also passes. Reject stale counts in both paths so removed debt cannot return unnoticed.

Follow-ups:

  • Fix JSX parsing around expressions preceding size props.
  • Enforce baseline shrinkage in the command and repository test.

@teamleaderleo
teamleaderleo merged commit 83c8336 into feat-cmux-next Nov 3, 2026
189 of 196 checks passed
@teamleaderleo
teamleaderleo deleted the lane/design-system-grid-debt branch November 3, 2026 19:20
teamleaderleo added a commit that referenced this pull request Nov 4, 2026
…+ draws at 12px (#34494)

* base red: Settings' progress fill is not a surface; the model menu's + draws at 12px

render.test.tsx's 'no rule declares a background other than transparent or the two interaction
tokens' failed on .app-update-progress's value fill (var(--text)), added by #33176: a progress
bar's value is not a container, so the test now exempts only the progress-value pseudo-elements.

check-icon-scale failed on QuickModelColumns.tsx's PlusIcon at 11px (#32980, which landed an hour
after the check, #33595). 12 is on the scale, matches its viewBox and the CheckIcon beside it.

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

* render.test.tsx: formatter layout

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 4f0787f8 Deployed Nov 3, 2026 by teamleaderleo via wait for same-key tree publisher #107165
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