Skip to content

refactor: compress cross-surface theme tokens - #1371

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/theme-cross-surface-compression
Jul 1, 2026
Merged

refactor: compress cross-surface theme tokens#1371
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/theme-cross-surface-compression

Conversation

@limityan

@limityan limityan commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Extend theme color governance from shared web UI to Mobile Web and Installer, including root-specific baselines, dynamic CSS var family ownership, and updated architecture documentation in docs/architecture/theme-token-optimization.md.
  • Compress Mobile Web and Installer token surfaces by removing unused ramps/fallbacks/aliases, replacing raw component colors with existing semantic/surface tokens, and narrowing Installer accent runtime stops to the keys actually consumed.
  • Consolidate repeated Monaco passive selection colors and keep cross-root audits from treating mobile/installer-owned dynamic keys as stale in web-ui-only checks.
  • Keep Installer frontend/backend connection-test message codes aligned with the current adapter enum so the installer crate compiles against latest main.

Impact

  • web-ui audit: 0 app raw colors, 0 fallback vars, 0 unresolved vars; editor occurrences lowered from 55 to 52.
  • mobile-web audit: 37 total color occurrences, 35 unique colors, 1 intentional app UI literal (#fff for the image-remove control over black overlay), 0 fallback/unresolved/non-contract keys.
  • installer audit: 203 total color occurrences, 147 unique colors, 0 app UI raw colors, 0 fallback/unresolved/non-contract keys; runtime dynamic families reduced to accent/purple only.
  • governance docs now state the cross-root ownership model and require theme:color-audit:all for implementation PRs touching theme/runtime surfaces.

Verification

  • pnpm run theme:color-audit:test
  • pnpm run theme:color-audit:all
  • pnpm run theme:visual-contract
  • pnpm run lint:web
  • pnpm run type-check:web
  • pnpm --dir src/web-ui run test:run
  • pnpm run type-check:mobile-web
  • pnpm run build:mobile-web (passes with existing Vite chunk-size warning)
  • pnpm --dir BitFun-Installer run type-check
  • pnpm --dir BitFun-Installer exec vite build
  • cargo check --manifest-path BitFun-Installer/src-tauri/Cargo.toml
  • git diff --check gcwing/main...HEAD

Risk Notes

  • Theme personality colors in adjacent theme presets remain distinct; only unused or non-adjacent high-similarity/component literals were collapsed.
  • The remaining Mobile Web #fff is intentionally retained for the image remove button because existing theme foreground tokens are not safe over a black thumbnail overlay in both light and dark themes.
  • The final review tightened the Mobile Web baseline with cssVarDefinitions.nonContractCssPrivateUnique: 0 so private CSS var drift is guarded like web-ui and installer.
  • A full installer packaged build was attempted earlier and timed out locally; the PR is validated with module-level TypeScript, Vite, and Rust checks instead.

@limityan
limityan force-pushed the yanzhn/theme-cross-surface-compression branch from 18811bc to 9490d50 Compare July 1, 2026 04:42
@limityan
limityan merged commit c114e33 into GCWing:main Jul 1, 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