Repository navigation
Hand the agent a file for anything that is not a picture #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,17 +54,19 @@ async function attach(editor: Editor, target: TLShape) { | |
| `&w=${Math.max(1, Math.round(w * scale))}&h=${Math.max(1, Math.round(h * scale))}`, | ||
| window.location.href, | ||
| ).href; | ||
| return dispatchAttach({ kind: "board", name, src, page: true }); | ||
| return dispatchAttach({ kind: "board", name, src, reference: true }); | ||
| } | ||
| // One of the person's own: whatever it is, the agent gets a picture of it, named by where it | ||
| // reads the thing itself (canvasContent.ts). | ||
| // One of the person's own, drawn for the tile and named by where the agent reads the thing | ||
| // itself (canvasContent.ts). A picture goes over as one. Anything else, such as a video, a | ||
| // note or a drawing, is a file the agent is pointed at, as a board is. | ||
| const slug = personsShape(editor, target); | ||
| if (slug) { | ||
| const { blob } = await editor.toImage([target.id], { format: "png" }); | ||
| return dispatchAttach({ | ||
| kind: "board", | ||
| name: personsShapeName(editor, target, slug), | ||
| src: URL.createObjectURL(blob), | ||
| reference: target.type === "image" ? undefined : true, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a user creates or edits a note/drawing and immediately attaches and sends it, this switches the agent from the freshly rendered snapshot to Useful? React with 👍 / 👎.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in f78f602: the + awaits saveNow(slug) before handing over a reference to one of the person's shapes. |
||
| }); | ||
| } | ||
| const shape = target as TLImageShape; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 Video and shape references lack tests
The existing test only renames a board reference. Neither new video paths nor shape-record references are exercised, despite the viewer-test requirement in CONTRIBUTING.md.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 2efcbee.