mirror of
https://github.com/block/buzz.git
synced 2026-11-12 12:22:06 +00:00
The message action menu rendered two independent items ("Mark unread"
and "Mark read"), each gated only on prop presence, so both showed at
once. Collapse them into a single DropdownMenuItem whose label, icon, and
handler branch on the clicked message's own read state, mirroring the
existing Follow-thread toggle in the same file.
The read state comes from isMessageUnread — the same computeThreadUnreadMarker
predicate the unread badge uses — so the menu label and badge cannot drift.
Its callback identity now depends on a forcedUnreadVersion counter so a
mark-read/unread re-flows through the memoized message subtree (the
forced-unread overlay is a ref, otherwise invisible to React).
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>