Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): preserve preview viewport when app is zoomed #10536

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

Showing 2 changed files with 44 additions and 24 deletions.

x
0 of 2 viewed, 2 left
36 additions and 11 deletionsapps/desktop/src/preview/Manager.test.tsModified
View file
@@ -311,6 +311,7 @@
​
interface TestHostWebContents {
readonly id: number;
+ readonly getZoomFactor: () => number;
readonly mainFrame: { readonly frameTreeNodeId: number };
readonly executeJavaScript: ReturnType<typeof vi.fn>;
readonly isDestroyed: () => boolean;
@@ -328,6 +329,7 @@
let handler: TestDisplayMediaHandler | undefined;
return {
id: 7,
+ getZoomFactor: () => 1,
mainFrame: { frameTreeNodeId: 7 },
executeJavaScript: vi.fn(async () => true),
isDestroyed: () => false,
@@ -577,7 +579,11 @@
Effect.gen(function* () {
const preview = makeFaviconWebContents();
const sendInputEvent = vi.fn();
- const hostWebContents = { sendInputEvent, isDestroyed: () => false };
+ const hostWebContents = {
+ sendInputEvent,
+ getZoomFactor: () => 1,
+ isDestroyed: () => false,
+ };
Object.assign(preview.webContents, { hostWebContents });
fromId.mockReturnValue(preview.webContents);