feat(stats): personal member-stats recap page (LC-536) #511
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/LC-536-member-stats"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
LC-536: a personal "wrapped" recap. A new Your stats page (
/stats, linked from the sidebar under Kudos) shows the signed-in member their own activity: messages sent, active days, kudos received, reactions received/given, member-since date, and their top 5 channels.Why
The app already tracks all of this (messages, reactions, kudos) but never showed a member their own totals. It is a cheap, self-contained recap on top of existing tables - no new writes, no schema change.
How
Three commits, each compiles + tests green on its own:
Aggregation. New
db::stats::member_stats(chat, user_id)rolls up the counts in a handful of scoped queries. All message-derived figures share onedeleted_at IS NULL AND is_system = 0 AND quarantined = 0predicate so they agree; reactions-received excludes self-reactions; top-channels excludes DMs (room_type != 'dm'). No migration.Page.
GET /stats(auth-gated, self-only - the handler always reads the caller's own id, nothing to privacy-gate) renders a tile grid plus a top-channels list, reachable from a new sidebar link. en + es strings.Tests. Direct aggregation coverage (deleted/other-user messages excluded, self-reaction not counted, DM exclusion, top-channel tally) plus a route smoke test (renders for an authed member; 303 for anon).
Notes
Testing
just check,just test,just test-saasall green.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q1pu1NZoT3Uxb7AcxVyTgu