feat(realtime): live refresh affordance for /inbox and /activity (LC-179) #224
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-179-live-inbox-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?
Closes LC-179, the final surface of the LC-156 live-updates epic.
/inbox(infinite-scroll) and/activity(tab-filtered) carry per-connection view-state the WS server cannot see, so a full-list OOB swap would clobber scrolled pages or the wrong tab. Per the chosen approach, each page gets a lightweight refresh affordance (the standard pattern for paginated/filtered live lists): a bar that is hidden on load, revealed over the WS when new content arrives, and reloads the current URL on click (preserving inbox ordering / the active activity tab vialocation.reload()).Changes
InboxRefreshFragment/ActivityRefreshFragment: tiny OOB reveals that swap a shown variant over#lc-inbox-refresh/#lc-activity-refresh. The id exists only on the respective page, so connections elsewhere drop the swap./inbox:render_new_message_or_bumpappends the inbox reveal to its existing background-recipient (unread-badge) branch - reuses the current fan-out, no new broadcast, no per-message full re-render (the amplification the issue warned about)./activity: theMentionedarm (recipient) appends the activity reveal, regardless of toast-mute (a muted mention still enters the activity feed). Reuses the existingbroadcast_to_user(mentioned_user).Scope note
The activity reveal fires on mentions (the activity event that has a per-user broadcast). Replies/reactions to one's own messages also populate the feed but have no per-user event today, so they don't trigger the bar; a future per-user reply/reaction signal could extend it. Reminders aren't in the activity feed, so they don't reveal it.
Verification
just testandjust test-saasboth green (106test result: okeach, zero failures);cargo clippy/cargo fmtclean. Regression tests (routes_inbox::inbox_has_hidden_refresh_bar,routes_activity::activity_has_hidden_refresh_bar) assert both pages render the refresh bar hidden on load.