feat(ui): mark all as read - clear unread across every conversation (LC-250) #302
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-250-mark-all-read"
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
Implements LC-250 (subtask LC-251). A "Mark all as read" control in the sidebar footer clears the viewer's unread message badges (rooms + DMs) and the paired mention chips in one action, refreshing the sidebar - the acting tab via the swap response, other tabs live.
Implementation
POST /read-all(routes::read_all): collects the distinct room ids the viewer has unread in (union oflist_room_unread_countsadmin-aware,list_dm_unread_counts,count_unread_mentions_per_room); for each, advances the watermark to the room's latest message (set_last_read) and clears its mentions (mark_mentions_read_for_room) - mirroring open-one exactly so the two paths converge. Best-effort per room; idempotent (upsert_dm_readkeeps the max).sidebar_categories::render_sidebar_fragment(nowpub(crate), enclave-aware throughHX-Current-URL). Other tabs refresh via a newChatEvent::ReadAllChanged(broadcast_to_user) whose WS arm re-renders the sidebar;render_eventreturns None for it.db::chat::latest_message_id(room_id).partials/sidebar.html): a "Mark all as read" form in the footer link group.Scope
Global mark-everything-read button for v1; a per-room mark-read affordance is a follow-up. Mentions are cleared alongside unread (matches open-one) and remain in
/inbox+/activity.Tests
routes_read_all.rs: seeds a room + DM with unread plus a mention row, POSTs/read-all, asserts unread counts and mentions are zero and the response is the sidebar; plus an idempotency check. The live cross-tab refresh is WS-driven (manual QA in LC-251).just testandjust test-saasgreen; clippy + fmt clean.No operator-visible surface, so no
[operator-action]marker.🤖 Generated with Claude Code