Skip to content

Desktop Copy Image does nothing for images inside HTML previews #17549

Closed

Description

@leoisadev1

What happened

In the desktop app, right-clicking an image inside an HTML preview (an HTML file opened in the side panel, or an agent's inline HTML render in a thread) shows "Copy Image", but choosing it copies nothing. The clipboard stays empty. Copy Image works on images that are part of the app itself.

Diagnosis

The desktop context menu in apps/desktop/src/window/DesktopWindow.ts (installContextMenu) adds "Copy Image" whenever params.mediaType === "image", and its click handler calls contents.copyImageAt(params.x, params.y).

webContents.copyImageAt hit-tests the top frame. HTML previews and HTML renders are sandboxed iframes (BrowserDocumentFrame / HtmlRenderDocument in apps/web), and Chromium runs sandboxed frames out of process even on the same origin. The top frame's hit test lands on the <iframe> element, not the image, so nothing is copied. The context-menu event itself does see the image: params.frame is the iframe's frame and params.srcURL is the image URL.

Steps to reproduce

  1. Open the desktop app.
  2. Ask an agent to show an HTML page containing an image (html_render), or open an .html attachment or file with an <img> in the side panel.
  3. Right-click the image and choose Copy Image.
  4. Paste into any app.

Expected: the image is pasted. Actual: nothing is pasted.

Standalone repro with Electron 44.4.5, the version apps/desktop ships. It right-clicks through CDP so the click routes into the iframe like a real mouse click, then calls copyImageAt with the event's coordinates and reads the clipboard:

main frame image
  mediaType=image src=http://127.0.0.1:4801/img.png
  copyImageAt -> clipboard 3138x2084
sandboxed cross-origin iframe, http image
  mediaType=image src=http://127.0.0.1:4802/img.png
  copyImageAt -> clipboard EMPTY (no image)
sandboxed cross-origin iframe, data: image (html_render style)
  mediaType=image src=data:image/png;base64,...
  copyImageAt -> clipboard EMPTY (no image)
sandboxed same-origin iframe
  mediaType=image src=http://127.0.0.1:4801/img.png
  copyImageAt -> clipboard EMPTY (no image)

Version

Server t3 0.0.41-nightly.20260915; source checked against main at f853d51.

Environment

Reported on the macOS desktop app connected to a Linux server. Reproduced on Linux with Electron 44.4.5 under Xvfb.

Related issues

None found. Searched for "copy image".

Fix applied or workaround

No workaround in the app. A possible fix: for images in a subframe, load params.srcURL (http(s) without cookies and capped in size, or data:) and write it to the clipboard. Top-frame images keep copyImageAt.

Filed by

Claude Opus 5.5 via t3 triage

Activity

  1. ViperJuice commented on Oct 15, 2026

    @ViperJuice

    Adding a user-reported chat workflow and the desired copy/export behavior to this related report, rather than opening a duplicate. This issue is marked completed; I have not independently reproduced the current behavior, and this comment does not establish a regression, a technical cause, or failure on every platform.

    User-reported use case

    An assistant generates an engineering diagram that is visible inline in the T3 Code chat window, including a visualization rendered from SVG or HTML. The user wants to choose Copy Image and paste the diagram directly into WhatsApp. They report that they cannot simply do this from the chat window. They also want to save the visible image or the generated file directly from the same place.

    Requested behavior

    Provide a compact context menu or visible actions on chat images, rendered visualizations, and image/file attachments:

    • Copy Image puts actual image content on the clipboard, in a broadly pasteable format such as PNG. For SVG/HTML-rendered diagrams, copy a rasterized image of the rendered visualization so it can be pasted into WhatsApp or another image-capable app.
    • Save Image / Download Image saves the rendered image directly to the user's device with a sensible filename and extension, for example engineering-diagram.png.
    • Save / Download File retrieves the actual underlying generated file or attachment when available, preserving its format, such as PDF, SVG, HTML, or another file type, with a sensible filename.

    Copying a filesystem path, URL, file mention, or HTML/SVG markup does not satisfy Copy Image. Likewise, downloading should deliver the file's content to the user, including when the environment is remote; a path on the environment host alone does not satisfy the workflow. The image export and original-file download should be distinguishable actions when both apply.

    A useful acceptance check would be: generate a generic diagram, copy its rendered image from chat, paste it into WhatsApp as an image, then download both a PNG rendering and an available original SVG/PDF file from chat and open the saved files successfully.

    This request includes rendered visualizations as well as conventional image/file attachments. Existing image copy/save actions may already cover some surfaces; the request is for a discoverable, consistent way to complete this workflow on the relevant chat surface. Related download context: #14362 and #5532.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions