docs(ui): name the stat-card selector the stylesheet actually defines - #316
Conversation
`ui/README.md` said the stat-card hover lift lives on `.stat:hover`, and the comment above `.stat-card` in `ui/css/style.css` said that class is "provided as an alias of `.stat`". Neither is true: the stylesheet has zero `.stat` rules, `class="stat"` appears nowhere in `ui/`, and the only `.stat` text left in the sheet sits inside that comment. `75dcb2c` (#154) deleted the `.stat` family and moved to the prototype name `.stat-card`; it updated neither the README line (`bbde077` / #52 wrote it when the name was still `.stat`) nor the comment it wrote in the same commit. The hover lift has been on `.stat-card:hover` (ui/css/style.css:1110) ever since. Name the selector that has a rule, and say where the old name went. The stylesheet token is bumped because this touches ui/css/style.css.
|
Committer review (self-PR; GitHub will not let an author approve their own PR, so this is posted as a plain comment). Claim checked against the tree, not the prose. On the base commit:
Rename is traced, not inferred. Scope. Documentation- and comment-only; no rule added, nothing renamed in code. Keeping the stylesheet comment in scope is deliberate — it is the second carrier of the same false fact, and a reader who checks the CSS would otherwise be told the alias exists. Local verification on the branch tip ( Merging. |
…as (#317) The comment above `.bar-row .bar-top` read "(线上 .bar-label 为其别名)" — i.e. it asserted that writing `class="bar-label"` today still renders. It does not. `git grep -n 'bar-label'` over the whole tree returns exactly one hit: that comment. There is no `.bar-label` rule, no markup emits it, and `docs/prototype/aitokenpool-console.html` does not carry it either — so the three possible consumers (rule / implementation / prototype) are all absent. `git show 75dcb2c` (#154, the shared component layer) is where the name was removed: the same commit deletes `.bar-row .bar-label` and adds `.bar-row .bar-top`, and its message reads "bar-label/bar -> bar-top/bar-track/bar-fill". The alias claim was written by that very commit, so it has been false since it was authored. #154 left two such breadcrumbs. #316 fixed the `.stat` one; this is the other. The wording mirrors the phrasing #316 landed for `.stat-card` — name the historical name and say there is no alias rule, rather than inventing one (the rejected alternative in both cases: adding a real `.bar-label` rule). Also bumps `ui/index.html`'s `style.css?v=` token, as every style.css change in this file's history does. No behavioural change: one comment plus a cache-bust token.
Summary
ui/README.mdtold readers the stat-card hover lift lives on.stat:hover, and the comment above.stat-cardinui/css/style.csssaid that class is "provided as an alias of.stat". Neither is true: the stylesheet defines zero.statrules —git grep -nE '^\s*\.stat[ ,{:}]' -- ui/css/style.cssreturns nothing,class="stat"appears nowhere underui/, and the only.stattext left in the sheet sits inside that comment (so a string search calls the name "present" while no rule declares it). The hover lift is on.stat-card:hover(ui/css/style.css:1110).Both carriers of this one fact name a selector without a rule, and each one is what the next reader checks: the README line is the only statement of the convention, and the stylesheet comment is where the "alias" claim is learned.
The rename is not a judgement call:
75dcb2c(#154, shared component layer) deleted the.statfamily and introduced.stat-card, and updated neither carrier — the README line was written bybbde077(#52) when the class really was.stat, and the "alias" comment was written in the same commit that removed it. The design prototype uses.stat-card/.stat-card.accent/.stat-grid, and the direction is unambiguous: no.statrule has existed since #154.Related Issue
None — found while re-scanning
ui/README.mdfor claims that do not match the code.Changes
ui/README.md: the stat-card hover line now names.stat-card:hover, with an inline correction note naming the component-layer change (75dcb2c/ feat(ui): add shared component layer (stat-card/pill/tag/toolbar/bar-list) + define missing button variants (rant 2026-09-11, PR3) #154) that removed the.statfamilyui/css/style.css: the comment above.stat-cardstates that the class replaced the historical.statname, instead of claiming an alias that never existedui/index.html: stylesheet cache-bust token bumped (?v=20260924-1→?v=20260924-2) — every previous change toui/css/style.cssdid the same (8 of the last 8 commits touching that file also touchedui/index.html)Tests
cargo test— 413 passed, 0 failed (identical to the base commit)cargo fmt --check— cleancargo clippy --all-targets -- -D warnings— clean.statselector rules, still zeroclass="stat"sitesChecklist
docs/<description>)docs(ui): …)