Skip to content

feat(composer): support link previews on message edit (Option B, follow-up to #5245) #5273

Description

@tellaho

Context

Follow-up to PR #5245 (link-preview snapshot/send race fix). That PR chose Option A: edit mode is excluded entirely from link-preview resolution, upload, and Save-gating — editing a message shows no card, no spinner, and cannot add or change a link preview.

Option B is the deferred alternative: let message edits add, replace, or remove link-preview snapshots, carrying snapshot tags through the edit path end-to-end.

Scope

  • Carry snapshot tags through submitMessageEdit.ts so an edit can persist new preview tags.
  • Edit-transport tag-split in hooks.ts (whatever splits edit tags from content on the wire).
  • Timeline overlay merge in formatTimelineMessages.ts so an edited message's preview tags override the original's.
  • Replacement/removal overlay rules: editing a link out should drop its preview; changing the link should swap the snapshot.
  • Re-enable useComposerLinkPreviews in edit mode (Option A currently disables it via editTarget == null) with the same debounce, per-media degrade, and submit-guard behavior as normal send.
  • Edit-mode e2e coverage mirroring the normal-send tests: resolve-on-edit, upload-failure degrade, remove-link-drops-preview.

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions