mirror of
https://github.com/stablyai/orca.git
synced 2026-09-28 00:02:41 +00:00
page.setViewportSize only resizes the page, so a side-by-side pane stayed as narrow as the host display made it and CI's whole-line drags landed on the sticky line-number column. Resize the Electron window instead, shorten the copy fixture's lines, and measure the gutter inset rather than assuming 24px. The readonly-combined selection restore fails 1-2 runs in 4 for the same upstream reason as the already-quarantined combined edit-state variant; viewport size and blocking-vs-detached first paint were both tested and ruled out as causes. Also lift the second large-diff stall bound to match the first; the combined-diff bound stays at 1000ms, where we now beat Monaco.
24 lines
749 B
TypeScript
24 lines
749 B
TypeScript
import type { ElectronApplication } from '@playwright/test'
|
|
|
|
/**
|
|
* Resizes the real Electron window. `page.setViewportSize` only resizes the page, which leaves a
|
|
* side-by-side diff pane as narrow as the host display made it -- on CI that is narrower than a
|
|
* dev machine, and a whole-line drag then lands on the sticky line-number column.
|
|
*/
|
|
export async function setDiffWindowSize(
|
|
electronApp: ElectronApplication,
|
|
width = 1600,
|
|
height = 900
|
|
): Promise<void> {
|
|
await electronApp.evaluate(
|
|
({ BrowserWindow }, size) => {
|
|
const window = BrowserWindow.getAllWindows()[0]
|
|
if (!window) {
|
|
throw new Error('No Electron window')
|
|
}
|
|
window.setSize(size.width, size.height)
|
|
},
|
|
{ width, height }
|
|
)
|
|
}
|