Skip to content

refactor(theme): consolidate near color values - #1360

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/theme-color-count-consolidation
Jun 30, 2026
Merged

refactor(theme): consolidate near color values#1360
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/theme-color-count-consolidation

Conversation

@limityan

@limityan limityan commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Consolidate highly similar theme color values across token contracts, builtin theme presets, runtime fallbacks, Monaco/editor, Mermaid, terminal, and mobile-web theme presets.
  • Add a small mobile theme preset helper for repeated alpha/ramp/shadow construction while preserving the exact exported theme key sets and theme-specific blur/high-ramp values.
  • Refresh generated startup theme projections, prompt snapshots, governance baselines, and the theme optimization design doc with the new metrics.

Metrics

  • Web UI audit unique colors: 547 -> 498.
  • Web UI color occurrences: 760 -> 722.
  • Specialized color-domain near pairs: 324 -> 195.
  • Specialized indistinguishable near pairs: 1 -> 0.
  • Component/non-token raw colors, fallback vars, unresolved CSS vars, token-equivalent app literals: all remain 0.

Risk and boundaries

  • No theme token keys were removed. Mobile darkTheme and lightTheme both remain 148 keys with 0 missing and 0 added keys versus the previous presets.
  • Mobile theme helper generation preserves the previous blur values and the 700/800 ramp values that were based on each palette's stronger 600 color.
  • Merges are limited to near alpha/surface values and specialized rendering domains where the values are highly similar or non-adjacent in the product UI.
  • Remaining near pairs are still tracked in the governance baseline instead of being force-merged across adjacent surface hierarchy or identity palettes.
  • Rust-side files in this PR are generated theme projections only; TS theme presets remain the source of truth.

Verification

  • git diff --check gcwing/main..HEAD
  • pnpm run theme:color-audit
  • pnpm run generate-startup-theme-bootstrap -- --check
  • pnpm run type-check:web
  • pnpm run type-check:mobile-web
  • pnpm run theme:color-audit:test
  • pnpm run theme:visual-contract
  • pnpm --dir src/web-ui run test:run
  • pnpm run build:web
  • Mobile theme key/value coverage script: darkTheme and lightTheme each 148 -> 148, missing=0, added=0; blur and 700/800 ramp values unchanged.

Reduce theme color literal count and specialized near-pair debt across web-ui and mobile-web.

Consolidate mobile theme preset construction, align near alpha and surface values, and refresh theme governance baselines plus generated projections.
@limityan
limityan force-pushed the yanzhn/theme-color-count-consolidation branch from 2104698 to d79e220 Compare June 30, 2026 10:15
@limityan
limityan merged commit 61edd18 into GCWing:main Jun 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant