feat(ui): migrate design tokens to OKLCH system + prototype baseline (rant 2026-09-11, PR1) - #152
Merged
Merged
Conversation
Adopt the new prototype's OKLCH design-token layer (rant 2026-09-11T16:23:43, PR1 of the suggested rollout order). - docs/prototype/aitokenpool-console.html: prototype copied into the repo as the design baseline (step 1 of the rant), so later PRs and reviews have a stable reference outside the host's Downloads folder - ui/css/style.css: :root / :root[data-theme="light"] token layers replaced with the prototype's OKLCH values (--bg --surface --fg --muted --border --accent, --surface-2/3, --accent-soft, --fg-soft, --ok/--warn/--danger and their -soft variants, --overlay, --font-body/-mono/-serif, --r/--r-sm/--r-lg, --sidebar-w 250px, --shadow) - All intermediate colors now derive via color-mix(in oklch, ...) instead of hardcoded hex; every scattered rgba()/hex literal in component rules was replaced with token-derived color-mix expressions - Legacy token names are kept as aliases (--text/--bg-soft/--bg-hover/ --accent-text and friends) so no DOM or selector changes are needed in this PR; alias values were reverse-solved against the previous hex palette to keep the rendered appearance unchanged - ui/index.html: cache-bust 20260825-5 -> 20260911-1 No DOM, layout or JS changes in this PR (lowest-risk first step). Gates: cargo test 148/148, cargo fmt --check, cargo clippy -D warnings, node --check on all ui/js files.
This was referenced Sep 11, 2026
Merged
argszero
added a commit
that referenced
this pull request
Sep 11, 2026
发布 v0.7.21(rant 2026-09-11T21:03:06)。 - Cargo.toml / Cargo.lock: 0.7.20 → 0.7.21 - ui/index.html: cache-bust ?v=20260911-2 → ?v=20260911-3(5 处资源引用) - CHANGELOG.md: 新增 v0.7.21 条目,概括 6 片全站 UI 重设计 (#152 OKLCH 设计 token 层 / #153 登录页左右分栏 + 侧边栏 / #154 共享组件层 / #155 仪表盘·市场·共享 / #156 钱包·交易 / #157 设置·管理·运营) 本次为纯前端改动,后端契约未变;部署结构不变(数据库仍留 NAS,不启用 WAL)。 Gates: cargo test 148 passed / cargo fmt --check clean / cargo clippy clean / node --check x4 / i18n ZH-EN 762=762 exact parity. Co-authored-by: argszero <argszero@argszerodeMac-mini.local>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR1 of the front-end adaptation to the new high-fidelity prototype — the design-token layer migration only (no DOM/layout changes), which is the lowest-risk first step of the rollout order suggested by the host's rant.
Rant addressed (verbatim quote of the relevant section):
and
Rant timestamp:
2026-09-11T16:23:43.625143+08:00(projectaitokenpool).Changes
1. Prototype baseline committed (rant step 1)
docs/prototype/aitokenpool-console.html— the host's prototype is copied into the repository as the single design reference, so that the following PRs (and their reviews) do not depend on a path outside the repo (/Users/argszero/Downloads/t2/) that may be cleaned up.2. OKLCH token layer (
ui/css/style.css)Both themes now define the prototype's token set:
:root):root[data-theme="light"])--bgoklch(17.67% 0.0114 260.64)oklch(97.28% 0.0057 264.53)--surfaceoklch(24.17% 0.0194 258.36)oklch(100% 0 0)--fgoklch(93.83% 0.0109 256.70)oklch(25.55% 0.0267 262.58)--mutedoklch(72.37% 0.0288 255.13)oklch(49.45% 0.0418 262.59)--borderoklch(31.93% 0.0296 260.54)oklch(89.47% 0.0174 256.29)--accentoklch(77.62% 0.1116 188.54)oklch(62.02% 0.1042 188.19)Plus the derived tokens
--surface-2/-3,--accent-soft,--fg-soft,--accent-ink,--ok/--warn/--dangerand their-softvariants,--overlay, the font stack (--font-body/--font-mono/--font-serif), the radius scale (--r/--r-sm/--r-lg),--sidebar-w: 250pxand--shadow— all identical to the prototype's definitions (verified token-by-token against the prototype source).3. No more hardcoded intermediate colors
Every literal
#hex/rgba()in component rules was replaced with a token-derivedcolor-mix(in oklch, ...)expression (badges, login-view ambience, logo gradient, tour ring, toast, chat bubbles, …). The only remaining literals are a#000alpha mask and the inset white/black highlight shadows on the logo, where a token expression would be meaningless.4. Legacy aliases reverse-solved for zero visual delta
The old token names (
--text,--text-dim,--bg-soft,--bg-card,--bg-hover,--text-mute,--accent-text,--danger-text,--card-hover-border,--card-shadow,--table-*,--spin-track,--overlay,--radius*,--font,--mono) are kept as aliases pointing at the new tokens, so this PR needs no changes to selectors, DOM or JS. Alias mix ratios were solved numerically against the previous hex palette so the rendered page is pixel-equivalent (e.g.--bg-hover→color-mix(in oklch, var(--surface) 48%, var(--border))=#222a36, the exact previous value).5. Cache-bust
ui/index.html:?v=20260825-5→?v=20260911-1(5 references).What is intentionally NOT in this PR
Per the rant's rollout order, the remaining acceptance items land in later PRs: login page two-column redesign + sidebar rework (PR2), shared component layer (PR3), dashboard/market/sharing (PR4), wallet/transactions (PR5), settings/admin/ops (PR6).
Verification
cargo test— 148/148 passedcargo fmt --check— cleancargo clippy --all-targets -- -D warnings— cleannode --checkonui/js/{api,app,data,i18n}.js— OKvar()references, balanced braces and parenthesesdocs/prototype/aitokenpool-console.html: all 26 prototype tokens match exactly