Files
hermes-webui/static
kaishi00 ad99ff4976 fix(composer): attach image AND paste text when clipboard carries both
The paste handler (boot.js) bailed entirely when the clipboard contained
both text and image items, preventing image attachment in the most common
real-world scenario: right-click → Copy Image from browsers, Notes, Slack,
etc. — these almost always carry a text/html or text/plain representation
alongside the image.

Previous behavior (from #1620 fix):
  - clipboard has text only → normal text paste (correct)
  - clipboard has image only → attach image (correct)
  - clipboard has BOTH → text pasted, image silently dropped (wrong)

New behavior:
  - clipboard has text only → normal text paste (unchanged)
  - clipboard has image only → preventDefault + attach image (unchanged)
  - clipboard has BOTH → let text paste normally AND attach image

The key change: preventDefault() is now only called when no text is
present (true screenshot paste), so the browser handles text insertion
naturally while addFiles() runs regardless.

Fixes the regression introduced by the #1620 fix. Closes #1620.
2026-06-17 04:37:29 +00:00
..
2026-05-25 00:14:38 +00:00