@@ -49,19 +49,29 @@ export const createWindow = async (dir?: string): Promise<void> => {
4949
5050 // Create the browser window.
5151 const mainWindow = new BrowserWindow ( {
52- width : ( isE2E ? 2560 : width ) ,
53- height : ( isE2E ? 1140 : height ) ,
52+ width : 1024 ,
53+ height : 652 ,
5454 frame : true ,
5555 webPreferences : {
5656 preload : path . join ( __dirname , 'preload.js' ) ,
57+ // Hint an initial zoom; Electron applies this at creation time
58+ zoomFactor : ( isE2E ? 0.5 : 1.0 ) ,
5759 } ,
5860 } ) ;
5961
60- // For E2E tests on low-resolution CI machines, zoom out to fit more content
62+ // Ensure zoom is applied after content loads (some pages reset it on load)
6163 if ( isE2E ) {
62- mainWindow . webContents . setZoomFactor ( 0.5 ) ; // 50% zoom for E2E
64+ const applyZoom = ( ) => {
65+ try { mainWindow . webContents . setZoomFactor ( 0.5 ) ; } catch ( _ ) { }
66+ } ;
67+ // Apply once the first load finishes
68+ mainWindow . webContents . once ( 'did-finish-load' , applyZoom ) ;
69+ // Re-apply on any navigation within the window (SPA route changes, reloads)
70+ mainWindow . webContents . on ( 'did-navigate-in-page' , applyZoom ) ;
71+ mainWindow . webContents . on ( 'did-navigate' , applyZoom ) ;
6372 }
6473
74+
6575 mainWindow . webContents . setWindowOpenHandler ( ( details ) => {
6676 shell . openExternal ( details . url ) ; // Open URL in user's browser.
6777 return { action : "deny" } ; // Prevent the app from opening the URL.
0 commit comments