Skip to content

cmux NEXT theme: Rust, web and harness ports take #23441's ink and popup rules (2/2 of #23517) - #25444

Merged
teamleaderleo merged 1 commit into
feat-cmux-nextfrom
hotswap-opus/theme-ink-ports
Oct 26, 2026
Merged

teamleaderleo merged 1 commit into
feat-cmux-nextfrom
hotswap-opus/theme-ink-ports

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Second half of #23517, after #25438. #23441 changed two theme rules in Swift: how the text ink is picked (ThemeTokens.inks) and where a dark theme's popup surface lifts (opaqueOverlayFill). #25438 added schemas/theme/theme-ink-vectors.json, Swift's output for every bundled theme, which a Swift test keeps true. This PR ports both rules to the remaining copies of ThemeTokens.derive and checks each copy against that file, so the copies can't drift apart again.

What

  • Ink rule. If the foreground doesn't reach 4.5:1 on both the strongest row fill and the background, walk it toward white and toward black until it does. Keep the candidate whose primary and secondary have the higher least contrast, capped at 4.5; on a tie the first candidate (the old direction) wins. Ported to:
    • cmux-tui/crates/cmux-theme-tokens/src/tokens.rs (inks, readable_over);
    • webviews/src/gallery/theme/tokens.ts (inks; the gallery also gets the see-through surfaces Swift and Rust already had);
    • webviews/scripts/agent-pane/theme.mjs, the agent pane harness, a fifth copy of the old 0.18 rule.
  • Popup surface. opaque_overlay_fill (Rust) and opaqueOverlayFill (web) follow cmux NEXT theme: Grass and Hot Dog Stand cards stay translucent with AA text (ink takes the higher least contrast) #23441: a dark theme whose text is darker than its page lifts toward white.
  • Spec prose. design-tokens.json (textPrimary, textSecondary, materials.opaqueFallback), design-tokens.md and pixel-parity.md now state the new rules.

Of the 622 bundled themes, only Grass (now white text) and Hot Dog Stand (now dark text, card lifted toward white) change, the same as in the app since #23441.

Checks against the vectors

  • Rust: cmux-theme-tokens spec::tests::derive_matches_the_swift_ink_vectors.
  • Web: webviews/test/theme-ink-vectors.test.ts checks the gallery tokens (all four values), the agent pane harness (the inks, for themes without their own accent) and derive_theme_tokens.py --check-theme-ink-vectors.

Results at the head before the rebase onto #25438's merge (same tree for these files):

  • cargo test -p cmux-theme-tokens: 21 passed, 0 failed (cmux-ci test, run 40308844620).
  • bun test test/theme-ink-vectors.test.ts: 3 passed, 0 failed (cmux-ci test).

On #23517's original test commit, before the ports, both checks were red on Grass and Hot Dog Stand. For example:

ghostty/themes/Grass.textPrimary: Swift Some("#FFFFFF"), derive #0A0A07
ghostty/themes/Hot Dog Stand.textPrimary: Swift #0F0F0F, harness #1F1F1F

No capture: The Mac app's look is unchanged; its Swift side already shipped in #23441. These ports bring cmux-tui, the web gallery and the agent pane harness to the same two themes.

Risk: low. The pure color derivations change for two themes, and tests pin them to Swift.

Agent session: agent session

🤖 Generated with Claude Code

…pup rules, checked against the Swift vectors

Second half of #23517. cmux-theme-tokens (inks, readable_over,
opaque_overlay_fill), the web gallery tokens (inks, the see-through surfaces,
opaqueOverlayFill) and the agent pane harness take the rules #23441 gave Swift,
and each is checked against schemas/theme/theme-ink-vectors.json: Rust
spec::tests::derive_matches_the_swift_ink_vectors, and
webviews/test/theme-ink-vectors.test.ts for the gallery, the harness and
derive_theme_tokens.py --check-theme-ink-vectors. The spec prose states the
new rules.

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

cursor Bot commented Oct 26, 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

Owned by an agent session · session

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

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra xhigh): SHIP at bac9f8f

