Skip to content

[Contribution Approval] Grouped Media Grid #3648

Description

@AndusDEV

Feature Description

Summary

Group consecutive media events (images/videos) sent by the same user within a short time into a single cohesive grid bubble (similar to WhatsApp / Telegram / Messenger) rather than displaying them as full-width individual media.

Proposed Technical Design

  1. Client-side Grouping (No custom Matrix events):

    • Keep Matrix event sending unchanged (m.image, m.video) to preserve compatibility with all Matrix clients.
    • Group events at the client level, similar to how state events are collapsed.
  2. Grouping Rules:

    • Same sender
    • Same thread / room context
    • Consecutive media events without text or other visible events between them
    • Reusing existing message-grouping time threshold (e.g., within 5 minutes)
  3. UI & Layout:

    • 1 item: Standard media view
    • 2 items: 2-column side-by-side or stacked split
    • 3 items: 1 large leading preview + 2 stacked previews
    • 4 items: 2x2 grid
    • 5+ items: 2x2 grid with a shaded overlay and +N indicator on the 4th thumbnail
  4. Interaction:

    • Tapping an individual thumbnail directly opens the existing ImageViewer focused on that specific event, allowing normal swipe navigation through the timeline
    • Long-press context menu (reaction, reply, info) would default to the last media in the group

Rationale

Sending multiple photos or videos currently clutters the chat with individual, full-width message bubbles, pushing earlier messages off-screen and requiring excessive scrolling. Grouping consecutive media into a compact grid will keep the conversation readable, reduce visual spam, and deliver a much cleaner, more convenient messaging experience found in other modern chat apps.

Mockup

No response

Additional Context

No response

Activity

  1. changed the title [-][Contribution Approval] Grouped Media Grid in Chat Timeline[/-] [+][Contribution Approval] Grouped Media Grid[/+] on Sep 23, 2026
  2. krille-chan commented on Sep 23, 2026

    @krille-chan
    Owner

    Thank you very much :-) Sounds good to me. I think the most challenging part of this is the combining of multiple events into one. There is also one other thing we need to think about: What about if we address a single event ID. Like what happens if we have 2+ image events in a row which we wanna display combined, but we open a link with event-ID so we wanna scroll to the Event A or Event B. Then both should lead to the same combined representation widget. How can we solve that, without adding too much complexity? Maybe adding another rule that if scrollToEventIdMarker is on an event we also do not combine this event with other images.

    Another challenge: What if we wanna interact with only one of the images. e.g. we want to delete one of the images but not the other ones. or we want to reply to one of them or something else. -> maybe a simple fix would be to not display images as combined if we are in select mode?

  3. ZoftTy commented on Sep 23, 2026

    @ZoftTy

    This is already implemented in Element X Android using MSC4274 (Inline media galleries via msgtypes).

    See Element X Android PR:
    element-hq/element-x-android#6519
    element-hq/element-x-android#7112

    So this could potentially be implemented using the existing MSC rather than client-side grouping of separate m.image / m.video events.

  4. AndusDEV commented on Sep 23, 2026

    @AndusDEV
    ContributorAuthor

    It is indeed worth checking out. I'll look into it, and we'll need to wait for @krille-chan to respond anyway to approve this idea

  5. krille-chan commented on Sep 23, 2026

    @krille-chan
    Owner

    @ZoftTy thank you so much, I'll take a look. However it looks like there is no fallback for other clients?

  6. ZoftTy commented on Sep 23, 2026

    @ZoftTy

    Correct. Element X Android currently has no fallback for clients that don't support m.gallery, and the feature is behind a Labs setting.

    Element X version: 26.09.2

    Element X Labs page (image)

    Image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions