Group consecutive images into a Telegram-style mosaic #11

Open
opened 2026-10-04 20:24:59 +00:00 by robocub · 0 comments
Owner

Why

When someone posts several pictures in a row, Telegram shows them as one compact mosaic. Commet shows each picture as its own message in a long vertical column, at inconsistent sizes. A four-picture post that takes one screen in Telegram takes three or four in Commet. In a side-by-side comparison of the same four-picture post, Telegram fits it in a 2+2 grid about one screen tall; Commet stacks four separately sized pictures in a single column. (The comparison screenshots show a real person's posts, so they are not attached to this public issue.)

What exists

  • On Matrix every picture is normally its own event (m.image), and that is what bridges like mautrix-telegram send for a Telegram album.
  • Commet renders one event at a time. Within a single event, attachments go into a plain Wrap (timeline_event_view_attachments.dart), so nothing ever lays out pictures from different events together.
  • Consecutive messages from the same sender already collapse the name and avatar (shouldShowSender in timeline_event_view_message.dart), so the timeline already knows about "runs" by one sender.

Plan

  1. Group runs client-side: consecutive image or video events from the same sender, sent within about a minute of each other, with no text messages in between, and not replies or thread messages. Render them as one block.
  2. Mosaic layout like Telegram: rows sized from each picture's aspect ratio. Use info.w/info.h from the event so the layout doesn't jump while images load. Cap at about 10 tiles per block; the rest becomes a "+N" tile.
  3. Keep per-picture actions: each tile is still its own event. Long-press or right-click a tile for that picture's menu (reply, react, save, delete). Reactions show on the tile they belong to.
  4. Viewer: tapping a tile opens the full-screen viewer with swipe or arrow keys across the whole group.
  5. Galleries in one event: also render the proposed m.gallery msgtype (MSC4274, open, unstable prefix per the MSC) the same way, so galleries sent by clients that support it display properly.
  6. A setting to turn grouping off.

Acceptance

  • Four pictures posted together through the Telegram bridge render as one compact block, laid out like the Telegram screenshot.
  • Replying to or reacting on one picture in the block still targets that one event.
  • Pictures posted minutes apart, or with a text message between them, are not grouped.

Filed with LLM assistance. This is a fork-only issue; never refile it on Commet's tracker.

## Why When someone posts several pictures in a row, Telegram shows them as one compact mosaic. Commet shows each picture as its own message in a long vertical column, at inconsistent sizes. A four-picture post that takes one screen in Telegram takes three or four in Commet. In a side-by-side comparison of the same four-picture post, Telegram fits it in a 2+2 grid about one screen tall; Commet stacks four separately sized pictures in a single column. (The comparison screenshots show a real person's posts, so they are not attached to this public issue.) ## What exists - On Matrix every picture is normally its **own event** (`m.image`), and that is what bridges like mautrix-telegram send for a Telegram album. - Commet renders one event at a time. Within a single event, attachments go into a plain `Wrap` (`timeline_event_view_attachments.dart`), so nothing ever lays out pictures from *different* events together. - Consecutive messages from the same sender already collapse the name and avatar (`shouldShowSender` in `timeline_event_view_message.dart`), so the timeline already knows about "runs" by one sender. ## Plan 1. **Group runs client-side:** consecutive image or video events from the same sender, sent within about a minute of each other, with no text messages in between, and not replies or thread messages. Render them as one block. 2. **Mosaic layout like Telegram:** rows sized from each picture's aspect ratio. Use `info.w`/`info.h` from the event so the layout doesn't jump while images load. Cap at about 10 tiles per block; the rest becomes a "+N" tile. 3. **Keep per-picture actions:** each tile is still its own event. Long-press or right-click a tile for that picture's menu (reply, react, save, delete). Reactions show on the tile they belong to. 4. **Viewer:** tapping a tile opens the full-screen viewer with swipe or arrow keys across the whole group. 5. **Galleries in one event:** also render the proposed `m.gallery` msgtype (MSC4274, open, unstable prefix per the MSC) the same way, so galleries sent by clients that support it display properly. 6. A setting to turn grouping off. ## Acceptance - Four pictures posted together through the Telegram bridge render as one compact block, laid out like the Telegram screenshot. - Replying to or reacting on one picture in the block still targets that one event. - Pictures posted minutes apart, or with a text message between them, are not grouped. --- _Filed with LLM assistance. This is a fork-only issue; never refile it on Commet's tracker._
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
robocub/vommet#11
No description provided.