fix(web): include images when copying prompts - #8099
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
One interaction regression found in the new clipboard path. See the inline comment.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2cd1af3. Configure here.
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This change introduces a new rich-clipboard workflow that fetches and normalizes attached images before writing them alongside prompt text. Its browser API, asynchronous image-processing, and fallback behavior create meaningful runtime surface area beyond a simple copy bug fix. You can add or adjust custom eligibility rules. Learn more. |

Copying a user prompt with an attached image only placed the text on the clipboard, so pasting into a new thread dropped the image.
The copy action now writes the prompt and first available attachment as one clipboard item. Images are normalized to PNG for browser clipboard support, while unsupported browsers keep the existing text-only fallback.
Proof
Testing
vp test runon the message clipboard, copy hook, and message timeline testsImplemented with GPT-5.6-Sol in the Codex harness inside T3 Code.
Note
Low Risk
Client-only clipboard write with a text fallback. No auth, persistence, or server changes.
Overview
Copying a user prompt with an attachment now writes text and one image as a single clipboard item, so pasting into a new thread keeps the image.
writeMessageToClipboardfetches the preview, normalizes it to PNG, and usesnavigator.clipboard.write. If there is no image, the browser lacks composite clipboard support, or the rich write fails, it still copies text.The copy hook accepts an optional
writeoverride. User timeline copy uses the first attachment with apreviewUrl(regular images first, then preview annotations). Assistant copy is unchanged.Reviewed by Cursor Bugbot for commit 025f7ff. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Include images when copying chat prompts via
MessageCopyButtonwriteMessageToClipboardin messageClipboard.ts to write text plus a PNG image as a singleClipboardItem, falling back to text-only when unsupported or on error.useCopyToClipboardin useCopyToClipboard.ts with an optionalwriteoverride so callers can perform rich clipboard writes while keeping the hook's copied-state and callbacks.previewUrl, else first preview-annotation image) fromUserTimelineRowin MessagesTimeline.tsx intoMessageCopyButton, which uses the new path when an image is present.fetchClipboardImageAsPngrelies onfetch+ offscreen canvas conversion; if the preview URL is cross-origin without CORS headers, the canvas taints and the write fails, silently degrading to text-only copy.Macroscope summarized 025f7ff.