feat(ui): forward a message to another room or DM (LC-278) #317
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-278-message-forwarding"
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?
What
Adds a "Forward" hover action on messages (LC-278). It opens a destination picker - the viewer's post-able rooms + their DM conversations, filterable, excluding the source - and forwarding reposts the message into the chosen destination with a "Forwarded from " attribution, appearing live there.
Per the scoping decision: v1 carries text + attribution (not attachments); destinations are rooms + DMs.
How
routes::forward:GET /messages/{id}/forwardrenders the picker modal (rooms vialist_rooms+ DMs vialist_user_dm_rooms, peer labels resolved, blocked peers and the source conversation excluded). Source read-access is gated.POST /messages/{id}/forward/{dest_room_id}builds the forwarded body as a Markdown blockquote (attribution header + the original body, each line quoted), caps toMAX_MESSAGE_CHARS(LC-153),insert_messages it, and broadcasts via the existingfinalize_message_sendso it fans out like a normal post. Gated end to end and re-checked on POST: read access on the source; banned/muted, room access,can_post_with_policy, andis_blocked_either_wayfor DM destinations.message.htmlgains the Forward button (after Remind);layout.htmlgets a singleton#lc-forward-modalslot. The picker mirrors the reminders modal (focus trap, Escape/backdrop close, confirm fragment) and reuses the LC-274-style data-attr filter.A dedicated
forwarded_fromschema column was rejected for v1 - the blockquote attribution reuses the entire post/render/broadcast path with zero schema change. No new env. Not operator-visible.Tests
routes_forward: forward lands in the destination with attribution; destination access gate returns 403; picker lists destinations and excludes the source room. The four LC-77 golden fixtures are regenerated for the new Forward button (diff is exactly that one button).just testandjust test-saaspass.QA note
Server-gated and test-covered. The picker + confirm are JS-driven, so worth a manual pass: Forward a message, filter the list, pick a room (confirmation shows, the message appears live in that room with the "Forwarded from" quote); pick a DM; confirm Escape/backdrop/Close dismiss; confirm forwarding into a read-only or inaccessible room is refused; confirm the source conversation is absent from the list.