Skip to content

Image edition before sending: crop and rotate.#6842

Open
bmarty wants to merge 9 commits into
developfrom
feature/bma/imageEdition
Open

Image edition before sending: crop and rotate.#6842
bmarty wants to merge 9 commits into
developfrom
feature/bma/imageEdition

Conversation

@bmarty
Copy link
Copy Markdown
Member

@bmarty bmarty commented May 22, 2026

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
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 22, 2026

📱 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/Cx16uS

@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

❌ Patch coverage is 70.38082% with 210 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.16%. Comparing base (00efd9a) to head (6e74446).
⚠️ Report is 1 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 81.78% 47 Missing and 8 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.16%   -0.09%     
===========================================
  Files         2652     2657       +5     
  Lines        74373    75039     +666     
  Branches      9641     9735      +94     
===========================================
+ Hits         60432    60908     +476     
- Misses       10381    10534     +153     
- Partials      3560     3597      +37     

☔ 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.

…etection to the parent node and offsetting the touch events
@sonarqubecloud
Copy link
Copy Markdown

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