Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(preview): resize hidden browser tabs reliably #8469

Closedt3dotgg(GitHub profile, opens in a new tab)wants to merge 20 commits intomain fromfix/preview-hidden-viewport-v2opened View on GitHub

Showing 25 changed files with 30 additions and 0 deletions (loading 23).

x
0 of 25 viewed, 25 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 @@