feat(activity): activity center at /activity (LC-82) #142
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-82-activity"
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?
Summary
LC-82:
GET /activitylists every event affecting the viewer across rooms - mentions of them, replies to threads they authored, reactions on messages they authored. On-demand UNION over the existingmentions,messages, andmessage_reactionstables; no new tables per the issue's "ship the cheap write path first" recommendation.Routes / UX
GET /activity- All tab.GET /activity?tab=mention|reply|reaction- filtered./{room|dm}/{id}#msg-{message_id}.Query shape
Three SELECTs (one per kind), merged in Rust by
created_at DESC, capped at 60 rows total. Each scopes to rooms the viewer can currently see (r.room_type = 'public' OR EXISTS room_members rm WHERE rm.user_id = ?) so messages from rooms the viewer has since left are hidden (LC-82 AC #6). Self-authored events suppressed (m.user_id != ?/mr.user_id != ?).Acceptance criteria
/activitylists mentions, replies, reactions in time order across rooms the user can see.#msg-N). Mark-read in source room is the existing flow on room open.Stack
Independent of the unmerged stack (
feat/lc-81-jump-and-inboxetc are now merged). Branches off currentmain.Test plan
just check../dev/cargo test -p lets-chat-server --test routes_activity- 2/2 pass (empty state, peer mention appears).Out of scope
activity_read_marks (user_id, kind, source_id, read_at)table; intentionally deferred to keep this PR focused on the read path.On-demand UNION over the existing `mentions`, `messages` (for parent->reply edge), and `message_reactions` tables. No new tables; ships the cheap-write path per the issue's recommendation. Per-item read state and unread badge are follow-ups. `GET /activity[?tab=all|mention|reply|reaction]` returns a server- rendered list of activity rows. Each row: - Mention: someone @-mentioned the viewer in a room they can see. - Reply: someone posted a reply to a thread the viewer authored. - Reaction: someone reacted to a message the viewer authored. All three filter to rooms the viewer can currently see (public or member-of), so messages from rooms the viewer has since left are hidden. Author-of-self events suppressed (viewer reacting to their own message isn't activity). Rows time-DESC, capped at 60 across all kinds. Each row links to `/{room|dm}/{id}#msg-{message_id}`. Tabs UI at top of page; sidebar nav gains an "Activity" link beside Inbox / Saved. Out of scope (open questions / follow-ups): - Per-item read state + unread badge. - Mark-all-as-read per tab. - Realtime push via the hub. - Bot-author filter. - Retention TTL. Tests: empty-state renders the explanatory copy; peer-authored @viewer mention in #general appears in the viewer's activity feed with the expected deep-link.