Repository navigation
🤖 feat(ios): pasting an image into the composer's field attaches it - #8252
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Summary
With an image on the clipboard, the composer's text field now offers Paste, and pasting attaches the image the same way the paperclip's Paste Image does. Pasting text works as before.
Closes #8250
Implementation
pasteDestination(for: PastedImage.self). iOS 27 is the first release with paste destinations on iPhone. On iOS 26 the field stays as it was, and the paperclip's Paste Image is still the way in there.PastedImage(Kit/Attachments.swift) is aTransferablethat imports PNG first, then JPEG, then any other image. An item that only says "image" is typed by its bytes (ImageIO). PNG goes first so a screenshot copied with a JPEG beside it stays lossless. Text-only items match no representation, so the field still pastes text itself.onPick), so it doesn't take image pastes.Validation
PastedImageTestsimport realNSItemProviders through theTransferable: PNG wins over JPEG, JPEG-only stays JPEG, TIFF keeps its type, text-only gives no image, and the file names and media types for one and for several images.Screenshots
Left: main, image on the clipboard, the field offers only AutoFill. Middle: this branch offers Paste. Right: after Paste, the image is attached.
Risks
Low. On iOS 27 the field gets one more paste destination, which only accepts images. I couldn't check two paths in the simulator: the keyboard's paste suggestion (simulated taps on the suggestion bar did nothing, for text too) and Cmd-V from a hardware keyboard.
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$399.06