Skip to content

feat(browser): paste images into annotation comments and send them to the agent - #36004

Merged
AmoabaKelvin merged 6 commits into
mainfrom
browser-annotation-image-paste
Oct 29, 2026
Merged

AmoabaKelvin merged 6 commits into
mainfrom
browser-annotation-image-paste

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​31 $\color{#cf222e}{\Huge{\mathbf{−}}}$​18 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​13
Prod 12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​229 $\color{#cf222e}{\Huge{\mathbf{−}}}$​43 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​186

ELI5

You can now paste a screenshot into a Design Mode comment. It shows up as a thumbnail under the comment, and when you send the notes the agent gets the image file and opens it.

What Changed

  • Before: pasting an image into the annotation comment box (or into a saved note being edited in the tray) did nothing. Annotations only held text.
  • After: the pasted image is saved on the worktree's host, the same place a terminal image paste goes (local temp dir, or the runtime server for a remote worktree). It appears as a chip you can open or remove. Saved notes show an image count, and Add/Save wait until the image has finished saving.
  • Delivery: each annotation's markdown gets an **Images (open these files):** list of the saved paths. That one string is what every route sends (an existing terminal agent, an existing native chat, a newly launched agent, and Copy), so every route carries the images. The agent opens the file itself (Claude's Read, Codex's view_image).
  • Cmd+V on macOS: Cmd+V and the right-click Paste go through Orca's menu paste (handleAppMenuPasteRequest). It only read clipboard text and gave up when there was none, so a text field never saw an image paste. With an image-only clipboard it now falls back to a native paste, which fires the real paste event the field handles. Text pastes take the same path as before.
  • Escape inside the image preview now closes only the preview. Before, it left Design Mode or threw away the note being edited.

Why

The notes already reach every agent as one markdown string, so putting the image paths in that string is the one change that covers terminal agents, native chats, new launches and Copy alike. Real per-target attachments (an inline [Image #1] chip in a TUI, image-ref blocks for native chat) would mean threading paths through the send popover, sendMessageToAgent and the quick-launch menu. A chat on a paired server would also need its files copied into that chat's attachment store at send time, which has no API today. A new agent launch would still need the text paths anyway. That is a possible follow-up.

The menu-paste change sits in the shared paste owner, not in an annotation-only listener, so any text control that handles image pastes (the feedback dialog's image attachments too) now gets Cmd+V on macOS. Windows and Linux Ctrl+V already went native.

Linked Issue

Fixes #15476

Visual Proof

Before (main): an image is pasted into the comment at about 0:05 and nothing attaches.

(screenshot removed: contained real product data)

After: a real Cmd+V attaches the image as a chip, and the saved note shows its image count.

(screenshot removed: contained real product data)

Delivery: the notes sent to a native Claude chat list the image path, and Claude answers with the text drawn in the pasted image.

(screenshot removed: contained real product data)

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

On macOS, hidden dev build driven over CDP. Cmd+V was sent through main's before-input-event (webContents.sendInputEvent):

  • The pasted image produced a chip and a file in the OS temp dir. Edit mode loaded the chip from that file, and removing it and saving cleared the paths.
  • With only the menu-paste change reverted, the same Cmd+V attached nothing (0 chips). Cmd+V with text still pastes text.
  • With only the Escape exclusion reverted, Escape in the preview left Design Mode with the preview still open. With it, only the preview closes and the comment stays.

Real agents, each asked "what text is in the pasted image":

  • Claude in native chat, Codex in native chat (new launch), Claude in a terminal (new launch and already running) and Codex in a terminal (new launch).
  • Each opened the saved file and answered with the drawn text.

Tests:

  • formatBrowserAnnotationsAsMarkdown lists POSIX and Windows paths.
  • handleAppMenuPasteRequest native-pastes an image-only clipboard. That test fails without the fix.
  • Focused annotate, app-menu, clipboard-route and store tests: 1181 passed.

Not run here:

  • Windows, Linux and SSH were not tested by hand. Their save path is the existing terminal image-paste path (saveClipboardImageAsTempFile with the worktree's connection and runtime).
  • Full lint and typecheck are left to CI.

AI Disclosure

Review

Two rounds of Codex and Claude review, and the second round came back clean. Fixed: Cmd+V on macOS bypassing the field, preview Escape cancelling an edit or leaving Design Mode, and preview blobs held after a chip was removed or an edit ended. Left as is:

  • On a runtime-served remote worktree, re-editing a saved note shows a placeholder icon instead of the thumbnail. This is display only; the path still reaches the agent.
  • Copying an image file in Finder pastes its file name, as it does in a terminal.
  • Swapping the Design Mode Escape exclusion for hasVisibleOverlay() would also change Escape around the open comment card, so the narrow dialog-content exclusion stays.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Remote/SSH: images are saved where a terminal paste in the same worktree saves them: the runtime server for served remotes. A direct SSH host shows the existing "not served" error as a toast.
  • Folder workspaces: the host is resolved by workspace id, so folder workspaces work the same way.
  • Compatibility: imagePaths is optional and lives only in renderer memory. Annotations aren't persisted or sent over the wire, so mixed versions are unaffected.
  • Mobile: mobile has no Design Mode.
  • Security: paths come from Orca's own save step, and they're wrapped in inline code in the markdown.

To try (dev build from /Users/kelvinamoaba/orca/workspaces/orca/browser-annotation-image-paste):

  1. Take a screenshot to the clipboard (Cmd+Ctrl+Shift+4), open any page in the browser, click "Annotate page element" and pick an element.
  2. Press Cmd+V in the comment box: a thumbnail appears. Type a comment and click Add; the tray row shows an image count.
  3. Click Send and pick an agent. Its message ends with the image path, and it opens the image.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 43 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c396687b-8258-41a3-b1a5-7dfd3e468e65
Commits

Reviewing files that changed from the base of the PR and between 89705db and 89a3bfa.

Files selected for processing: 15
  • src/renderer/src/components/browser-pane/annotate/browser-annotation-image-strip.tsx
  • src/renderer/src/components/browser-pane/annotate/browser-annotation-output.test.ts
  • src/renderer/src/components/browser-pane/annotate/browser-annotation-output.ts
  • src/renderer/src/components/browser-pane/annotate/browser-guest-annotate-overlays.tsx
  • src/renderer/src/components/browser-pane/annotate/browser-page-annotation-tray.test.tsx
  • src/renderer/src/components/browser-pane/annotate/browser-page-annotation-tray.tsx
  • src/renderer/src/components/browser-pane/annotate/pending-browser-annotation-card.tsx
  • src/renderer/src/components/browser-pane/annotate/use-browser-annotation-images.ts
  • src/renderer/src/components/browser-pane/annotate/use-browser-page-annotation-send.ts
  • src/renderer/src/components/browser-pane/annotate/use-browser-page-grab-annotations.ts
  • src/renderer/src/components/browser-pane/annotate/useGrabMode.ts
  • src/renderer/src/lib/app-menu-paste.test.ts
  • src/renderer/src/lib/app-menu-paste.ts
  • src/renderer/src/store/slices/browser/browser-slice-contract.ts
  • src/shared/browser-grab-types.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The latest change appears safe to merge.

Summary

Adds pasted images to Design Mode comments and includes their saved paths in notes sent to agents.

  • Annotation notes can include pasted images that stay with the feedback.
  • Annotation feedback lists image paths for the agent to open.
  • Menu Paste reaches image-aware controls when the clipboard has no text.
  • Escape stays within annotation previews and dialogs.

Reviews (2) · Last reviewed commit: "fix(browser): release pasted edit images..." · Reviewed by Greptile

@AmoabaKelvin
AmoabaKelvin merged commit cc6da80 into main Oct 29, 2026
50 checks passed
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.

[Feature]: Support pasting images directly into the comment element in browser tab

1 participant