Repository navigation
Done
Labels
androidPrimary Android workenhancementNew feature or requestiosPrimary iOS workpriority: mediumNon-blocking V1 work and polishsharedShared or cross-platform implementationtodoPlanned scope with no implementation started
Description
Images in Session Chat (images you attach, images tools return, and images the agent refers to by path) appear inline as a gallery under the message or tool row that produced them, and open in a viewer that pages through the whole group.
Why: today only a single user-attached image renders inline (220 pt cap, one-image viewer). Images returned by tools are dropped when the message is decoded, and a markdown image keeps only its alt text, so screenshots an agent takes never reach the timeline.
Design (chosen from a UI prototype, "inline mosaic"):
- Consecutive images from one source in a turn form one gallery block placed where the image belongs: under the tool card or tool group, inside your message bubble, and after the paragraph that names a path.
- Layout by count: 1 keeps today's inline image (220 pt cap); 2 side by side; 3 one large plus two small; 4 or more show four tiles with a "+N" overflow on the last.
- Path images show a neutral placeholder while loading and a failure tile with the file name when the fetch fails.
- Tapping any tile opens a viewer that pages through the group: index label, pinch zoom, swipe down to dismiss, share and save.
- Both server protocols (v1 and v2), both apps, same behaviour.
Server facts this relies on:
- v2 tool results carry images as
content[]items oftype: "file"with adata:URL; v1 usesattachments[]on the completed tool state. Neither arrives before the tool completes. (The v1 shape must be confirmed on the scenario harness.) - Images named by path are not in the payload. v2:
GET /api/fs/read/<path>returns raw bytes with anETag. v1:GET /file/content?path=returns base64 JSON. - There is no thumbnail or blob endpoint, so decoding and downsampling are client work. User uploads over 20 MiB are rejected, and the server may re-encode large images.
Constraints:
- Component-first: the gallery and viewer go through the design-system workflow with a presentation-safe API (no domain models, data URLs or bytes in public parameters), with gallery entries on both platforms.
- State goes through the Session Chat Timeline region as immutable UI state plus explicit actions.
- Fetching images the agent merely mentions reads files from the user's machine, so it sits behind a preference.
Acceptance:
- A tool that returns images shows them in the timeline on v1 and v2, on iOS and Android, as soon as the tool completes.
- Your own attachments use the same gallery layout and viewer.
- The viewer pages across the group, zooms, dismisses by swipe, and can share or save the image.
- A group with more than four images shows the "+N" tile and opens the full set.
- Loading and failure states are visible for path images; a failed image never blocks the rest.
- Large groups stay responsive: thumbnails are downsampled off the main thread and decoded images are cached with a memory bound.
- Behaviour is covered by unit tests, snapshot mocks, and a scenario-harness image scenario on both protocols.
Open decisions:
- Default for loading images the agent mentions (on, off, or ask once).
- Placement in the Chips, Step Rail and Activity Card timeline styles (the Standard style is the first target).
- Whether every tool's images show, or only screenshot-style tools.
Remaining:
- Domain: keep tool-result files (v1
attachments, v2content[type=file], REST and live events) on iOS and Android (#898 Show images inline as galleries in Session Chat #911; v1 shape covered by unit tests only, not yet confirmed on a real v1 server) - Gallery component and paged viewer through the design-system workflow, with gallery entries on both platforms (#898 Show images inline as galleries in Session Chat #911)
- Timeline: group consecutive images into a gallery block in the Standard style (tool row, user bubble, assistant text) and decide the other three styles. Standard style done in #898 Show images inline as galleries in Session Chat #911; Chips, Step Rail and Activity Card left
- Path images: markdown keeps the image URL, a path classifier, a v1 and v2 loader, and a "load images the agent mentions" preference
- Evidence: unit tests, snapshot mocks, and a scenario-harness image scenario for v1 and v2
Metadata
Metadata
Assignees
Labels
androidPrimary Android workenhancementNew feature or requestiosPrimary iOS workpriority: mediumNon-blocking V1 work and polishsharedShared or cross-platform implementationtodoPlanned scope with no implementation started
Activity
#898 Keep viewer zoom when the full image replaces the preview; fix o…
#898 Show images inline as galleries in Session Chat (#911)
ivanfenenko commentedon Nov 29, 2026
Tool-result images show as galleries in every timeline style on both platforms (#911, #1097). Not done: path images named in markdown, the 'load images the agent mentions' preference, and the scenario-harness image evidence. These need a new issue if still wanted.