Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): attach preview annotation screenshots in the desktop app #6242

Closedglauberorg(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/6242/headopened View on GitHub

Showing 5 changed files with 23 additions and 8 deletions (loading 2).

x
0 of 5 viewed, 5 left
10 additions and 3 deletionsapps/web/src/components/preview/PreviewView.test.tsxModified
View file
@@ -414,7 +414,7 @@
expect(mocks.addPreviewAnnotation).toHaveBeenCalledWith(TEST_THREAD_REF, annotation);
});
​
- it("still sends when screenshot attachment conversion fails", async () => {
+ it("drops the screenshot claim when attachment conversion fails", async () => {
const annotation = {
id: "annotation-2",
pageUrl: "https://example.com/dashboard",
@@ -434,7 +434,9 @@
const onSendAnnotation = vi.fn();
mocks.pickElement.mockResolvedValue({ annotation, submission: "send" });
- mocks.previewAnnotationScreenshotFile.mockRejectedValue(new Error("conversion failed"));
+ mocks.previewAnnotationScreenshotFile.mockImplementation(() => {
+ throw new Error("conversion failed");
+ });
​
renderToStaticMarkup(
<PreviewView
@@ -446,7 +448,12 @@
mocks.toggleAnnotation?.();
​
- await vi.waitFor(() => expect(onSendAnnotation).toHaveBeenCalledWith(annotation, null));
+ // The prompt advertises the crop off `screenshot`, so a failed conversion
+ // has to clear it — otherwise the agent is told to look at an image that
+ // was never attached.