Skip to content

Pasting a thread with images keeps the text and skips the blank thumbnails - #77292

Merged
OutThisLife merged 1 commit into
mainfrom
bb/composer-mixed-paste
Aug 3, 2026
Merged

Pasting a thread with images keeps the text and skips the blank thumbnails#77292
OutThisLife merged 1 commit into
mainfrom
bb/composer-mixed-paste

Conversation

@OutThisLife

Copy link
Copy Markdown
Collaborator

Copying a Discord thread — text that happens to have image embeds in it — attached a couple of blank thumbnails to the composer and lost the message text. Verified against the real clipboard: the HTML Discord writes carries a 32×5 PNG blurhash placeholder beside each embed, and that placeholder was what got attached.

The inline-<img src="data:…"> scrape ran on every paste, including a rich-text copy that had 335 characters of its own text. Any blob it found then short-circuited the handler, so the prose never reached the editor. Inline HTML images now only count when the copy is image-only, and only above a thumbnail-sized floor so spacers, trackers, and blurhash stand-ins are left alone. A paste that genuinely carries both attaches its images and inserts its text.

pasteAndMatchStyle also joins the Edit menu: ⌘⇧V had an accelerator with no menu entry, which Electron never translates into an editor command, so the chord did nothing anywhere in the app.

Copying a Discord thread (or any rich-text selection with images) attached
one or more blank thumbnails and dropped the message text entirely.

Two causes. The clipboard's `text/html` was scraped for inline
`<img src="data:…">` regardless of whether the copy carried its own text —
and what Discord ships beside each image embed is a 32x5 blurhash
placeholder, which is exactly the blank attachment. Then, because any image
blob short-circuited the paste handler, the prose that came with it never
reached the composer.

Inline HTML images now only count for an image-only copy, and are ignored
below a thumbnail-sized floor so spacers and trackers don't attach either. A
mixed paste attaches its real images and still inserts its text.

Also registers pasteAndMatchStyle in the Edit menu — Cmd+Shift+V had no menu
entry, so the chord was never translated into an editor command anywhere in
the app.
@OutThisLife
OutThisLife enabled auto-merge August 3, 2026 03:29
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on 9e373b3

all good!

@OutThisLife
OutThisLife merged commit aa8f0d4 into main Aug 3, 2026
31 checks passed
@OutThisLife
OutThisLife deleted the bb/composer-mixed-paste branch August 3, 2026 03:35
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) labels Aug 3, 2026
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
…ixed-paste

Pasting a thread with images keeps the text and skips the blank thumbnails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants