Skip to content

Commit f34aea8

Browse files
author
ci-bot
committed
zoom really small on e2e
1 parent 315cf2b commit f34aea8

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

apps/remixdesktop/src/main.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,15 @@ export const createWindow = async (dir?: string): Promise<void> => {
5353
height: (isE2E ? 1140 : height),
5454
frame: true,
5555
webPreferences: {
56-
preload: path.join(__dirname, 'preload.js')
57-
56+
preload: path.join(__dirname, 'preload.js'),
5857
},
5958
});
59+
60+
// For E2E tests on low-resolution CI machines, zoom out to fit more content
61+
if (isE2E) {
62+
mainWindow.webContents.setZoomFactor(0.5); // 50% zoom for E2E
63+
}
64+
6065
mainWindow.webContents.setWindowOpenHandler((details) => {
6166
shell.openExternal(details.url); // Open URL in user's browser.
6267
return { action: "deny" }; // Prevent the app from opening the URL.

apps/remixdesktop/src/menus/view.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,10 @@ export default (
6464
if (focusedWindow){
6565
let factor = (focusedWindow as BrowserWindow).webContents.getZoomFactor()
6666
console.log(factor)
67-
if (factor > 1.25) {
67+
if (factor > 0.1) {
6868
factor = factor - 0.25
69-
;(focusedWindow as BrowserWindow).webContents.setZoomFactor(factor)
70-
}else{
71-
(focusedWindow as BrowserWindow).webContents.setZoomFactor(1)
69+
;(focusedWindow as BrowserWindow).webContents.setZoomFactor(Math.max(0.1, factor))
7270
}
73-
7471
}
7572
}
7673
},

0 commit comments

Comments
 (0)