|
2 | 2 | DesktopPreviewAnnotationThemeInputSchema, |
3 | 3 | DesktopPreviewArtifactInputSchema, |
4 | 4 | DesktopPreviewAutomationClickInputSchema, |
| 5 | + DesktopPreviewAutomationSetViewportInputSchema, |
| 6 | + DesktopPreviewAutomationSnapshotInputSchema, |
5 | 7 | DesktopPreviewAutomationEvaluateInputSchema, |
6 | 8 | DesktopPreviewAutomationPressInputSchema, |
7 | 9 | DesktopPreviewAutomationScrollInputSchema, |
@@ -276,11 +278,31 @@ export const automationStatus = DesktopIpc.makeIpcMethod({ |
276 | 278 |
|
277 | 279 | export const automationSnapshot = DesktopIpc.makeIpcMethod({ |
278 | 280 | channel: IpcChannels.PREVIEW_AUTOMATION_SNAPSHOT_CHANNEL, |
279 | | - payload: DesktopPreviewTabInputSchema, |
| 281 | + payload: DesktopPreviewAutomationSnapshotInputSchema, |
280 | 282 | result: PreviewAutomationSnapshot, |
281 | | - handler: Effect.fn("desktop.ipc.preview.automationSnapshot")(function* ({ tabId }) { |
| 283 | + handler: Effect.fn("desktop.ipc.preview.automationSnapshot")(function* ({ tabId, include }) { |
| 284 | + const manager = yield* PreviewManager.PreviewManager; |
| 285 | + return yield* manager.automationSnapshot(tabId, include ?? []); |
| 286 | + }), |
| 287 | +}); |
| 288 | + |
| 289 | +export const automationSetViewport = DesktopIpc.makeIpcMethod({ |
| 290 | + channel: IpcChannels.PREVIEW_AUTOMATION_SET_VIEWPORT_CHANNEL, |
| 291 | + payload: DesktopPreviewAutomationSetViewportInputSchema, |
| 292 | + result: Schema.Void, |
| 293 | + handler: Effect.fn("desktop.ipc.preview.automationSetViewport")(function* ({ |
| 294 | + tabId, |
| 295 | + width, |
| 296 | + height, |
| 297 | + clear, |
| 298 | + }) { |
282 | 299 | const manager = yield* PreviewManager.PreviewManager; |
283 | | - return yield* manager.automationSnapshot(tabId); |
| 300 | + yield* manager.automationSetViewport( |
| 301 | + tabId, |
| 302 | + clear === true || width === undefined || height === undefined |
| 303 | + ? { clear: true } |
| 304 | + : { width, height }, |
| 305 | + ); |
284 | 306 | }), |
285 | 307 | }); |
286 | 308 |
|
@@ -381,6 +403,7 @@ export const methods = [ |
381 | 403 | closePictureInPicture, |
382 | 404 | automationStatus, |
383 | 405 | automationSnapshot, |
| 406 | + automationSetViewport, |
384 | 407 | automationClick, |
385 | 408 | automationType, |
386 | 409 | automationPress, |
|
0 commit comments