Skip to content

refactor(ui): Deduplicate wallet/transactions pages — ledger merged into Transactions - #8

Merged
argszero merged 6 commits into
mainfrom
refactor/ui-wallet-transactions-dedup
Aug 14, 2026
Merged

argszero merged 6 commits into
mainfrom
refactor/ui-wallet-transactions-dedup

Conversation

@argszero

@argszero argszero commented Aug 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

Deduplicate the Wallet and Transactions pages per host instruction (rant 2026-08-14T15:59:09, 方案 A — merge): the Wallet page previously rendered the same data (D.TRANSACTIONS) with nearly identical columns as the Transactions page, causing user confusion.

Changes

  • Wallet page (view-wallet): removed the 收支明细 Ledger table (wallet-table); now shows only the balance card (points balance + Top up / Withdraw buttons) plus a hint line linking to Transactions (#wallet-goto-tx).
  • Transactions page (view-transactions): remains the single detail entry — Tabs (全部/消费/收益) + MRT table (sort/filter/pagination) unchanged; subtitle expanded to cover 消费(用别人的 key)、收益(别人用我的 key)、充值、提现.
  • Code cleanup: removed WALLET_COLUMNS and the walletTable state; renderWallet now renders balance/buttons only; data.js comment updated (no longer wallet 与 transactions 共用); ui/README.md synced.
  • Dashboard untouched (recent-transactions snapshot kept).

Note: the rants suggested continuing on PR #7's branch, but PR #7 was already merged (d70e032) — these are follow-up UI iterations submitted as a new PR against main.

Follow-up 1 (commit 9aef59a, rant 2026-08-14T16:01:35)

  • Wallet Top up / Withdraw buttons are now disabled (置灰) with a "充值 / 提现暂不支持(即将上线)" note — per host instruction these fund operations are not supported yet.
  • ui/js/app.js: removed the now-dead toast handlers for the disabled buttons; #wallet-goto-tx link remains.

Follow-up 2 (commit d1d3a77, rant 2026-08-14T16:03:11)

  • Admin → Employees: the fixed "+5000 点" button is replaced with a 充值 (Top up) action that prompts for an arbitrary positive integer amount; invalid input (empty / non-integer / ≤0) is rejected with a toast and no change is applied.
  • After a successful topup: employee list + stats (总配额 / 剩余) refresh, success toast shows "已给 {name} 充值 {amount} 点".

Follow-up 3 (commit 801e78c, rant 2026-08-14T16:08:54)

  • Admin → Org management (组织管理): added a department list (部门名 / 成员数 / 月分配点数 / 已用 / 剩余 / 状态) with a summary stat grid (部门数 / 月度总分配 / 已用 / 剩余).
  • Department CRUD: 添加部门 (prompt for name + positive-integer monthly quota, duplicate-name rejected), 编辑 (rename + adjust quota; employee dept fields follow renames), 删除 (confirmation; if the dept has members the confirm warns "该部门有 N 名成员"), 查看 via name search/filter.
  • Data linkage: data.js adds DEPARTMENTS mock (研发/产品/市场/设计 with monthly quota); used/member-count are aggregated live from EMPLOYEES so stats stay consistent.
  • The existing 组织设置 card is kept below the department list on the same page.

Tests

  • node --check passes on ui/js/app.js and ui/js/data.js
  • No residual wallet-table / WALLET_COLUMNS / walletTable / data-emp-add references
  • Dept aggregation sanity-checked in Node (members/used/quota/remain per dept + totals)
  • cargo test passes (1 passed)

Related

Host rants:

  • 2026-08-14T15:59:09 — 钱包页与交易记录页去重 — 明细统一到交易记录,钱包只做余额与资金操作(方案 A)
  • 2026-08-14T16:01:35 — 钱包页"充值/提现"置灰并提示暂不支持
  • 2026-08-14T16:03:11 — 管理视图 — 管理员可给任意成员充值(直接增加点数,任意金额)
  • 2026-08-14T16:08:54 — 管理视图 · 组织管理 — 部门列表 + 部门 CRUD + 每月点数分配

Follow-up 4 (commit d72389a, rants 2026-08-14T16:10:26 + 2026-08-14T16:11:11)

  • Member dept change (改部门): each employee row now has a 改部门 action (next to 充值) that opens an inline dropdown in the dept cell; options come live from DEPARTMENTS plus an 未分配 (unassigned) entry; confirm updates the employee's dept and refreshes the list/stats with a toast ("已把 {name} 调整到 {dept} 部门 / 未分配").
  • Unassigned-dept model (新成员默认不属于任何部门): employee dept may now be empty — rendered as a gray 未分配 placeholder; mock EMPLOYEES gains two unassigned new-registration members (赵欣, 王磊); the 改部门 dropdown can remove a member from any dept (set 未分配); department member-count/used stats exclude unassigned members (org pane shows "未分配 N 人" when any), and the employees stat grid now shows a dynamic dept count + unassigned count; top-up works for unassigned members as before (not dept-dependent).

Follow-up 5 (commit 18827ac, rant 2026-08-14T16:14:33)

  • Settings → API Key full CRUD: the API key list became a table (名字 / Key / 创建时间 / 最近使用 / 状态 / actions) with a name search filter.
  • Create: "生成新 Key" prompts for a name (blank → "未命名"); generates a full atk_live_<hex> id stored in the mock (previously the mock itself stored a truncated id).
  • Read/display: keys are shown masked (atk_live_****xxxx) while the full id lives in the data.
  • Copy: per-row 复制 uses navigator.clipboard.writeText(full id) with a graceful fallback for file:// (temp textarea + execCommand("copy"); if that fails, text is selected and a "Ctrl/Cmd+C" hint toast shows) — success toast "已复制…完整 key 到剪贴板".
  • Update: per-row 改名 prompts for a new non-empty name.
  • Delete: per-row 删除 confirms "删除后该 key 立即失效" then removes the key.
  • ui/README.md updated to mention API Key management capabilities.

argszero added 6 commits August 14, 2026 16:01
- 钱包页移除收支明细表格(wallet-table),保留余额卡片 + 充值/提现 + 跳转提示
- 交易记录页作为唯一明细入口(Tab + 排序/筛选/分页不变),补充说明文案
- 移除 WALLET_COLUMNS 与 walletTable 状态,renderWallet 仅渲染余额/按钮
- data.js 注释更新,不再表述为 wallet 与 transactions 共用
- ui/README.md 同步更新

Rant: 2026-08-14T15:59:09 钱包页与交易记录页去重(方案 A)
- index.html: topup-btn/withdraw-btn 增加 disabled;按钮旁加文案 充值/提现暂不支持(即将上线)
- style.css: .btn:disabled 置灰样式(opacity .5 + cursor not-allowed + pointer-events none);wallet-actions 允许换行
- app.js: 移除 disabled 按钮的 toast 事件绑定(不可点击),保留跳转交易记录绑定

Rant: 2026-08-14T16:01:35 钱包页充值/提现置灰并提示暂不支持
- 员工行固定 '+5000 点' 按钮改为 '充值'(data-emp-topup)
- 点击弹出 prompt 输入任意正整数点数,校验非空/整数/>0,非法 toast 不生效
- 充值后刷新员工列表与统计(总配额/剩余)+ toast 成功提示
- ui/README.md 同步

Rant: 2026-08-14T16:03:11 管理视图 — 管理员可给任意成员充值
@argszero
argszero merged commit b1a075f into main Aug 14, 2026
1 check passed
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