Paste clipboard images into annotation comments#47
Open
sacrezm wants to merge 2 commits into
Open
Conversation
The annotation comment box only accepted text. You can now paste an image from the clipboard (a screenshot, a design reference, etc.) into both the element and freeform-rectangle comment boxes. Pasted images are saved next to the auto-captured screenshot under .moat/screenshots/<id>-paste-N.<ext>, shown as removable thumbnails in the comment box, and their paths are appended to the task comment (plus an `attachments` array on the task) so the agent processing /bridge picks them up. Submitting with only an image and no text is now allowed. Normal text paste is unaffected (we only intercept when the clipboard carries an image).
…them Pasted reference images were only referenced in the task comment text, so whether the processing agent looked at them depended on it noticing the path. Make it reliable: - convertAnnotationToTask / createTaskObject now persist an `attachments` array (the ./screenshots/<id>-paste-N paths) as a first-class task field in moat-tasks-detail.json, so the data is structured rather than buried in prose. - The bridge + workflow rule templates now instruct the agent to open every image in `attachments` before implementing, the same way it views `screenshotPath`.
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.
What
The annotation comment box only accepted text. This adds clipboard image paste to both comment boxes (element annotations via
C, and freeform rectangles viaR).How it works
pastelistener on the comment textarea capturesimage/*clipboard items (e.g. a screenshot or a design reference). Text paste is untouched — we only intercept when the clipboard actually carries an image..moat/screenshots/<id>-paste-N.<ext>, and its path is appended to the taskcomment(plus anattachmentsarray on the task) so the agent readingmoat-tasks-detail.json/ running/bridgepicks them up.Scope
chrome-extension/content_script.js— paste handler, image persistence, image-only submit, wiring through the existingaddToQueuefunnel.chrome-extension/moat.css— thumbnail strip styles.No new dependencies, no build step. Tested manually in Chrome; the data-URL → file parse path (PNG/JPEG/SVG, extension mapping, non-image rejection) verified with a small standalone check.