Skip to content

Support gallery messages#6519

Draft
bxdxnn wants to merge 1 commit intoelement-hq:developfrom
bxdxnn:feature/gallery-messages
Draft

Support gallery messages#6519
bxdxnn wants to merge 1 commit intoelement-hq:developfrom
bxdxnn:feature/gallery-messages

Conversation

@bxdxnn
Copy link
Copy Markdown
Contributor

@bxdxnn bxdxnn commented Apr 2, 2026

Content

Support sending and rendering gallery messages (a message with multiple photos)

Motivation and context

Screenshots / GIFs

Screenshot

Tests

  • Test that sending works
  • Test that rendering works

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 2, 2026 11:38
@bxdxnn bxdxnn requested review from bmarty and removed request for a team April 2, 2026 11:38
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 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 2, 2026
@bxdxnn
Copy link
Copy Markdown
Contributor Author

bxdxnn commented Apr 2, 2026

@americanrefugee please review the design. Particularly:

  • How to make a better border between tiles?
  • What should be the border radius of the message? You can see on the screenshot, the bottom-right corner that "connects" messages doesn't look good.
  • More complex, but please test the logic of handling landscape/portrait messages in a gallery and if any changes are needed.
  • Tapping on a picture in the gallery will allow viewing/swiping only the pictures of the gallery, but in a non-gallery message, you can see all pictures.

@americanrefugee
Copy link
Copy Markdown

I think we're are already working on this feature for iOS. cc @Velin92

@americanrefugee
Copy link
Copy Markdown

@bmarty we should coordinate to make sure the same thing is applied to Android.

@mxandreas
Copy link
Copy Markdown
Contributor

How has been this accomplished? To make it work cross-platform and interoperable with other clients, it needs to use a MSC like this matrix-org/matrix-spec-proposals#4274 ? Is this the intention?

Also, this clearly needs support on all 3 platforms Web, iOS and Android before it can be generally released.

@bxdxnn
Copy link
Copy Markdown
Contributor Author

bxdxnn commented Apr 8, 2026

How has been this accomplished? To make it work cross-platform and interoperable with other clients, it needs to use a MSC like this matrix-org/matrix-spec-proposals#4274 ? Is this the intention?

Also, this clearly needs support on all 3 platforms Web, iOS and Android before it can be generally released.

SDK already supports gallery messages:
matrix-org/matrix-rust-sdk#4977
matrix-org/matrix-rust-sdk#5125

@mxandreas
Copy link
Copy Markdown
Contributor

SDK already supports gallery messages:

Ok, that clarifies the technical approach. My suggestion is that if we want to move forward, we need to first confirm, if there is capacity to implement this also for Web. If Rust SDK supports it, I am guessing it may not be such a lot of effort for iOS. However, Web is not using Rust SDK, thus needs to be checked first.

If all of that looks feasible then we still need to figure out the designs, but I think we're able to do that if there if there is confirmation it to be done on all 3 platforms.

@bxdxnn bxdxnn marked this pull request as draft April 11, 2026 19:08
@bxdxnn
Copy link
Copy Markdown
Contributor Author

bxdxnn commented Apr 11, 2026

If all of that looks feasible then we still need to figure out the designs, but I think we're able to do that if there if there is confirmation it to be done on all 3 platforms.

I was able to do a POC Web implementation, do I need an iOS PR too for this feature to proceed with the design?

@mxandreas
Copy link
Copy Markdown
Contributor

I was able to do a POC Web implementation, do I need an iOS PR too for this feature to proceed with the design?

It is sufficient if we know that you want and can do it on iOS. Which I understand is the case, correct? @americanrefugee can you look into the designs?

A couple of notes:

  1. The MSC is built so that you can have one caption per gallery.
  2. The MSC works for images/videos but also files (attachments). It would be great to support it for all types - there's less confusion, e.g. another client may send you a gallery of files, and if you do not support rendering it (while we support rendering images), it is confusing.
  3. Currently if you open an image/video or an attachment from timeline - you can swipe left/right to go to the previous/next in the room - if now the item is part of a gallery, should such browsing be limited to the gallery items only, or you would be able to "exit" the gallery and see items which are before and after? I think yes.

@americanrefugee
Copy link
Copy Markdown

Here's some direction for the media gallery in a timeline...

THE EXAMPLE BELOW IS ONLY FOR ANDROID

  • For iOS, the logic is exactly the same, but the fonts are specific to iOS
  • This is NOT for Web (yet to be designed)

Context

Here's an example of multiple media items uploaded to a timeline, with and without a caption:

Timeline - Images uploaded - Sent - With caption Timeline - Images uploaded - Sent - No caption

Gallery item preview

Here's an example of images or video gallery items, including overflow, in Light and Dark themes:
Media Preview

Full gallery

And here's an example of the various gallery groupings with 1, 2, 3, 4, 5, and 5+ items:

Media group gallery
  • Spacing between items = 4px
  • Corner radius for the whole group = 6px

@bxdxnn bxdxnn force-pushed the feature/gallery-messages branch from 13a6420 to bb370e0 Compare April 15, 2026 18:52
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.

3 participants