Skip to content

refactor(theme): compress legacy color key aliases - #1366

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/theme-key-compression-analysis
Jun 30, 2026
Merged

refactor(theme): compress legacy color key aliases#1366
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/theme-key-compression-analysis

Conversation

@limityan

Copy link
Copy Markdown
Collaborator

Summary

  • Retire explicit root/runtime compatibility aliases and keep legacy theme names out of internal product reads.
  • Consolidate tool-card, button, window-control, semantic status, surface/text/border, primary/accent, danger, font, and motion reads onto canonical tokens.
  • Shrink generated widget theme payload while preserving historical legacy color reads through iframe-only fallback aliases.
  • Tighten theme color governance tests and baselines so retired aliases, dynamic family drift, undefined vars, and payload regressions are blocked.

Metrics

Metric Before After
explicit compatibility alias contracts 65 0
generated widget payload vars 176 157
theme preset color occurrences / unique 206 / 174 190 / 162
specialized near-color pairs 125 119
app raw color occurrences / unique 0 / 0 0 / 0

Risk Review

  • Root/runtime legacy aliases are intentionally retired; generated widget historical content remains covered by iframe fallback aliases.
  • Adjacent severity states stay distinguishable: high risk uses a warning/error mix instead of collapsing into medium warning.
  • Dynamic radius/spacing family compatibility remains explicitly contracted and audited.
  • External custom CSS that reads retired root/runtime aliases should migrate to canonical tokens.

Verification

  • pnpm run theme:color-audit -- --top 30
  • node --test scripts/audit-theme-colors.test.mjs
  • pnpm --dir src/web-ui run test:run src/tools/generative-widget/themePayload.test.ts src/infrastructure/theme/core/ThemeService.test.ts src/infrastructure/theme/presets/themePresetOutput.test.ts
  • pnpm run lint:web
  • pnpm run type-check:web
  • pnpm run theme:visual-contract
  • pnpm --dir src/web-ui run test:run
  • git diff --check

@limityan
limityan merged commit 70f2341 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