Skip to content

feat(chat): copy generated images out of the conversation - #79

Merged
luoxuanzao merged 1 commit into
mainfrom
feat/image-copy
Sep 21, 2026
Merged

luoxuanzao merged 1 commit into
mainfrom
feat/image-copy

Conversation

@luoxuanzao

Copy link
Copy Markdown
Member

Summary

  • Images an agent embeds in a reply (![[...]]) rendered as plain <img> elements, so they never got Obsidian's own image context menu and there was no way to get the picture out of the chat. Right-clicking one now offers Copy image, which writes the bitmap to the system clipboard ready to paste into any application or another note.
  • PNG/JPEG go through Electron nativeImage + clipboard.writeImage — the same path Obsidian's Live Preview copy uses; other formats fall back to the async Clipboard API. The generated embed HTML now carries its vault path so the menu can resolve the file, and both success and failure report through a notice.

Verification

  • npm run typecheck
  • npm run lint
  • npm run test (171 suites / 3600 tests on this branch)
  • npm run build
  • npm run release:check
  • npm run audit:prod
  • Tested affected qodercli behavior against a real CLI when applicable

Additionally verified end to end against a real desktop Obsidian: right-clicking an embedded vault image opens the menu, and after clicking the item the system clipboard holds a bitmap whose dimensions and byte length match the source PNG (read back through Electron's clipboard.readImage()). The user then confirmed the interaction in their own session.

Safety

  • No credentials, private vault content, internal URLs, or personal paths are included
  • User-visible changes are documented in CHANGELOG.md

Images an agent embeds in a reply render as plain <img> elements, so they
never got Obsidian's own image menu and there was no way to get the picture
out of the chat. Right-clicking one now offers "Copy image", which writes the
bitmap to the system clipboard so it can be pasted into any application or
another note.

PNG/JPEG go through Electron's nativeImage + clipboard.writeImage, matching
Obsidian's Live Preview behavior; other formats fall back to the async
Clipboard API. The embed's HTML now carries its vault path so the menu can
resolve the file, and the copy reports success or failure in a notice.

Co-authored-by: QoderAI (Qwen 3.8 Max) <qoder_ai@qoder.com>
@luoxuanzao
luoxuanzao merged commit fdc1877 into main Sep 21, 2026
10 checks passed
@luoxuanzao
luoxuanzao deleted the feat/image-copy branch September 21, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant