Fix the message edit being lost when attaching media#7090
Conversation
|
Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #7090 +/- ##
========================================
Coverage 80.55% 80.56%
========================================
Files 2711 2711
Lines 78168 78171 +3
Branches 10557 10558 +1
========================================
+ Hits 62969 62979 +10
+ Misses 11126 11117 -9
- Partials 4073 4075 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Sounds good. One problem worth flagging, and the fix is about 2 minutes. Problem: #6519's new Proposal: the same one-line guard, |
|
Hello @manfrommedan , now that #6519 has been merged, can you revisit this PR please? |
Picking an attachment reset the composer to Normal, which dropped an in-progress edit: the attachment went out as a new message and the leftover edit text then created another one instead of editing the original. Route every attach path through a single resetComposerModeAfterAttaching() helper that clears Reply/Normal but keeps an edit pending, so the typed text still edits the original on the next send. This also covers the multi-item gallery picker added in element-hq#6519, which reset the mode unconditionally. Reply is still cleared (the attachment becomes the reply). Fixes element-hq#7083.
da26247 to
55f3a1a
Compare
|
Rebased on #6519. Attaching media no longer drops an in-progress edit: all paths (SendUri, single and multi picker) now go through one reset that clears reply/normal but keeps the edit. Added tests for both, all green. |
Content
Starting an edit and then attaching media (photo, video, file) used to drop the edit. The attachment is sent as a new message, which is expected since a text message can't be replaced by media, but the edit itself was lost, so sending afterwards posted the leftover text as another new message instead of editing the original.
handlePickedMedianow leaves the composer mode untouched while you're editing, so the edit stays active and the text still edits the original message on the next send. Reply mode keeps being cleared, since the attachment becomes the reply.Motivation and context
Fixes #7083.
Screenshots / GIFs
No UI change, this only affects composer state handling.
Tests
MessageComposerPresenterTestcover the edit being preserved across a media pick, and a reply still being cleared.Tested devices
Checklist