Feature Description
Description
Users have no way to see a history of how their points/HubCoins changed over time — only the current total is shown. There's no audit trail distinguishing streak points, referral points, CodingVerse rewards, or manual adjustments, which makes disputed or unexpected score changes impossible to investigate (relevant given past issues like #429 stale-state HubCoin overwrites and #427 points-threshold bypass).
Proposed Solution
- Add a
pointsHistory subcollection per user, written to (not overwritten) whenever points/coins change, with fields: amount, source (streak/referral/codingverse/purchase/manual), timestamp
- Add a "Activity Log" tab on the Profile page showing a paginated, chronological list of these entries
- Add a "Export as CSV" button so users can download their own history
Scope
- Backend: refactor all point/coin-mutating writes (streak, referral, CodingVerse, shop) to also append a
pointsHistory entry in the same transaction
- Frontend: new
ActivityLog.jsx component with pagination (reuse existing leaderboard pagination pattern)
- CSV export utility (client-side generation from fetched history)
Impact
- Restores user trust when balances change unexpectedly
- Gives maintainers an audit trail for debugging economy bugs
- Foundation for future anti-cheat/anomaly detection work
Notes
This is a cross-cutting change touching most point-mutating code paths, hence Level 3.
Feature Description
Description
Users have no way to see a history of how their points/HubCoins changed over time — only the current total is shown. There's no audit trail distinguishing streak points, referral points, CodingVerse rewards, or manual adjustments, which makes disputed or unexpected score changes impossible to investigate (relevant given past issues like #429 stale-state HubCoin overwrites and #427 points-threshold bypass).
Proposed Solution
pointsHistorysubcollection per user, written to (not overwritten) whenever points/coins change, with fields:amount,source(streak/referral/codingverse/purchase/manual),timestampScope
pointsHistoryentry in the same transactionActivityLog.jsxcomponent with pagination (reuse existing leaderboard pagination pattern)Impact
Notes
This is a cross-cutting change touching most point-mutating code paths, hence Level 3.