Repository navigation
fix(composer): say when a pasted image cannot go to this agent (#1250 row 7) - #1426
Conversation
… row 7) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…row 7) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-only pastes; composer wording (#1426 review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review disposition, round 1: reviewers a and b (head
|
| Finding | Disposition |
|---|---|
| b1: an image file plus text dropped the image silently ("see attached" with no attachment) | Fixed: the text still pastes, and the toast says "…only the text was pasted." Only an HTML <img> beside text (a web-page copy) stays silent. |
a2 / b2: an image arriving only as a data-URL <img> in text/html was silent |
Fixed: it counts when there is no text. |
| a3: an image only the async clipboard API shows was silent | Fixed: with nothing else in the event, readImagesFromClipboard is probed. Paste-to-focus's documented miss of this shape is unchanged. |
| b3: the wording blamed the provider (Grok's own TUI takes images) | Fixed: "Pasted images can't be sent to from this composer." |
| a4: provider wording was untested | Fixed: Codex, OpenCode, Grok and Pi are each asserted. |
| a1: Terminal-view panes stay silent | Declined. In Terminal view the paste goes to the provider's own TUI, which owns image handling (Grok's attaches clipboard images). The app's capability flag describes its composer, not the TUI. |
Also: parseImagesFromHtml uses querySelectorAll('img') instead of doc.images. It is identical in a browser, and the happy-dom test DOM lacks images on a parsed document.
Verification:
npx tsc -b: clean.workspace/tile-tree/TileLeaf: 198/198.- Seven of the nine new cases are red on the previous head; the two silent cases (plain text, web-page copy) pass there by design.
🤖 Generated with Claude Code
…ke (#1426 review c) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewer c (MERGE-READY, on the round-0 head) and verification b (MERGE-READY, no findings) at 🤖 Generated with Claude Code |
…er (#1426 verification a) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Verification a: FIX-BEFORE-MERGE, fixed in Round count: round 1 and verification are done, so the review is capped. c and verify b were MERGE-READY. The PR waits for CI and the manager check. 🤖 Generated with Claude Code |
|
Manager verification at
The head is unchanged, so READY follows exact-head CI and 🤖 Generated with Claude Code |
Refs #1250 (row 7). #1250 is a batch issue, so the other rows stay open.
Problem
Only Claude takes pasted images (
supportsImageAttachments). In a Codex, OpenCode, Grok or Pi composer, pasting a screenshot inserted nothing and said nothing.useClaudeImagePaste.handlePastereturned{ handledImages: false }at once, and the textarea's default paste of an image-only clipboard inserts no text.Change
handlePasteshows a pane toast, "Pasted images can't be sent to from this composer.", when the paste carries:<img>intext/htmlwith no text;navigator.clipboard.read()shows.<img>beside its text) and plain text stay silent. The wording names this composer because Grok's own TUI (Terminal view) attaches clipboard images.handledImages: false, so text routing (the textarea andusePasteToFocus) is unchanged.Plan:
docs/plans/2026-09-27-image-paste-unsupported-provider.md.Tests
New
useClaudeImagePaste.renderer.test.tsx: the real hook and real capabilities, with the RECORDED PNG fromtesting/fixtures/image-reads/claude-user-attachment.jsonas the pasted file (the clipboard event is the one stubbed edge).handledImages: false.usePasteToFocus.asyncImage.renderer.test.tsx: an empty paste reaches the handler; text never does.Verification
rm -rf .tsc-out; npx tsc -b: clean.NODE_ENV=test npx vitest run src/renderer/src/workspace/tile-tree/TileLeaf: 201/201.🤖 Generated with Claude Code