Skip to content

refactor: compress language identity color palette - #1398

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/theme-color-contract-followup
Jul 3, 2026
Merged

refactor: compress language identity color palette#1398
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/theme-color-contract-followup

Conversation

@limityan

@limityan limityan commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Compress languageIdentityAccents from per-language/file colors into an 8-slot category palette.
  • Compress the shared Prism syntax palette into role-based light/dark palettes while keeping all exported syntax scheme keys unchanged.
  • Keep all exported built-in language keys and code-snippet accent keys unchanged while routing snippet accents through the same registry.
  • Lower theme governance baselines and update theme-token-optimization.md with the new audit snapshot and consumer contracts.

Impact and Risk

  • User-visible language/file identity colors are intentionally coarser. Exact identification still comes from language/file key, label, icon type, extension, and filename; color is not used as the sole identifier.
  • Syntax highlighting is intentionally coarser for low-risk roles: light string/number now share a literal blue. After product-design review, light punctuation remains distinct from comments and dark tag/property remain distinct to preserve 12px code preview and JSX/HTML adjacent-token readability.
  • No Rust/theme-service ownership boundary changes. This stays in web-ui TS-owned specialized color domains.
  • Dynamic key risk was checked by comparing exported key sets against the base: BUILTIN_LANGUAGE_ACCENTS remains 48 keys, CODE_SNIPPET_LANGUAGE_ACCENTS remains 10 keys, and Prism light/dark scheme keys remain 9 each.

Review Follow-up

  • Subagent architect review found no blocking issues.
  • Subagent product-design review found Prism readability risks; fixed by restoring light punctuation contrast and dark tag/property separation, then updating baseline/docs.

Metrics

Metric Before After
web-ui color occurrences 599 553
web-ui unique colors 395 356
language identity occurrences 52 8
language identity unique colors 50 8
syntax occurrences 18 16
syntax unique colors 17 16
exception unique color baseline 229 190

Verification

  • pnpm run theme:color-audit:all
  • pnpm run theme:color-audit:test
  • pnpm run type-check:web
  • pnpm run lint:web
  • pnpm --dir src/web-ui run test:run src/shared/context-system/core/types/CodeSnippetContextImpl.test.ts
  • pnpm --dir src/web-ui run test:run
  • git diff --check

@limityan
limityan force-pushed the yanzhn/theme-color-contract-followup branch from aadea2f to 3fcf58e Compare July 3, 2026 03:42
@limityan
limityan force-pushed the yanzhn/theme-color-contract-followup branch from 3fcf58e to 0ab1ae0 Compare July 3, 2026 03:58
@limityan
limityan merged commit 72cebf1 into GCWing:main Jul 3, 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