Skip to content

docs(ui): name the stat-card selector the stylesheet actually defines - #316

Merged
argszero merged 1 commit into
mainfrom
docs/ui-readme-stat-card-class
Sep 27, 2026
Merged

argszero merged 1 commit into
mainfrom
docs/ui-readme-stat-card-class

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

ui/README.md told readers 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 defines zero .stat rules — git grep -nE '^\s*\.stat[ ,{:}]' -- ui/css/style.css returns nothing, class="stat" appears nowhere under ui/, and the only .stat text 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 .stat family and introduced .stat-card, and updated neither carrier — the README line was written by bbde077 (#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 .stat rule has existed since #154.

Related Issue

None — found while re-scanning ui/README.md for 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 .stat family
  • ui/css/style.css: the comment above .stat-card states that the class replaced the historical .stat name, instead of claiming an alias that never existed
  • ui/index.html: stylesheet cache-bust token bumped (?v=20260924-1 → ?v=20260924-2) — every previous change to ui/css/style.css did the same (8 of the last 8 commits touching that file also touched ui/index.html)
  • No config or data-structure changes

Tests

  • cargo test — 413 passed, 0 failed (identical to the base commit)
  • cargo fmt --check — clean
  • cargo clippy --all-targets -- -D warnings — clean
  • No new unit tests: documentation- and comment-only change, no behaviour to assert
  • Manually re-checked after the edit: still zero .stat selector rules, still zero class="stat" sites

Checklist

  • Branch name follows the convention (docs/<description>)
  • Commit message uses Conventional Commits (docs(ui): …)
  • Single responsibility, minimal change (3 files, 4 insertions, 3 deletions)

`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.
@argszero

Copy link
Copy Markdown
Owner Author

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:

  • git grep -nE '^\s*\.stat[ ,{:}]' -- ui/css/style.css → no match: the stylesheet declares no .stat rule.
  • Every .stat hit in the sheet is .stat-grid / .stat-card or prose inside a comment (ui/css/style.css:1102).
  • class="stat" → no site under ui/.
  • The lift described by the README line is on .stat-card:hover (ui/css/style.css:1110), so the documented selector simply had no rule behind it.

Rename is traced, not inferred. 75dcb2c (#154) deletes .stat, .stat:hover, .stat .label, .stat .value, .stat .sub and adds the .stat-card family — in the same commit that writes the "provided as an alias of .stat" comment. The README line predates it (bbde077 / #52). Both carriers therefore name a selector that stopped existing in #154, and the correct name is the one the prototype uses (docs/prototype/…: .stat-card / .stat-card.accent / .stat-grid).

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 (123d916). cargo test → 413 passed / 0 failed (same count as the base commit); cargo fmt --check clean; cargo clippy --all-targets -- -D warnings clean. Re-ran both tree checks after the edit: still zero .stat rules, still zero class="stat" sites. Cache-bust token bumped because ui/css/style.css changed, matching the 8/8 precedent of previous stylesheet commits. CI: msrv pass, test / fmt / clippy pass.

Merging.

@argszero
argszero merged commit 1da8a39 into main Sep 27, 2026
2 checks passed
@argszero
argszero deleted the docs/ui-readme-stat-card-class branch September 27, 2026 21:03
argszero added a commit that referenced this pull request Sep 27, 2026
…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.
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