Files
llink/js/desktop
Claude b3084fd515 fix: route clipboard image pastes to the attachment strip
Pasting an image while the markdown editor was focused left it stuck on
ProseMirror's inline "uploading" placeholder instead of going to the
attachment strip. The capture-phase paste interceptor bailed before it
could redirect the file because:

- pasted images usually surface only through `clipboardData.items`
  (`getAsFile`), with `clipboardData.files` left empty, and
- image pastes often advertise an *empty* `text/plain` entry, which the
  old `types.includes('text/plain')` check mistook for a text paste.

Read files from `items` (falling back to `files`), and gate on the actual
text payload rather than the advertised type, so real text pastes
(Excel/Word renditions) still paste as text while pure image pastes
become attachments.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01QtNQeBpkDJPC9obiB25pV6
2026-06-21 01:46:24 +00:00
..
2026-05-26 15:37:35 -07:00
2026-05-26 15:37:35 -07:00
2026-05-26 15:41:54 -07:00
2026-05-26 15:37:35 -07:00
2026-06-09 09:12:03 -07:00
2026-05-26 15:37:35 -07:00

Notes

CORS for desktop app

In dev: each renderer process has its own localhost port. The renderer process passes this in the Origin header for requests, and expects appropriate ACAO headers in the response.

In packaged app: the renderer process does not include Origin header, so expects no extra ACAO headers from the server, otherwise the client would fail to accept responses.