Skip to content

Agent: show message image thumbnails and fitted previews - #1612

Merged
AnthonyRonning merged 3 commits into
masterfrom
fix/1607-message-image-previews
Nov 14, 2026
Merged

AnthonyRonning merged 3 commits into
masterfrom
fix/1607-message-image-previews

Conversation

@AnthonyRonning

@AnthonyRonning AnthonyRonning commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Screenshots in sent messages could paint outside their measured bubble and overlap the conversation. Messages now show 72 px image thumbnails above the text; clicking one opens the complete image fitted to the window.

The preview uses the shared dialog motion from #1575 and honors reduced motion. Escape, the backdrop and Close dismiss immediately and restore focus. Attachment buttons support native Enter/Space and Tab with or without Application Vim, and delayed trust prompts wait until the preview closes.

Rebased onto master after #1571, #1573 and #1575 merged. Fixes #1607.

Follow-up from QA (cdccd8b4)

Running the first commit on macOS and stepping through recordings frame by frame found three problems, fixed in the second commit:

  • The send hand-off changed shape. The message being sent drew its pictures as cropped 64 px squares inside the bubble, while the sent message draws 72 px thumbnails above a text-only bubble. When the real row took over, the picture changed place, size and crop in one frame and the thread shifted. The preview now draws through the sent message's own pieces (attachment_row, attachment_thumbnail, attachment_chip), with no bubble for a message of pictures only. A draft keeps a small whole picture beside its square chip (one decode), and the row that takes over shows it until the stored picture loads, so a thumbnail never gives way to a file name.
  • A square picture poked past the thumbnail's rounded corners. The picture now rounds its own corners.
  • A click beside the picture did not close the preview. The preview's card covered 90% of the window and swallowed the click. The card is now the fitted picture.

docs/motion.md records the rule: anything a sent message shows must be drawn the same way in the sending preview.

Follow-up from review (b9124fcf)

The second commit matched a draft's pictures to the row that takes over by count and order. Before a send is acknowledged, that row can be another controller's message in the same task, so a message of theirs with the same number of pictures could briefly show this draft's picture. The message being sent now records each file's stored id when its upload finishes, and a row shows a draft's picture only for a file it names. This also covers the case where another controller's row arrives first: this send's own row still shows its picture from the first frame.

Testing

  • Pre-commit checks on b9124fcf: lint, all workspace tests (desktop app 1,502 passed / 3 ignored) and the extra lanes passed. CI was green on cdccd8b4.
  • New tests: the picture and text keep their size, place and spacing when the row takes over, with reduced motion and on the hand-off frame with motion on; a message of pictures only has no bubble before or after; a click beside the picture closes the preview; one decode gives the square chip and the whole picture without enlarging either; another controller's message never shows this draft's picture, whether this send's files are stored or still uploading (both fail on cdccd8b4).
  • macOS (CI Dev package of cdccd8b4): sends with one picture and text, three pictures and no text, landscape, portrait, square and a 2940x1912 picture; hand-off recorded and stepped through; preview entrance, instant close by Escape, backdrop and beside the picture, no click-through; reopening the task shows thumbnails with no pop.
  • macOS (CI Dev package of b9124fcf): a picture with text sent through the real upload and the hand-off stepped through again; the thumbnail shows in every frame, so the stored ids line up on a real send.
  • Windows 11 ARM64 VM (cdccd8b4 build): attach through the file dialog, send with and without text, thumbnail rendering, preview fit, close by clicking beside the picture.
  • Not exercised: Linux, dark mode, a narrow window live (covered by tests at 480 px), reduced motion live.

Design note

The composer shows attachments as cropped squares; the sent message shows the whole picture letterboxed in a box. This PR keeps the letterboxed look. Hover on a thumbnail only tints the letterbox bands.

🤖 Generated with Claude Code

@AnthonyRonning
AnthonyRonning force-pushed the fix/1607-message-image-previews branch 3 times, most recently from 89226db to 2bb2792 Compare November 14, 2026 16:19
Base automatically changed from codex-gpuibump-motion-core to master November 14, 2026 16:19
@AnthonyRonning
AnthonyRonning force-pushed the fix/1607-message-image-previews branch from 2bb2792 to 99daf9d Compare November 14, 2026 16:19
@AnthonyRonning AnthonyRonning added the ci:package Build unsigned packages on this PR label Nov 14, 2026
AnthonyRonning and others added 2 commits November 14, 2026 10:13
The message being sent drew its pictures as cropped 64 px squares inside
the bubble, while the sent message shows 72 px thumbnails above a
text-only bubble. On the hand-off the picture changed place, size and
crop in one frame, and the thread shifted.

- The preview draws through the sent message's own pieces
  (attachment_row, attachment_thumbnail, attachment_chip), with no
  bubble for a message of pictures only.
- A draft keeps a small whole picture beside its square chip, both from
  one decode. The row that takes over shows it until the stored picture
  loads, so a thumbnail never gives way to a file name.
- The thumbnail's picture rounds its own corners. A square picture poked
  past the box's rounded corners.
- The image preview's card is the fitted picture, so a click beside the
  picture closes it. The card used to cover 90% of the window and
  swallow that click.

Co-Authored-By: Claude <noreply@anthropic.com>
The row that takes over from a message being sent borrowed the draft's
pictures by count and order. Before the send is acknowledged that row
can be another controller's message, so it could briefly show this
draft's picture. The message being sent now records each file's stored
id when its upload finishes, and a row shows a draft's picture only for
a file it names.

Co-Authored-By: Claude <noreply@anthropic.com>
@AnthonyRonning
AnthonyRonning marked this pull request as ready for review November 14, 2026 22:31
@AnthonyRonning
AnthonyRonning merged commit a0cfd4c into master Nov 14, 2026
23 checks passed
@AnthonyRonning
AnthonyRonning deleted the fix/1607-message-image-previews branch November 14, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:package Build unsigned packages on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI bug with screenshots overflowing

1 participant