Skip to content

docs(user-stories): name the table that has the table capabilities - #424

Merged
argszero merged 1 commit into
mainfrom
docs/ui-conventions-name-the-table
Oct 20, 2026
Merged

argszero merged 1 commit into
mainfrom
docs/ui-conventions-name-the-table

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

docs/user-stories.md §4 (UI 约定) said:

数据表格支持列筛选、排序、分页、键盘导航与 CSV 导出

Four of those five capabilities belong to one table, so the sentence promises them of all seven. A reader planning to export the member list or the usage report follows it to the admin page and finds no button — the claim is actionable and wrong, not merely loose.

Capability Where it actually lives Evidence
列筛选 / 排序 / 分页 transaction table only buildDataTable() owns all three, and it has exactly one call site: ui/js/app.js:1944
CSV 导出 transaction table only one writer (exportTxCsv), one new Blob in the whole UI, one button (#tx-export-btn)
键盘导航 every data table kbdTbodyOf(e.target) resolves closest("tbody") with no roster; ui/README.md:317 enumerates all seven tbodies plus the JS-built one

The other six tables (mk-body, share-body, api-keys, emp-body, dept-body, model-body, ops-body) render a static header and rows, with a search box and nothing else. ui/README.md:291 already titles its own section "交易记录导出 CSV 约定" — the repository knew the scope; this line was the one place that forgot it.

Related Issue

None — no issue was open for this.

Changes

  • docs/user-stories.md: narrow the subject from 数据表格 to 交易记录表, and give keyboard navigation its own clause because it really is table-generic. Capabilities are kept, not restated differently; no numbers added (this file is not under any gate, and a copied count would only go stale).

Before / after:

-- 数据表格支持列筛选、排序、分页、键盘导航与 CSV 导出
+- **交易记录表**支持列筛选、排序、分页与 CSV 导出;键盘导航(↑/↓ 选行、Enter 主操作、Esc 清除)对任意数据表生效

Measured on what the project ships, not only on main: git show v0.7.33:docs/user-stories.md contains the unchanged line, and git merge-base --is-ancestor c954907 v0.7.33 says the current head is not in that release — the claim is live in the released artifact.

Tests

  • cargo test — 579 passed, 0 failed
  • cargo fmt --check — clean
  • cargo clippy --all-targets — no warnings
  • New tests: not applicable (documentation-only; docs/user-stories.md is outside every gate's FILES — deploy_gate covers compose/config/Dockerfile/both READMEs, readme_gate covers the two READMEs)

Checklist

  • Branch name follows the convention (docs/)
  • Commit message uses Conventional Commits
  • Single purpose, minimal diff (1 file, +1 / −1)

"数据表格支持列筛选、排序、分页、键盘导航与 CSV 导出" reads as a claim
about every data table, but four of those five belong to one table:

- `buildDataTable()` — which owns header sorting, column filters and the
  pager — has exactly one call site (`ui/js/app.js:1944`), the transaction
  table. The other six tables (`mk-body`, `share-body`, `api-keys`,
  `emp-body`, `dept-body`, `model-body`, `ops-body`) get a static header
  and row rendering only; they have a search box and nothing else.
- CSV has exactly one writer (`exportTxCsv`, one `new Blob` in the repo)
  and one button (`#tx-export-btn`), and `ui/README.md:291` already titles
  that section "交易记录导出 CSV 约定".

Keyboard navigation is the exception and is genuinely table-generic:
`kbdTbodyOf(e.target)` resolves `closest("tbody")` with no roster, so
↑/↓, Enter and Esc work on any data table (`ui/README.md:317` lists them
all). Keeping it inside the narrowed sentence would have swapped one
misleading claim for another, so it moves to its own clause.

Narrow the subject; leave the capabilities alone. No gate covers
`docs/user-stories.md`.
@argszero
argszero merged commit c6cb9ae into main Oct 20, 2026
2 checks passed
@argszero
argszero deleted the docs/ui-conventions-name-the-table branch October 20, 2026 13:51
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