Skip to content

feat(wallet): transaction table model/key columns + token four-column breakdown (rants 2026-08-22T06:36:54/06:37:50/06:39:04) - #115

Merged
argszero merged 1 commit into
mainfrom
feat/tx-columns
Aug 21, 2026
Merged

argszero merged 1 commit into
mainfrom
feat/tx-columns

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

Transaction history table column fixes (host dev-tested on atp-dev):

  1. Model / Key column showed counterpart user_id (1/2) — now split into two readable columns:
    • Model column: model name (e.g. deepseek-v4-flash); topup/gift/raise rows show the transaction type label instead
    • Key column: key_label from the keys table (note → provider / plan → provider; deleted/missing key → —)
  2. Token usage now four flat columns (instead of one column + sub-line):
    • Input (non-cache) / Input (cache) / Output / Total — same figures the summary bar uses (input = total − cached − output)

Related Rants

  • 2026-08-22T06:36:54 — 「模型 / Key」列显示对端 user_id 错误
  • 2026-08-22T06:37:50 — 拆成模型列 + Key 列两列显示
  • 2026-08-22T06:39:04 — Token 用量拆成四列(输入非缓存 / 输入缓存 / 输出 / 总)

Changes

  • src/routes/wallet.rs: transactions query LEFT JOINs keys → new key_label field per row (note first, else provider / plan, else provider; null when no key); added transactions_key_label test covering note / provider-plan / null paths
  • ui/js/app.js: TX_COLUMNS partner column → model + key; tokens column → input / cached / output / tokens; txsToView builds the new view fields; CSV export updated to the 10 new columns
  • ui/js/i18n.js: zh/en — tx.col.model, tx.col.key, tx.col.input, tx.col.cached, tx.col.output, tx.col.tokens ("总 Token"/"Total")
  • ui/index.html: cache-bust bumped to 20260822-1

Tests

  • cargo test: 139/139 passed (new transactions_key_label + all existing)
  • cargo clippy: clean (-D warnings)
  • cargo fmt --check: clean
  • node --check ui/js/app.js + ui/js/i18n.js: OK

Acceptance

  • Each row shows model name + key label (no more 1/2 counterpart ids)
  • consume/earn rows show the model; topup/gift rows show the type label
  • Four token columns render correctly; legacy rows (cached/output = 0) show input = total
  • Summary bar token stats consistent with the four columns

… breakdown (rants 2026-08-22T06:36:54/06:37:50/06:39:04)
@argszero
argszero merged commit 4a9572f into main Aug 21, 2026
1 check passed
@argszero
argszero deleted the feat/tx-columns branch August 21, 2026 22:59
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