t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: Cmd+Shift+V fails to paste images in macOS desktop app (swallowed by Edit → Paste as Text accelerator)

Open andirtew opened this issue 1 week ago • 1 comments

Before submitting

  • [x] I searched existing issues and did not find a duplicate.
  • [x] I included enough detail to reproduce or investigate the problem.

Area

apps/desktop

Steps to reproduce

  1. Open T3 Code Desktop (v0.1.11) on macOS.
  2. Type some text into the chat composer (so pasting an image normally inserts an inline image chip in addition to the top thumbnail).
  3. Copy an image to the clipboard (e.g., a screenshot or an image copied from QQ / Finder).
  4. Press Cmd + Shift + V in the composer (intended to paste without inserting an inline image chip via skipImageInlineChip).

Expected behavior

Pressing Cmd + Shift + V should trigger a paste event with skipImageInlineChip: true, attaching the image to the composer thumbnail strip without inserting an inline image reference chip into the prompt text (consistent with the composer paste handler passing { skipImageInlineChip: i }).

Actual behavior

Nothing happens — the image is not pasted at all.

Root cause (from bundled v0.1.11 source)

There are two interacting issues on macOS:

  1. Menu accelerator swallows Cmd + Shift + V (apps/desktop main.cjs): The macOS Edit → Paste as Text menu item binds accelerator: "CmdOrCtrl+Shift+V" to pasteAsTextClick:

    const pasteAsTextClick = (_item, _window, event) => {
      if (event.triggeredByAccelerator === true) return;
      runMenuEffect("paste-as-text", dispatchMenuAction("paste-as-text"));
    };
    

    This early return was added in #11958 to fix #11955 (duplicate text paste). However, on macOS, the native menu intercepts Cmd + Shift + V (before-input-event only calls setIgnoreMenuShortcuts for Cmd + W), returns early without calling webContents.paste(), and Chromium does not trigger an image paste for Cmd + Shift + V. Clicking Edit → Paste as Text with the mouse works (triggeredByAccelerator is false), whereas the keyboard shortcut does nothing for images.

  2. Clipboard with both an image file and text/plain skips image attachment under Paste as Text: Even when Paste as Text does fire (bypassAutoAttachment: true), the composer attachment predicate checks bypassAutoAttachment && plainText.length > 0 and immediately returns false. On macOS, images copied from apps like QQ or Finder often include a plain-text filename alongside the image file, so they are skipped instead of being attached with skipImageInlineChip: true.

Impact

Minor bug or occasional failure

Version or commit

0.1.11 (commit 59651c1761f6)

Environment

macOS 26.5.1 (Build 25F80, arm64), T3 Code (Beta) Desktop v0.1.11

Logs or stack traces


Screenshots, recordings, or supporting files

No response

Workaround

Paste normally with Cmd + V and press Backspace to delete the inline image chip from the text box (the image remains in the top thumbnail strip and is still sent), or paste images before typing any text.

andirtew avatar Nov 22 '26 14:11 andirtew

This is the same problem as #21006, so I'm closing it in favour of that one. If it is different, say how and it will be reopened.

juliusmarminge avatar Nov 22 '26 14:11 juliusmarminge