feat(chat): copy generated images out of the conversation - #79
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
![[...]]) 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.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 typechecknpm run lintnpm run test(171 suites / 3600 tests on this branch)npm run buildnpm run release:checknpm run audit:prodAdditionally 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
CHANGELOG.md