feat(realtime): live /saved list on bookmark/unbookmark (LC-178, saved surface) #223
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-178-live-saved"
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?
First surface of LC-178. The /saved page was static-on-load: saving or unsaving a message from a room (or another tab) did not update an open /saved list until reload.
Changes
SavedChanged { user_id }event.post_bookmark/delete_bookmarkbroadcast it viabroadcast_to_user, fanning to every connection of the viewer (per-user fan-out like LC-161/173; no topic needed since#lc-saved-listonly exists on /saved).saved/items.html(shared bysaved/page.htmland the OOB fragment) and wrapped in<div id="lc-saved-list">. The WS send task gatesSavedChangedon the recipient being the owner and swaps#lc-saved-listviaws/saved_live.html; tabs not on /saved have no matching id and drop it.build_saved_rowsis factored out ofget_saved(author-label bulk lookup + per-row context path) and shared with the WS renderer so the live list matches a fresh page load exactly.Out of scope (spun out)
/inbox(unread page list) and/activity(mentions/reminders page list) - different, higher-churn mutation sources (the message/read paths and the Mentioned/Reminder paths respectively), filed as a follow-up.Verification
just testandjust test-saasboth green (106test result: okeach, zero failures);cargo clippy/cargo fmtclean. Regression test (routes_bookmarks::saved_page_renders_live_region_with_the_bookmarked_message) asserts the /saved page renders the#lc-saved-listregion with the bookmarked message, pinning the region + theget_savedrefactor.First surface of LC-178. The /saved page was static-on-load: saving or unsaving a message from a room (or another tab) did not update an open /saved list until reload. - New SavedChanged { user_id } event. post_bookmark / delete_bookmark broadcast it via broadcast_to_user, fanning to every connection of the viewer (per-user fan-out like LC-161/173; no topic needed since #lc-saved-list only exists on /saved). - The saved list body is extracted into saved/items.html (shared by saved/page.html and the OOB fragment) and wrapped in <div id="lc-saved-list">. The WS send task gates SavedChanged on the recipient being the owner and swaps #lc-saved-list via ws/saved_live.html; tabs not on /saved have no matching id and drop it. - build_saved_rows is factored out of get_saved (author-label bulk lookup + per-row context path) and shared with the WS renderer so the live list matches a fresh page load exactly. Out of scope (spun out): /inbox (unread page list) and /activity (mentions/reminders page list) - different, higher-churn mutation sources (the message/read paths and the Mentioned/Reminder paths respectively). Regression test asserts the /saved page renders the #lc-saved-list region with the bookmarked message, pinning the region + the get_saved refactor. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>