Skip to content

feat(ui): replace point sources with month point changes card - #29

Merged
argszero merged 1 commit into
mainfrom
feat/ui-month-point-changes
Aug 17, 2026
Merged

argszero merged 1 commit into
mainfrom
feat/ui-month-point-changes

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

Replace the dashboard "点数来源 Point sources" card (and the matching wallet card) with "本月点数变化 Month point changes" — a per-type aggregation of the last month's point movements, with a net-change summary. The data source moves from the static D.POINT_SOURCES array to a live aggregation of D.TRANSACTIONS.

Rant reference

Host instruction (rant 2026-08-17T10:45:27, 仪表盘"点数来源"改为"近 1 月点数变化明细"):

宿主指出:仪表盘的"点数来源"卡片不够直观。用户真正关心的是:当前有多少点数 + 最近 1 个月点数变化详情,按类型汇总的收支明细(如:赠送 +10、过期 -8、收益 +200、消费 -100、提现 -100、充值 0 …)。

Changes

  • ui/index.html: dashboard + wallet card retitled to "本月点数变化 Month point changes", ids renamed (dash-point-sources → dash-month-changes, points-sources → month-changes)
  • ui/js/app.js: new renderMonthChanges() aggregates D.TRANSACTIONS by type (赠送 gift / 过期 expire / 收益 earn / 消费 consume / 充值 topup / 提现 withdraw), renders each row with sign and color (positive accent green, negative red) plus a highlighted "本月净变化 Net change" summary row; zero-change types are hidden. Removed pointSourceItem/renderPointSources() and the now-dead D.POINT_SOURCES mutation in confirmTopup()
  • ui/js/data.js: removed the static POINT_SOURCES array (no longer the data source)
  • ui/css/style.css: added .pts.neg (red for negatives) and .mini-item.net (accent highlight for the net row)
  • ui/README.md: synced dashboard / wallet card descriptions

Verification

  • grep -rn "Point sources|POINT_SOURCES|renderPointSources|points-sources|dash-point-sources" ui/ → no functional references
  • Aggregation check vs mock ledger: gift +1, earn +1962, consume -2070.37, topup +5000, withdraw -2000, net +2892.63 (PASS)
  • node --check ui/js/app.js / ui/js/data.js pass
  • cargo test passes (1 passed)
  • cargo fmt --check passes

The dashboard's "点数来源 Point sources" card showed a static point
composition, which users don't find intuitive. Replace it (dashboard and
wallet) with a "本月点数变化 Month point changes" card that aggregates
the last month's point movements by type (gift/expire/earn/consume/
topup/withdraw) with a net change summary. Signs are colored (positive
accent, negative red). Data now comes from D.TRANSACTIONS aggregation
instead of the static D.POINT_SOURCES array (removed). No mechanism
wording (validity, priority) is shown.

Refs: rant 2026-08-17T10:45:27 (仪表盘"点数来源"改为"近 1 月点数变化明细")
@argszero
argszero merged commit 15a26d0 into main Aug 17, 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