feat: Introduce draft message indicator

Merged
DO
3mo ago
+720-55

Proposed changes (including videos or screenshots)

Replaces the experimental "Drafts in sidebar" feature preview with a first-class, always-on draft indicator, and extends draft support to threads.

image image

Previously, rooms with an unfinished message were grouped into a separate Drafts sidebar category, gated behind a feature preview. That preview is removed. Instead, any room with a draft is now marked inline with a pencil icon and its unfinished text is surfaced in the message preview — no category, no preview toggle. Thread-composer drafts are now also persisted and indicated, which they weren't before

Threads

  • Thread-composer drafts for existing threads are persisted to the server per tmid, so an unfinished reply also flags the room and is restored across devices. Drafts for not-yet-created threads stay local only, so they don't flag a room for a thread that can't be opened from the thread list.
  • Added a pencil indicator on each thread in the thread list (contextual bar) that has a draft.
image

How to test

  • Main draft: type in a room's composer without sending, switch rooms → the room shows a pencil icon and Draft: … preview. Clear the composer → indicator disappears.
  • Existing thread draft: open a thread that has replies, type without sending, close it → pencil shows on the room (sidebar) and on that thread in the thread list; it survives a reload/other device.
  • New thread draft: reply in a thread with no messages, type without sending, leave and come back → the composer restores your text, no pencil (thread doesn't exist yet). Send a message → the previously stored text does not reappear.
  • Confirm the old Drafts sidebar category and the "Drafts in sidebar" feature preview are gone.

Issue(s)

Steps to test or reproduce

Further comments

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Added an always-on draft indicator (pencil icon) for rooms and threads with unfinished drafts, including per-thread draft state.
  • Improvements
    • Drafts now take precedence in message previews with HTML-safe rendering.
    • Thread drafts are saved/restored independently when composing in threads.
    • Removed the dedicated “Drafts” sidebar section in favor of the unified indicator.
  • Bug Fixes
    • Clearing empty thread drafts works correctly.
  • Tests
    • Expanded coverage for draft selection and per-thread draft persistence/flush behavior.

CORE-81
CORE-2414