Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): preview resize and status report the real size of desktop tabs #32854

MergedEntrpi(GitHub profile, opens in a new tab)merged 8 commits intomain fromrefs/pull/32854/headmerged by juliusmarminge View on GitHub

Showing 3 changed files with 129 additions and 0 deletions (loading 2).

x
0 of 3 viewed, 3 left
129 additions and 0 deletionsapps/server/src/preview/ServerBrowser.test.tsModified
View file
@@ -14,6 +14,7 @@
ProviderInstanceId,
ThreadId,
type PreviewAutomationLoadError,
+ type PreviewAutomationResizeResult,
type PreviewAutomationSnapshot,
type PreviewAutomationStatus,
} from "@t3tools/contracts";
@@ -2405,6 +2406,134 @@
).pipe(Effect.provide(layer)),
+it.effect("a desktop tab reports the size the desktop draws after a resize", () =>
+ Effect.scoped(
+ Effect.gen(function* () {
+ const { broker } = yield* ready;
+ const manager = yield* Manager.PreviewManager;
+ const failReads = () => Promise.reject(new Error("Cannot find context with specified id"));
+ desktopSizeAnswer = failReads;
+ desktopRendersNext = true;
+ const opened = yield* broker.invoke<PreviewAutomationStatus>({
+ scope,
+ operation: "open",
+ input: { reuseExistingTab: false, show: false },
+ });
+ const tabId = PreviewTabId.make(opened.tabId!);
+ const { context } = desktopConnections.at(-1)!;
+ const cdp = context.sessions[0]!;
+ const events = yield* manager.subscribeEvents;