ovis icon indicating copy to clipboard operation
ovis copied to clipboard

Chat: show a tool's pictures as small thumbnails on its work line, without opening the row

Open mattmarcin opened this issue 1 month ago • 0 comments

Problem

When Claude Code reads a screenshot or takes one with a browser tool, I want to glance at the picture in Chat the way the Claude desktop app shows it. Since #1935, Ovis has these pictures: a Claude tool part carries images refs, and GET /api/pane/conversation/image serves them. But Chat draws them only inside an opened work row (ToolImages under {open && ...} in src/components/ChatView.tsx), and rows start closed. A settled turn's work block is folded too, so a screenshot the agent looked at is two clicks away and easy to miss. In practice I don't see the pictures at all unless I go looking for them.

In my own Claude Code transcripts, pictures in tool results are common: Read of a PNG, mcp__plugin_playwright_playwright__browser_take_screenshot and other browser screenshot tools. Load-on-open came from pi's tool images (#262), to keep base64 out of every poll. Since #1935 the conversation response carries refs only, and Claude refs are served private, max-age=86400, immutable, so that reason no longer holds for showing a few small thumbnails.

Proposal

Follow the Claude desktop app's three steps:

  1. On the line. A work block whose tools returned pictures shows them as small thumbnails (about 40x24 px) at the right end of its header line, folded or open: Read 2 files ▸ [▪][▪]. An opened row shows its own pictures the same way on its line. The thumbnails sit beside the header button, not inside it, so a click on the text still folds or unfolds.
  2. On hover or focus. A larger preview (about 320x180) shows the picture with the tool's name and 1 of 2. On touch there is no hover; a tap goes straight to step 3.
  3. On click. The existing image viewer opens on all of the block's pictures at the one clicked. It already has the name, n of count, the arrows, zoom, copy and download.

Edge cases:

  • Many screenshots in one block (computer-use loops): show the latest 4 and a +N tile, so the line never wraps; the viewer still steps through all of them.
  • Bytes: thumbnails load only for rows the virtualized timeline mounts, with loading="lazy", and each picture is fetched once per browser. No server, endpoint or wire change.
  • A picture that fails to load shows nothing on the line rather than a broken image; it is still listed in the opened row as today.
  • The opened row's existing gallery stays.

I'd update scripts/claude-image-browser-qa.ts and scripts/pi-image-browser-qa.ts, which assert today that nothing is fetched before the row opens, and add a unit test for which pictures a block shows.

This is a UI follow-up to #992 (the Claude Code part landed in #1935), not one of its five PRs.

Where

Chat and prompt cards

Where it exists today

The Claude desktop app (Claude Code in it): a folded Read 2 files group shows tiny thumbnails at the right of its line; hovering one shows a larger preview labeled Read and 1 of 2; a click opens a full-screen viewer with < 1 of 2 >.

Workarounds and alternatives

  • Open each work row by hand to find the pictures (two clicks per block, and I have to know which one to open).
  • Open the file path from the output in the file viewer (#691), which only works when the path is printed and the file still exists.
  • Alternative: thumbnails only on an opened block, not a folded one. Less noise, but a settled turn would still hide what the agent saw, which is the main case.

mattmarcin avatar Oct 25 '26 19:10 mattmarcin