Images: open avatars and banners in the viewer, right-click to Save as… / Copy image everywhere #106

Open
opened 2026-10-08 03:48:11 +00:00 by robocub · 0 comments
Member

Goal: saving an image or putting it on the clipboard is easy, for every image Vommet shows: pictures sent in rooms, and the avatars and banners of people, rooms and spaces.

Wanted behaviour (operator, 2026-10-08)

  1. Click to enlarge avatars and banners, the way space banners already open the viewer (Lightbox): a person's banner and avatar in the DM side panel and profile, space avatars, room avatars.
  2. Right-click (long-press on phones) in the viewer offers Copy image and Save as….
  3. Right-click an image thumbnail in the timeline offers the same.
  4. Rename the message menu's "Download" → "Save as…".
  5. The message menu's Copy on an image currently copies the file name. For image messages, offer Copy image (the picture itself) instead. Copy text stays for text messages and captions.

Findings

  • The viewer: ui/atoms/lightbox.dart (Lightbox.show(context, image: …)), already used by attachments, mosaics, URL previews, space banners and room banners. It has getImage() (a decoded ui.Image).
  • Save: DownloadUtils.downloadAttachment for attachments. Use the original file bytes when there's an attachment, PNG-encode the decoded image otherwise (avatars and banners), and a save dialog via file_picker (already a dependency).
  • Copy image needs native code. The pasteboard package (0.2.0, already used to paste images into the composer) writes images only on iOS: writeImage is a no-op elsewhere. Options: a small method channel in our own runners (Linux: gtk_clipboard_set_image; Windows: SetClipboardData with PNG + DIB), or super_clipboard (all platforms, but adds a Rust-based native dependency with prebuilt-binary downloads at build time). On Android, "Copy image" can be the share sheet (or ClipData with a content URI).

Phases

  1. Pure Flutter (no new dependencies): clickable avatars and banners → viewer; right-click/long-press menus in the viewer and on thumbnails with Save as…; Download renamed to "Save as…"; no more file-name "Copy" on image messages.
  2. Copy image: native clipboard on Linux and Windows (method channel in the runners), share-sheet fallback on Android; wire Copy image into the same menus.

Upstream: no Commet issue or PR for saving or copying images from the viewer (searched 2026-10-08; open PR #1053 touches only the audio/video players).

Goal: saving an image or putting it on the clipboard is easy, for every image Vommet shows: pictures sent in rooms, and the avatars and banners of people, rooms and spaces. ## Wanted behaviour (operator, 2026-10-08) 1. **Click to enlarge avatars and banners**, the way space banners already open the viewer (`Lightbox`): a person's banner and avatar in the DM side panel and profile, space avatars, room avatars. 2. **Right-click (long-press on phones) in the viewer** offers **Copy image** and **Save as…**. 3. **Right-click an image thumbnail** in the timeline offers the same. 4. Rename the message menu's **"Download" → "Save as…"**. 5. The message menu's **Copy** on an image currently copies the file name. For image messages, offer **Copy image** (the picture itself) instead. Copy text stays for text messages and captions. ## Findings - The viewer: `ui/atoms/lightbox.dart` (`Lightbox.show(context, image: …)`), already used by attachments, mosaics, URL previews, space banners and room banners. It has `getImage()` (a decoded `ui.Image`). - Save: `DownloadUtils.downloadAttachment` for attachments. Use the original file bytes when there's an attachment, PNG-encode the decoded image otherwise (avatars and banners), and a save dialog via `file_picker` (already a dependency). - **Copy image needs native code.** The `pasteboard` package (0.2.0, already used to paste images into the composer) writes images **only on iOS**: `writeImage` is a no-op elsewhere. Options: a small method channel in our own runners (Linux: `gtk_clipboard_set_image`; Windows: `SetClipboardData` with PNG + DIB), or `super_clipboard` (all platforms, but adds a Rust-based native dependency with prebuilt-binary downloads at build time). On Android, "Copy image" can be the share sheet (or ClipData with a content URI). ## Phases 1. **Pure Flutter (no new dependencies):** clickable avatars and banners → viewer; right-click/long-press menus in the viewer and on thumbnails with **Save as…**; Download renamed to "Save as…"; no more file-name "Copy" on image messages. 2. **Copy image:** native clipboard on Linux and Windows (method channel in the runners), share-sheet fallback on Android; wire **Copy image** into the same menus. Upstream: no Commet issue or PR for saving or copying images from the viewer (searched 2026-10-08; open PR #1053 touches only the audio/video players).
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
nether/vommet#106
No description provided.