Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(preview): apply viewport changes when the panel is hidden #7303

Closedgb1095(GitHub profile, opens in a new tab)wants to merge 10 commits intomain fromrefs/pull/7303/headopened View on GitHub

Showing 11 changed files with 148 additions and 0 deletions (loading 8).

x
0 of 11 viewed, 11 left
28 additions and 0 deletionsapps/desktop/src/ipc/methods/preview.tsModified
View file
@@ -2,6 +2,7 @@
DesktopPreviewAnnotationThemeInputSchema,
DesktopPreviewArtifactInputSchema,
DesktopPreviewAutomationClickInputSchema,
+ DesktopPreviewAutomationSetViewportInputSchema,
DesktopPreviewAutomationEvaluateInputSchema,
DesktopPreviewAutomationPressInputSchema,
DesktopPreviewAutomationScrollInputSchema,
@@ -163,6 +164,18 @@
yield* manager.setAudioMuted(tabId, audioMuted);
}),
});
+export const setViewport = DesktopIpc.makeIpcMethod({
+ channel: IpcChannels.PREVIEW_SET_VIEWPORT_CHANNEL,
+ payload: DesktopPreviewAutomationSetViewportInputSchema,
+ result: Schema.Void,
+ handler: Effect.fn("desktop.ipc.preview.setViewport")(function* (input) {
+ const manager = yield* PreviewManager.PreviewManager;
+ yield* manager.setViewport(
+ input.tabId,
+ "clear" in input ? { clear: true } : { width: input.width, height: input.height },
+ );
+ }),
+});
export const openDevTools = tabMethod(
IpcChannels.PREVIEW_OPEN_DEVTOOLS_CHANNEL,
"desktop.ipc.preview.openDevTools",
@@ -299,6 +312,19 @@