Skip to content

🤖 feat(ios): pasting an image into the composer's field attaches it - #8252

Merged
ibetitsmike merged 1 commit into
mainfrom
mike/ios-paste-image
Dec 5, 2026
Merged

ibetitsmike merged 1 commit into
mainfrom
mike/ios-paste-image

Conversation

@ibetitsmike

Copy link
Copy Markdown
Collaborator

Xum opened this PR on behalf of Mike.

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

  • The field takes 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 a Transferable that 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.
  • The new chat's composer has no attachments (no onPick), so it doesn't take image pastes.
  • The paperclip's Paste Image is unchanged.

Validation

  • New PastedImageTests import real NSItemProviders through the Transferable: 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.
  • iPhone 17 simulator (iOS 27.2), PNG on the pasteboard:
    • On main, tapping the caret shows only AutoFill.
    • On this branch, the edit menu shows Paste, and Paste attaches the image.
    • With text on the pasteboard, Paste inserts the text and adds no attachment.

Screenshots

Left: main, image on the clipboard, the field offers only AutoFill. Middle: this branch offers Paste. Right: after Paste, the image is attached.

Main offers only AutoFill; this branch offers Paste; after Paste the image shows in the composer's attachment strip

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

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review
@codex security review

Head: e73c92f

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-05T16:06:16.189937Z e73c92f Manual request
🔒 Security Review ✅ Completed 2026-12-05T16:08:53.880348Z e73c92f Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: e73c92fe3d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: e73c92fe3d

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ibetitsmike
ibetitsmike merged commit 7476cb2 into main Dec 5, 2026
32 of 33 checks passed
@ibetitsmike
ibetitsmike deleted the mike/ios-paste-image branch December 5, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🤖 iOS: pasting an image into the composer's text field does nothing

1 participant