No blocking findings. Ink scoring, first-on-tie selection, rounding, see-through surfaces, popup branching and spec prose match Swift/Python. Coverage notes (non-blocking): the harness check skips four accented themes and checks only the inks; the web vectors fix opacity at 1.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Bead cx-e54b1 created for this PR by the cmux coordinator.

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

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

Review bac9f8f: 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=pr25444 -f ref=hotswap-opus/theme-ink-ports -f platform=macos -f backend_mode=local

Gallery before/after for bac9f8f: 16 states rendered, 6 images differ, 1954 more touched states not rendered. Images are in the run's artifact, not on this public PR.

gh run download 40312838870 -R manaflow-ai/cmux -n gallery-advisory-25444-bac9f8f188a0507f73e5e7d3395c300d503055ad (then read gallery-review.json)

States
State Theme Status Diff Picked by
agent-pane.add-project-panel/environment Apple System Colors Light unchanged 0% everything tokens.ts
agent-pane.add-project-panel/environment Apple System Colors unchanged 0% everything tokens.ts
agent-pane.add-project-panel/sources Apple System Colors Light unchanged 0% everything tokens.ts
agent-pane.add-project-panel/sources Apple System Colors unchanged 0% everything tokens.ts
agent-pane.add-project-panel/directory Apple System Colors Light unchanged 0% everything tokens.ts
agent-pane.add-project-panel/directory Apple System Colors unchanged 0% everything tokens.ts
agent-pane.add-project-panel/keyboard Apple System Colors Light unchanged 0% everything tokens.ts
agent-pane.add-project-panel/keyboard Apple System Colors unchanged 0% everything tokens.ts
agent-pane.addressed-message/relayed Apple System Colors Light unchanged 0% everything tokens.ts
agent-pane.addressed-message/relayed Apple System Colors unchanged 0% everything tokens.ts
agent-pane.agent-message-row/sent Apple System Colors Light changed 0.0101% everything tokens.ts
agent-pane.agent-message-row/sent Apple System Colors changed 0.0096% everything tokens.ts
agent-pane.agent-message-row/lanes Apple System Colors Light unchanged 0% everything tokens.ts
agent-pane.agent-message-row/lanes Apple System Colors unchanged 0% everything tokens.ts
agent-pane.agent-message-row/sent-subagents Apple System Colors Light unchanged 0% everything tokens.ts
agent-pane.agent-message-row/sent-subagents Apple System Colors unchanged 0% everything tokens.ts
agent-pane.agent-message-row/sent-hover Apple System Colors Light changed 0.0096% everything tokens.ts
agent-pane.agent-message-row/sent-hover Apple System Colors changed 0.0092% everything tokens.ts
agent-pane.agent-message-row/sent-opened Apple System Colors Light changed 0.0102% everything tokens.ts
agent-pane.agent-message-row/sent-opened Apple System Colors changed 0.0091% everything tokens.ts
agent-pane.agent-message-row/sent-opened-long Apple System Colors Light unchanged 0% everything tokens.ts
agent-pane.agent-message-row/sent-opened-long Apple System Colors unchanged 0% everything tokens.ts
agent-pane.agent-message-row/outcomes Apple System Colors Light unchanged 0% everything tokens.ts
agent-pane.agent-message-row/outcomes Apple System Colors unchanged 0% everything tokens.ts
agent-pane.agent-message-row/both-directions Apple System Colors Light unchanged 0% everything tokens.ts
agent-pane.agent-message-row/both-directions Apple System Colors unchanged 0% everything tokens.ts
agent-pane.agent-pair-note/paused Apple System Colors Light unchanged 0% everything tokens.ts
agent-pane.agent-pair-note/paused Apple System Colors unchanged 0% everything tokens.ts
agent-pane.agent-pair-note/held-list Apple System Colors Light unchanged 0% everything tokens.ts
agent-pane.agent-pair-note/held-list Apple System Colors unchanged 0% everything tokens.ts
agent-pane.agent-pair-note/repeating Apple System Colors Light unchanged 0% everything tokens.ts
agent-pane.agent-pair-note/repeating Apple System Colors unchanged 0% everything tokens.ts

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

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

This branch had an error being deployed

1 failed deployment
cmux-tui-merge-tree — bac9f8f1 Deployed Oct 26, 2026 by teamleaderleo via publish the merge tree #6460
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