Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): keep screenshots when attaching preview annotations #10374

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

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

x
0 of 5 viewed, 5 left
2 additions and 2 deletionsapps/web/src/components/preview/PreviewView.test.tsxModified
View file
@@ -342,7 +342,7 @@
mocks.closePictureInPicture.mockClear();
mocks.pickElement.mockReset();
mocks.capturePreviewAnnotationScreenshot.mockReset();
- mocks.capturePreviewAnnotationScreenshot.mockResolvedValue({ status: "none" });
+ mocks.capturePreviewAnnotationScreenshot.mockReturnValue({ status: "none" });
mocks.addPreviewAnnotation.mockClear();
vi.mocked(toastManager.add).mockClear();
mocks.addImage.mockClear();
@@ -601,7 +601,7 @@
const onSendAnnotation = vi.fn();
mocks.pickElement.mockResolvedValue({ annotation, submission: "send" });
- mocks.capturePreviewAnnotationScreenshot.mockResolvedValue({ status: "failed" });
+ mocks.capturePreviewAnnotationScreenshot.mockReturnValue({ status: "failed" });
​
renderToStaticMarkup(
<PreviewView
1 addition and 1 deletionapps/web/src/components/preview/PreviewView.tsxModified
View file
@@ -599,7 +599,7 @@
// instead of holding the composer for an attachment that never lands.
// The stored copy drops the screenshot on failure, otherwise the prompt
// would tell the agent a crop is attached when none was sent.
- const capture = await capturePreviewAnnotationScreenshot(picked);
+ const capture = capturePreviewAnnotationScreenshot(picked);
// Main reports a crop that failed or timed out on its side; the local