Skip to content

Show preview when sharing media from intent#6545

Open
bxdxnn wants to merge 1 commit intoelement-hq:developfrom
bxdxnn:misc/fix-preview-intent
Open

Show preview when sharing media from intent#6545
bxdxnn wants to merge 1 commit intoelement-hq:developfrom
bxdxnn:misc/fix-preview-intent

Conversation

@bxdxnn
Copy link
Copy Markdown
Contributor

@bxdxnn bxdxnn commented Apr 7, 2026

Content

Motivation and context

Fixes #6540

Screenshots / GIFs

Tests

  • Share a media using the Android sharing intent

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

@bxdxnn bxdxnn requested a review from a team as a code owner April 7, 2026 15:56
@bxdxnn bxdxnn requested review from ganfra and removed request for a team April 7, 2026 15:56
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible:

  • If your pull request adds a feature or modifies the UI, this should have an equivalent pull request in the Element X iOS repo unless it only affects an Android-only behaviour or is behind a disabled feature flag, since we need parity in both clients to consider a feature done. It will also need to be approved by our product and design teams before being merged, so it's usually a good idea to discuss the changes in a Github issue first and then start working on them once the approach has been validated.
  • Your branch should be based on origin/develop, at least when it was created.
  • The title of the PR will be used for release notes, so it needs to describe the change visible to the user.
  • The test pass locally running ./gradlew test.
  • The code quality check suite pass locally running ./gradlew runQualityChecks.
  • If you modified anything related to the UI, including previews, you'll have to run the Record screenshots GH action in your forked repo: that will generate compatible new screenshots. However, given Github Actions limitations, it will prevent the CI from running temporarily, until you upload a new commit after that one. To do so, just pull the latest changes and push an empty commit.

@github-actions github-actions bot added the Z-Community-PR Issue is solved by a community member's PR label Apr 7, 2026
@bxdxnn

This comment was marked as resolved.

@frebib
Copy link
Copy Markdown
Contributor

frebib commented Apr 7, 2026

Note that this also adds closer parity with iOS too

@bxdxnn
Copy link
Copy Markdown
Contributor Author

bxdxnn commented Apr 7, 2026

Note that this also adds closer parity with iOS too

Good! What's the preview/send order in iOS?

@frebib
Copy link
Copy Markdown
Contributor

frebib commented Apr 7, 2026

Note that this also adds closer parity with iOS too

Good! What's the preview/send order in iOS?

On the iPad we have it's user selection then preview

@bxdxnn bxdxnn force-pushed the misc/fix-preview-intent branch 2 times, most recently from 86568ec to 1eacb2a Compare April 7, 2026 17:06
Copy link
Copy Markdown
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

Thanks. We already have a media preview screen, but it is in the :features:messages:impl module. Maybe a first step would be to extract this existing code to its own module and then reuse it. It has more features, and it will reduce code duplication.

Comment thread features/share/impl/build.gradle.kts
@bxdxnn bxdxnn force-pushed the misc/fix-preview-intent branch from 1eacb2a to 2b8a20e Compare April 8, 2026 14:25
@bxdxnn
Copy link
Copy Markdown
Contributor Author

bxdxnn commented Apr 8, 2026

Thanks. We already have a media preview screen, but it is in the :features:messages:impl module. Maybe a first step would be to extract this existing code to its own module and then reuse it. It has more features, and it will reduce code duplication.

Is it required for this PR? It seems to be very complex to fully extract that functionality then share it, or do you want to only extract the View?

@bmarty
Copy link
Copy Markdown
Member

bmarty commented Apr 8, 2026

Thanks. We already have a media preview screen, but it is in the :features:messages:impl module. Maybe a first step would be to extract this existing code to its own module and then reuse it. It has more features, and it will reduce code duplication.

Is it required for this PR? It seems to be very complex to fully extract that functionality then share it, or do you want to only extract the View?

Ideally yes. Maybe do a separate PR that just extract the code with the Preview to its own api / impl module. The messages module is too big anyway. Moreover, features like editing image before sending would land to the new :features:mediapreview:impl module. I can take a quick look on how hard this could be.

@mxandreas
Copy link
Copy Markdown
Contributor

mxandreas commented Apr 9, 2026

FWIW, on iOS the preview screen to enter the caption is always shown.

When sharing, there are 2 paths:

  1. You can immediately select a DM or a room from the OS share sheet (it is populated with the most frequent/recent ones across your different apps, e.g. Element, WhatsApp, etc.). In this case you do not need any further DM/room selection.
  2. You can also just choose the app, in which case EXI will provide the user with a list of rooms to choose from. See screenshot below.
IMG_8992

(It seems like this is very similar on Android as well, although I could not test path #1 as the OS did not offer any Element chats, perhaps because I haven't used it frequently).

@bxdxnn
Copy link
Copy Markdown
Contributor Author

bxdxnn commented Apr 9, 2026

(It seems like this is very similar on Android as well, although I could not test path #1 as the OS did not offer any Element chats, perhaps because I haven't used it frequently).

This is implemented in #6059 but not merged yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Z-Community-PR Issue is solved by a community member's PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When sharing a picture with the share intent, allow adding a caption before sending

4 participants