Skip to content

Image edition before sending: crop and rotate.#6842

Merged
bmarty merged 12 commits into
developfrom
feature/bma/imageEdition
May 26, 2026
Merged

Image edition before sending: crop and rotate.#6842
bmarty merged 12 commits into
developfrom
feature/bma/imageEdition

Conversation

@bmarty

@bmarty bmarty commented May 22, 2026

Copy link
Copy Markdown
Member

Content

Follow up for #6363.
See #6363 comments for the specifications. What is implemented today:

Note: this does not bring gallery support, for now only one image can be sent at a time, edited or not.

Extra things:

Motivation and context

Closes #2676

Screenshots / GIFs

See recorded one.

Tests

  • Share an image
  • On the preview click on Edit
  • Play with the edition tools: resize the crop area using the 9 handles, move the crop area, rotate the image. When the image is rotated, the cropped area should remain the same
  • Click on Done
  • Edit again the image: the previous edition is restored
  • Click on Done
  • Send the image
  • The cropped and or rotated image is sent to the room.

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • This PR was made with the help of AI:
    • Yes. In this case, please request a review by Copilot.
    • No.
  • Changes have been tested on an Android device or Android emulator with API 24
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly defines what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • You've made a self review of your PR

kalix127 and others added 4 commits May 21, 2026 15:18
* feat(messages): add crop and rotate before image upload

* Update screenshots

* chore: trigger CI after screenshot update

* fix: resolve detekt violations in image editor and media viewer modules

* fix: require explicit edits param, use plurals for rotation a11y, remove redundant @Inject

* fix: require explicit edits param, use plurals for rotation a11y, remove redundant @Inject

* fix: use semantically correct RotateRight icon for image rotation action

* Update screenshots

* chore: trigger CI after screenshot update

---------

Co-authored-by: ElementBot <android@element.io>
Co-authored-by: Benoit Marty <benoitm@element.io>
Update and add tests
Improve preview
@bmarty bmarty requested a review from a team as a code owner May 22, 2026 10:22
@bmarty bmarty requested review from jmartinesp and removed request for a team May 22, 2026 10:22
@bmarty bmarty added the PR-Feature For a new feature label May 22, 2026
@github-actions

github-actions Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/cJJuBh

@codecov

codecov Bot commented May 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.33766% with 213 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.17%. Comparing base (00efd9a) to head (6cef5ce).
⚠️ Report is 5 commits behind head on develop.

Files with missing lines Patch % Lines
...ments/preview/imageeditor/AttachmentImageEditor.kt 6.38% 88 Missing ⚠️
...s/preview/imageeditor/AttachmentImageEditorView.kt 83.28% 48 Missing and 10 partials ⚠️
...impl/attachments/preview/AttachmentsPreviewView.kt 70.73% 17 Missing and 7 partials ⚠️
...attachments/preview/AttachmentsPreviewPresenter.kt 75.00% 5 Missing and 11 partials ⚠️
...es/impl/attachments/preview/AttachmentMediaInfo.kt 35.29% 8 Missing and 3 partials ⚠️
...mediaviewer/impl/local/AndroidLocalMediaFactory.kt 52.63% 4 Missing and 5 partials ⚠️
.../preview/imageeditor/AttachmentImageEditorState.kt 92.30% 0 Missing and 6 partials ⚠️
...mpl/attachments/preview/AttachmentsPreviewEvent.kt 85.71% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6842      +/-   ##
===========================================
- Coverage    81.25%   81.17%   -0.08%     
===========================================
  Files         2652     2657       +5     
  Lines        74373    75100     +727     
  Branches      9641     9748     +107     
===========================================
+ Hits         60432    60966     +534     
- Misses       10381    10535     +154     
- Partials      3560     3599      +39     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

jmartinesp and others added 2 commits May 22, 2026 16:57
@bmarty bmarty added the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label May 25, 2026
@github-actions github-actions Bot removed the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label May 25, 2026
@sonarqubecloud

Copy link
Copy Markdown

@jmartinesp jmartinesp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works quite well now, thanks!

@bmarty bmarty merged commit 1f3d848 into develop May 26, 2026
32 of 34 checks passed
@bmarty bmarty deleted the feature/bma/imageEdition branch May 26, 2026 08:07
@bmarty bmarty mentioned this pull request May 26, 2026
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR-Feature For a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Basic image editing tools: crop and annotate / markup

4 participants