feat(ui): add shared component layer (stat-card/pill/tag/toolbar/bar-list) + define missing button variants (rant 2026-09-11, PR3) - #154
Merged
Conversation
…list) and define missing button variants Migrate the prototype's component vocabulary into the live stylesheet and align the DOM producers with it, as the third step of the UI redesign (rant 2026-09-11T16:23:43, rollout order step 3: shared component layer). - buttons: define .btn-secondary and .btn-sm, which markup already used but the stylesheet never declared (they fell back to unstyled buttons) - components: add stat-card, pill (ok/warn/danger/muted/accent), tag, trend, bar-list/bar-row/bar-track/bar-fill, toolbar, search, empty, card-sub, split, spread, legend, check-line - rename producers for one vocabulary: search-box -> search (5 HTML + 2 JS sites), stat -> stat-card, badge -> pill/tag, bar-label/bar -> bar-top/ bar-track/bar-fill - keep .badge as a compatibility alias so out-of-tree markup keeps working - consolidate the .toolbar .search / .search rule pairs and update the responsive section for the renamed classes - prototype component coverage is now 48/48
16 tasks
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
PR3 of the front-end adaptation to the new high-fidelity prototype — the shared component layer: the prototype's widget vocabulary (
stat-card/pill/tag/toolbar/search/bar-list/empty/trend/split…) is now real CSS in the live stylesheet, and the DOM producers emit those class names.Rant addressed (verbatim quote of the relevant section):
Rant timestamp:
2026-09-11T16:23:43.625143+08:00(projectaitokenpool).Changes
Two button variants that markup already used but never had styles
.btn-secondaryand.btn-smare referenced fromui/index.htmlandui/js/app.js, but the stylesheet never declared them — those buttons were silently rendering with no variant styling at all. They are now defined (secondary = soft surface + border,sm= compact padding/font, composable with any variant). This is a real defect fix, not just a rename.Component layer added to
ui/css/style.cssMigrated from the prototype stylesheet:
stat-card(withdelta/accent/unitvariants),pill+pill-ok/pill-warn/pill-danger/pill-muted/pill-accent,tag(+tag-accent),trend(+up/down),bar-list/bar-row/bar-top/bar-track/bar-fill,toolbar,search(+search-clear),empty,card-sub,split(+split-1fr/split-1.6fr),spread,legend,check-line.Everything is expressed with the OKLCH design tokens landed in PR1 (
--accent,--ok-soft,--fg-soft,--text-mute…), so the whole layer themes correctly in dark and light without per-theme overrides.One vocabulary across producers
The prototype names are now the only names the producers use:
search-boxsearchindex.html, 2 inapp.js(wireSearch/resetSearchclosest-lookups)statstat-cardstat()helper inapp.js(feeds all fivestat-grids)badge ok/warn/danger/dim/accentpill pill-ok/pill-warn/pill-danger/pill-muted/pill-accentbadge()helper + marketplace table + transactions type/status + API-key status + member role + model vision + department quota + ops statusbadge(neutral)tag/tag-accentmultimarker and peak-price markerbar-label+.bar > ibar-top+bar-track > bar-fillbarRow()inapp.js(admin usage by model / member / department).badgeis retained as a compatibility alias (with its.ok/.warn/.danger/.accent/.dimmodifiers) so any out-of-tree markup or saved snippet keeps working; the semantic colour dots are unchanged.The duplicated
.toolbar .search/.searchrule pair is consolidated, and the responsive section was updated for the renamed selectors.Coverage
Prototype component coverage is now 48/48 — every widget class the prototype defines has a live rule.
Verification
cargo test— 148/148 passedcargo fmt --check/cargo clippy --all-targets -- -D warnings— cleannode --checkon all fourui/js/*.js— OKvar()references.search-box,.stat,.bar-label,.bar > iall gone fromui/)Remaining rant work
PR4 dashboard/marketplace/sharing · PR5 wallet/transactions · PR6 settings/admin/ops.