Skip to content

docs(ui): name only the bump sites, test and hint the code still has - #315

Merged
argszero merged 1 commit into
mainfrom
docs/ui-readme-names-that-exist
Sep 27, 2026
Merged

argszero merged 1 commit into
mainfrom
docs/ui-readme-names-that-exist

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

Three sentences in ui/README.md named something a reader cannot find. Each is corrected in place, naming the change that invalidated it — the idiom this file already uses for its endpoint-card and login-page sections.

1. The bump() wiring (## 动效与系统偏好约定)

The line claimed 4 balance-change sites — wallet top-up, chat deduction, raise-request approval, and the operator crediting themselves via an isMe guard.

The code has 3 sites / 4 bump() calls (ui/js/app.js):

Site Call
wallet top-up bump($("#side-balance")) + bump($("#wallet-balance")) (:1360, :1361)
operator credits themselves u.email === D.USER.email guard (:3102, :3107)
chat deduction :3304

The approval site lived in the local mock branch that mutated D.USER.balance in place and replayed it into D.TRANSACTIONS. 89963f3 (#94, zero-mock, v1.22) deleted that branch — approveRaise() now POSTs and reloads the list — so the bump went with it, and the isMe guard became the inline comparison above.

Not restored: whether the approver's own balance should bump again is a product decision, not a documentation fix; the doc now describes what the code does.

2. The login "remember me" bullet (## 登录页约定)

It still said a demo-hint element showed the demo account. 35291b3 (#90, v0.6.0 demo-seed removal) deleted that element. Today the class rule in ui/css/style.css:734 is orphaned (no element carries the class) and the login.demo pack key already sits in the unreachable sunset list (src/i18n_pack.rs).

3. The C2113 section (## 交易表「模型」/「Key」列)

It cited transactions_model_and_key_filters_match_the_displayed_placeholder (`src/routes/wallet.rs`). No such test ever existed — dfa7318 (#231) added the README line and, in the same commit, the test tx_model_and_key_filters_match_the_displayed_placeholder (src/routes/wallet.rs:1644). The name now matches the file it cites.

A note on how the corrections read

They describe what was removed instead of re-printing the removed identifiers, so a grep for a stale name still lands nowhere — the same way the C2138 correction above already reads. The login-page section keeps naming its deleted selectors on purpose: there they are the section's own subject.

Tests

  • cargo test — 413 passed, 0 failed
  • cargo fmt --check — clean
  • cargo clippy --all-targets -- -D warnings — clean

Docs only: no production code, no i18n key, no cache-bust token.

Deliberately not in this PR

The orphaned .demo-hint rule in ui/css/style.css is real dead CSS, but deleting it is a code change (and needs a style.css?v= bump), so it belongs in its own PR rather than riding along with a documentation fix.

Three sentences in ui/README.md named something a reader cannot find.
Each is corrected in place, with the change that invalidated it named
(the idiom the file already uses for its endpoint-card and login-page
sections).

1. bump() wiring. The line claimed 4 balance-change sites including
   "raise-request approval" and an "isMe" guard. The code has 3 sites
   (4 bump() calls: two for the wallet top-up, one for the operator
   crediting themselves, one for the chat deduction). The approval site
   lived in the local mock branch that mutated D.USER.balance in place;
   89963f3 (#94, zero-mock) deleted that branch and approveRaise() now
   only reloads the list, so the bump went with it. The same refactor
   inlined the self-top-up guard to `u.email === D.USER.email`.

2. The login "remember me" bullet still said a `demo-hint` element
   showed the demo account. 35291b3 (#90, v0.6.0 demo-seed removal)
   deleted that element; the class rule in ui/css/style.css is now
   orphaned and the `login.demo` pack key already sits in the
   unreachable sunset list.

3. The C2113 section cited
   `transactions_model_and_key_filters_match_the_displayed_placeholder`.
   No such test ever existed: dfa7318 (#231) added the README line and
   a test named `tx_model_and_key_filters_match_the_displayed_placeholder`
   in the same commit. The name now matches the file it cites.

The corrections describe what was removed rather than re-printing the
removed identifiers, so a grep for a stale name still lands nowhere
(this is how the C2138 correction above already reads; the login-page
section is the deliberate exception -- there the deleted selectors are
the section's own subject).

Docs only: no production code, no i18n key, no cache-bust token. The
orphaned .demo-hint rule is left alone on purpose (removing CSS is a
separate, cache-busting change).
cargo test 413/0, fmt/clippy clean.
@argszero

Copy link
Copy Markdown
Owner Author

✅ Self-review (Committer; allow_self_merge: true).

Docs-only change, ui/README.md +3/−3. Verified against the tree, not against the text's own claims:

  • bump() call sites in ui/js/app.js: exactly 4 (:1360, :1361 wallet top-up; :3107 operator crediting themselves under u.email === D.USER.email; :3304 chat deduction) — the 3 sites the line now states;
  • approveRaise() posts and reloads via loadAdmin() only — no local balance write, no bump;
  • the demo-hint element is gone from ui/index.html while the class rule survives at ui/css/style.css:734; the login.demo key is in the unreachable sunset list;
  • tx_model_and_key_filters_match_the_displayed_placeholder exists at src/routes/wallet.rs:1644; the prefixed name the README used appears nowhere in the repository and never did;
  • every identifier the corrected lines introduce (approveRaise, loadAdmin, numJump, login.demo, .demo-hint) resolves in the tree;
  • CI green on this head: test / fmt / clippy 2m53s, msrv 27s; local cargo test 413/0, fmt and clippy --all-targets -- -D warnings clean.

Merging.

@argszero
argszero merged commit c104937 into main Sep 27, 2026
2 checks passed
@argszero
argszero deleted the docs/ui-readme-names-that-exist branch September 27, 2026 20:17
argszero added a commit that referenced this pull request Sep 28, 2026
`ui/README.md`'s "设置 / 管理 / 运营布局约定(v1.22)" section still calls the
operator overview's key card "上游 key 健康" and lists its three pills as
"健康 / N 个异常 / 全部失败". That was true when `7d9b56e` (PR #174) wrote the
line; C2158 (#269, `e5ee178`) then renamed the card and rewrote the pills,
because the data has no health signal at all — `/api/ops/runtime` only returns
`total` / `on` / `off`. #269 updated only the section it added itself further
down this same file (`:1080`, which says the opposite), leaving this line
behind, and its edit sheet (4 files / 7 edits) never listed it.

Correct the wording to what the code ships: the title is `ops.keys.title`
("上游 key 状态") and the pills are `ops.keys.allOn` / `someOff` / `allOff`
("全部启用 / N 个停用 / 全部停用"). No gate: this is prose restating an
implementation name, and the repo's standing decision for that axis is to fix
the data, not to guard the prose (see PRs #309, #310, #312–#315).

Verified on the branch tree: `cargo test` 417 passed / 0 failed (unchanged
baseline), `cargo fmt --check` and `cargo clippy --all-targets -D warnings`
both clean. The other claims on the same line were re-checked and are still
true (`version` ← `env!("CARGO_PKG_VERSION")`, the five `uptime_*` fields,
`split_uptime`, `fmtUptime`'s top-two-nonzero units, `ops.uptime.*`,
`today_hours` zero-filled 0–23). The one remaining occurrence of the old
wording (`:1084`) is the C2158 section quoting it as history and is left
untouched.
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