Skip to content

refactor(theme): consolidate domain color stops - #1362

Merged
limityan merged 2 commits into
GCWing:mainfrom
limityan:yanzhn/theme-domain-consolidation
Jun 30, 2026
Merged

refactor(theme): consolidate domain color stops#1362
limityan merged 2 commits into
GCWing:mainfrom
limityan:yanzhn/theme-domain-consolidation

Conversation

@limityan

@limityan limityan commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Consolidates near-equivalent neutral, accent, boundary, Mermaid, Markdown, and Monaco/editor color stops while keeping existing semantic/CSS variable roles intact.
  • Prunes generated widget theme payload keys from 245 to 176 by keeping host FlowChat, navigation, z-index, and retired low-value aliases out of the iframe payload contract.
  • Retires --color-overlay-white-03 from static root exports, runtime injection, and internal product reads in favor of canonical --color-overlay-white-04; keeps an iframe-only alias fallback for historical generated widget content.
  • Removes unused root CSS var exports for badge, legacy effect/shadow, unused z-index, git/status, FlowChat, and local layout keys while keeping SCSS tokens/mixins and compatibility aliases available where they are actually consumed.
  • Keeps TS/web-ui as the theme source of truth and only updates the Rust-side generated prompt snapshot projection.
  • Adversarial review fix: keeps the light Card subtle variant visually below the default variant with a transparent runtime mapping and adds a regression test.

Audit impact

Metric Before After
Unique production colors 498 471
Production color occurrences 722 684
Generated widget payload keys 245 176
CSS var definitions 1127 1058
Compatibility alias contracts 64 65
Token contract unique colors 270 269
Token contract color occurrences 129 128
Specialized near pairs 195 125
Token contract near pairs 50 16
Boundary fallback near pairs 4 0
Mermaid near pairs 12 0
Editor near pairs 2 0
Component/non-token raw colors 0 0
Fallback var occurrences 0 0
Unresolved CSS vars / unregistered dynamic families 0 0
Generated widget undefined / compatibility alias issues 0 0

Risk review

  • Dark/slate neutral element alpha stops are snapped to canonical overlay values; semantic keys such as subtle/soft/base/medium/strong/elevated are preserved, so callers still express the same roles.
  • --color-overlay-white-03 was already visually equal to the 0.04 stop, so internal migration to --color-overlay-white-04 has no visual delta; it remains registered only as generated widget iframe fallback compatibility, which explains the +1 compatibility alias contract.
  • Boundary fallback values are coarsened only for isolated first-paint/iframe/capture fallback paths before the root theme is available.
  • Generated widgets no longer receive undocumented host FlowChat/nav/z-index internals; iframe shell fallback and canonical color/spacing/shape/button/tool-card keys remain exported, while legacy alias compatibility remains inside the iframe fallback layer.
  • Removed root CSS var exports had no internal var() reads, runtime setProperty reads, or required compatibility alias role; SCSS tokens/mixins remain so current compiled component styles are unchanged.
  • Mermaid dynamic theme keys, runtime blur family, and radius/spacing compatibility aliases are deliberately retained because they are dynamic/compatibility boundaries rather than safe dead keys.
  • Light card subtle/default are adjacent component variants; the reviewed fix keeps --card-bg-subtle distinct from --card-bg-default without adding another color literal.
  • Existing Vite large-chunk warnings remain during web/mobile builds and are unrelated to this theme-only diff.

Verification

  • git rev-list --left-right --count gcwing/main...HEAD -> 0 2 after fetching latest upstream main.
  • git diff --check gcwing/main...HEAD
  • pnpm run theme:color-audit
  • pnpm run theme:color-audit:test
  • pnpm run generate-startup-theme-bootstrap -- --check
  • pnpm run theme:visual-contract
  • pnpm run lint:web
  • pnpm run type-check:web
  • pnpm --dir src/web-ui run test:run -> 223 files / 1280 tests passed
  • pnpm run build:web
  • pnpm run type-check:mobile-web
  • pnpm run build:mobile-web

@limityan
limityan force-pushed the yanzhn/theme-domain-consolidation branch from 474e921 to dea882a Compare June 30, 2026 11:41
@limityan
limityan force-pushed the yanzhn/theme-domain-consolidation branch from dea882a to 2d35b2f Compare June 30, 2026 12:15
@limityan
limityan merged commit 6d984b9 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