Skip to content

refactor(web-ui): align theme bootstrap and color governance - #1348

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/theme-bootstrap-widget-mermaid
Jun 29, 2026
Merged

refactor(web-ui): align theme bootstrap and color governance#1348
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/theme-bootstrap-widget-mermaid

Conversation

@limityan

Copy link
Copy Markdown
Collaborator

Summary

  • Generate the desktop startup theme bootstrap manifest from TS builtin theme presets and load that minimal first-paint projection from Rust via include_str!.
  • Shrink generated widget theme payload compatibility surface by removing low-risk accent/primary/danger legacy exports while keeping root/runtime compatibility definitions intact.
  • Merge three indistinguishable Mermaid fallback color pairs without removing semantic fallback roles.
  • Update the theme optimization document and governance baseline to reflect the lower budgets.

Metrics

Metric Before After
Generated widget payload vars 326 307
Generated widget payload compatibility aliases 64 45
Generated widget external-only compatibility keys 81 62
Mermaid unique colors 95 92
Mermaid indistinguishable near pairs 3 0
Specialized-domain indistinguishable near pairs 6 3
Total unique color literals 560 557

Risk Review

  • Rust still owns only selection/first-paint bootstrap behavior; full theme schema and token semantics stay in TS.
  • Root CSS/runtime legacy aliases remain available, so app-internal historical CSS is not removed in this PR.
  • Removed widget payload keys are not dynamically assembled by the widget payload reader; the retired names are covered by a negative contract test and canonical accent/error keys remain exported.
  • Mermaid changes share actual values but preserve distinct role keys for node hover fill, edge label hover border, muted text, and hover stroke.
  • Expected user-visible effect: desktop first paint now uses TS preset values instead of older Rust approximations, reducing startup theme drift.

Verification

  • pnpm run generate-startup-theme-bootstrap -- --check
  • pnpm run theme:color-audit:test
  • pnpm run theme:color-audit -- --top 20 --report-json .tmp-theme-audit-stage3-after.json
  • pnpm run theme:visual-contract
  • pnpm --dir src/web-ui run test:run
  • pnpm run lint:web
  • pnpm run type-check:web
  • pnpm run build:mobile-web
  • cargo check -p bitfun-desktop
  • rustfmt --edition 2024 --check src/apps/desktop/src/theme.rs
  • git diff --check
  • pnpm run build:web

@limityan
limityan force-pushed the yanzhn/theme-bootstrap-widget-mermaid branch from 3077331 to 52d79e3 Compare June 29, 2026 11:21
@limityan
limityan merged commit 5889530 into GCWing:main Jun 29, 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