Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): preserve screenshot detail in scaled previews #9916

ClosedGigioxx(GitHub profile, opens in a new tab)wants to merge 15 commits intomain fromrefs/pull/9916/headopened View on GitHub

Showing 5 changed files with 77 additions and 6 deletions (loading 3).

x
0 of 5 viewed, 5 left
53 additions and 4 deletionsapps/desktop/src/preview/DesktopBrowserHost.test.tsModified
View file
@@ -8,6 +8,7 @@
import * as Stream from "effect/Stream";
import * as TestClock from "effect/testing/TestClock";
import * as NodeEvents from "node:events";
+import { vi } from "vite-plus/test";
​
import * as DesktopBrowserHost from "./DesktopBrowserHost.ts";
​
@@ -172,22 +173,28 @@
}).pipe(Effect.scoped),
​
- it.effect("sends a page one screenshot at a time", () =>
+ it.effect("keeps native screenshots serialized beyond the scaled capture deadline", () =>
Effect.gen(function* () {
const host = yield* DesktopBrowserHost.make;
const debuggee = makeDebuggee();
+ Object.assign(debuggee.tab.webContents, {
+ id: 42,
+ hostWebContents: { isDestroyed: () => false, executeJavaScript: async () => false },
+ });
host.attach(key, debuggee.tab);
const replies = yield* watchReplies(host);
​
yield* command(host, 1, "Page.captureScreenshot");
yield* command(host, 2, "Page.captureScreenshot");
- yield* command(host, 3, "DOM.enable");
yield* settle;
- expect(debuggee.sent).toEqual([1, 3]);