Current-head takeover proof for small desktop windows. Main production: 57 passed, 4 failed. Revised production: 61 passed. Behavior cases exercise actual settings persistence and DesktopWindow.handleBackendReady with mocked Electron: work-area offsets, offscreen saved fallback into280x240, restoring280x240, and saving compositor bounds. Real current renderer checked through T3 Browser against isolated server at360x320 and800x574; composer and submit visible; compact controls scroll. No native Electron/compositor/macOS/Windows/mobile verification. 1/4]⎯ FAIL apps/desktop/src/window/DesktopWindow.test.ts > DesktopWindow > opens a window that fits with missing saved bounds and a taskbar on a… AssertionError: expected { width: 1100, height: 780, …(10) } to contain subset { x: -1190, y: 26, width: 1100, …(3) } - Expected + Received { - "height": 694, - "minHeight": 320, - "minWidth": 360, + "autoHideMenuBar": true, + "backgroundColor": "#ffffff", + "disableAutoHideCursor": true, + "height": 780, + "minHeight": 620, + "minWidth": 840, + "show": false, + "title": "T3 Code (Dev)", + "titleBarStyle": "hiddenInset", + "trafficLightPosition": { + "x": 16, + "y": 19, + }, + "webPreferences": { + "backgroundThrottling": false, + "contextIsolation": true, + "disableHtmlFullscreenWindowResize": true, + "nodeIntegration": false, + "preload": "/repo/apps/desktop/dist-electron/preload.cjs", + "sandbox": true, + "webviewTag": true, + }, "width": 1100, - "x": -1190, - "y": 26, } ❯ apps/desktop/src/window/DesktopWindow.test.ts:1290:14 1288| 1289| assert.equal(createdWindowOptions.length, 1); 1290| assert.containsSubset(createdWindowOptions[0], expected); | ^ 1291| }), 1292| ); ❯ IteratorImpl.~effect/Effect/successCont node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:1422:28 ❯ ExitPrimitive.~effect/Effect/evaluate node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/core.ts:585:30 ❯ FiberImpl.runLoop node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:654:41 ❯ FiberImpl.evaluate node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:595:23 ❯ node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:5689:9 ❯ node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:5767:19 ❯ Module. node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:5786:5 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/4]⎯ FAIL apps/desktop/src/window/DesktopWindow.test.ts > DesktopWindow > opens a window that fits with offscreen saved bounds and a work area … AssertionError: expected { width: 1100, height: 780, …(10) } to contain subset { x: 40, y: 26, width: 280, …(3) } - Expected + Received { - "height": 240, - "minHeight": 240, - "minWidth": 280, - "width": 280, - "x": 40, - "y": 26, + "autoHideMenuBar": true, + "backgroundColor": "#ffffff", + "disableAutoHideCursor": true, + "height": 780, + "minHeight": 620, + "minWidth": 840, + "show": false, + "title": "T3 Code (Dev)", + "titleBarStyle": "hiddenInset", + "trafficLightPosition": { + "x": 16, + "y": 19, + }, + "webPreferences": { + "backgroundThrottling": false, + "contextIsolation": true, + "disableHtmlFullscreenWindowResize": true, + "nodeIntegration": false, + "preload": "/repo/apps/desktop/dist-electron/preload.cjs", + "sandbox": true, + "webviewTag": true, + }, + "width": 1100, } ❯ apps/desktop/src/window/DesktopWindow.test.ts:1290:14 1288| 1289| assert.equal(createdWindowOptions.length, 1); 1290| assert.containsSubset(createdWindowOptions[0], expected); | ^ 1291| }), 1292| ); ❯ IteratorImpl.~effect/Effect/successCont node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:1422:28 ❯ ExitPrimitive.~effect/Effect/evaluate node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/core.ts:585:30 ❯ FiberImpl.runLoop node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:654:41 ❯ FiberImpl.evaluate node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:595:23 ❯ node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:5689:9 ❯ node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:5767:19 ❯ Module. node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:5786:5 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/4]⎯ FAIL apps/desktop/src/window/DesktopWindow.test.ts > DesktopWindow > opens a window that fits with saved bounds below the preferred minimu… AssertionError: expected { x: 12, y: 563, width: 280, …(11) } to contain subset { x: 12, y: 563, width: 280, …(3) } - Expected + Received { + "autoHideMenuBar": true, + "backgroundColor": "#ffffff", + "disableAutoHideCursor": true, "height": 240, - "minHeight": 240, - "minWidth": 280, + "minHeight": 620, + "minWidth": 840, + "show": false, + "title": "T3 Code (Dev)", + "titleBarStyle": "hiddenInset", + "trafficLightPosition": { + "x": 16, + "y": 19, + }, + "webPreferences": { + "backgroundThrottling": false, + "contextIsolation": true, + "disableHtmlFullscreenWindowResize": true, + "nodeIntegration": false, + "preload": "/repo/apps/desktop/dist-electron/preload.cjs", + "sandbox": true, + "webviewTag": true, + }, "width": 280, "x": 12, "y": 563, } ❯ apps/desktop/src/window/DesktopWindow.test.ts:1290:14 1288| 1289| assert.equal(createdWindowOptions.length, 1); 1290| assert.containsSubset(createdWindowOptions[0], expected); | ^ 1291| }), 1292| ); ❯ IteratorImpl.~effect/Effect/successCont node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:1422:28 ❯ ExitPrimitive.~effect/Effect/evaluate node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/core.ts:585:30 ❯ FiberImpl.runLoop node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:654:41 ❯ FiberImpl.evaluate node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:595:23 ❯ node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:5689:9 ❯ node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:5767:19 ❯ Module. node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:5786:5 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/4]⎯ Test Files 2 failed (2) Tests 4 failed | 57 passed (61) Start at 09:09:24 Duration 2.67s (transform 54%, import 33%, tests 8%, setup 5%) Transform transforming modules took 2.32s · 54% of tracked time, re-done on every run persist transforms across runs with fsModuleCache: true learn more: https://vitest.dev/guide/improving-performance#caching-between-reruns AFTER note: You are running `vp test` as a Vite+ built-in command. If you meant to run the test npm script, use `vpr test` instead. RUN v5.0.1 /home/ubuntu/wt/desktop-app-05 Test Files 2 passed (2) Tests 61 passed (61) Start at 09:13:34 Duration 3.34s (transform 51%, import 29%, setup 14%, tests 6%) Transform transforming modules took 2.64s · 51% of tracked time, re-done on every run persist transforms across runs with fsModuleCache: true learn more: https://vitest.dev/guide/improving-performance#caching-between-reruns ROUND TWO REVIEW FIXES Saved windows retain main full-display restoration eligibility; new/offscreen fallback uses primary workArea independently of enumeration. actual: { width: 1100, height: 780, minWidth: 360, minHeight: 320, show: false, autoHideMenuBar: true, disableAutoHideCursor: true, backgroundColor: '#ffffff', title: 'T3 Code (Dev)', titleBarStyle: 'hiddenInset', trafficLightPosition: { x: 16, y: 19 }, webPreferences: { preload: '/repo/apps/desktop/dist-electron/preload.cjs', backgroundThrottling: false, contextIsolation: true, nodeIntegration: false, sandbox: true, webviewTag: true, disableHtmlFullscreenWindowResize: true } }, expected: { x: -800, y: 26, width: 800, height: 574, minWidth: 360, minHeight: 320 }, showDiff: true, operator: 'deepStrictEqual', [cause]: undefined } ❯ apps/desktop/src/window/DesktopWindow.test.ts (43 tests | 2 failed) 458ms ❯ DesktopWindow (43) × opens a window that fits with saved bounds overlapping the taskbar wi… 34ms × opens a window that fits with a small primary display listed after a … 5ms ⎯⎯⎯⎯⎯⎯⎯ Failed Tests 2 ⎯⎯⎯⎯⎯⎯⎯ FAIL apps/desktop/src/window/DesktopWindow.test.ts > DesktopWindow > opens a window that fits with saved bounds overlapping the taskbar wi… AssertionError: expected { width: 1100, height: 780, …(10) } to contain subset { x: 100, y: 286, width: 1100, …(3) } - Expected + Received { + "autoHideMenuBar": true, + "backgroundColor": "#ffffff", + "disableAutoHideCursor": true, "height": 780, "minHeight": 320, "minWidth": 360, + "show": false, + "title": "T3 Code (Dev)", + "titleBarStyle": "hiddenInset", + "trafficLightPosition": { + "x": 16, + "y": 19, + }, + "webPreferences": { + "backgroundThrottling": false, + "contextIsolation": true, + "disableHtmlFullscreenWindowResize": true, + "nodeIntegration": false, + "preload": "/repo/apps/desktop/dist-electron/preload.cjs", + "sandbox": true, + "webviewTag": true, + }, "width": 1100, - "x": 100, - "y": 286, } ❯ apps/desktop/src/window/DesktopWindow.test.ts:1314:14 1312| 1313| assert.equal(createdWindowOptions.length, 1); 1314| assert.containsSubset(createdWindowOptions[0], expected); | ^ 1315| }).pipe(Effect.scoped), 1316| ); ❯ IteratorImpl.~effect/Effect/successCont node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:1422:28 ❯ ExitPrimitive.~effect/Effect/evaluate node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/core.ts:585:30 ❯ FiberImpl.runLoop node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:654:41 ❯ FiberImpl.evaluate node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:595:23 ❯ node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:5689:9 ❯ node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:5767:19 ❯ Module. node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:5786:5 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯ FAIL apps/desktop/src/window/DesktopWindow.test.ts > DesktopWindow > opens a window that fits with a small primary display listed after a … AssertionError: expected { width: 1100, height: 780, …(10) } to contain subset { x: -800, y: 26, width: 800, …(3) } - Expected + Received { - "height": 574, + "autoHideMenuBar": true, + "backgroundColor": "#ffffff", + "disableAutoHideCursor": true, + "height": 780, "minHeight": 320, "minWidth": 360, - "width": 800, - "x": -800, - "y": 26, + "show": false, + "title": "T3 Code (Dev)", + "titleBarStyle": "hiddenInset", + "trafficLightPosition": { + "x": 16, + "y": 19, + }, + "webPreferences": { + "backgroundThrottling": false, + "contextIsolation": true, + "disableHtmlFullscreenWindowResize": true, + "nodeIntegration": false, + "preload": "/repo/apps/desktop/dist-electron/preload.cjs", + "sandbox": true, + "webviewTag": true, + }, + "width": 1100, } ❯ apps/desktop/src/window/DesktopWindow.test.ts:1314:14 1312| 1313| assert.equal(createdWindowOptions.length, 1); 1314| assert.containsSubset(createdWindowOptions[0], expected); | ^ 1315| }).pipe(Effect.scoped), 1316| ); ❯ IteratorImpl.~effect/Effect/successCont node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:1422:28 ❯ ExitPrimitive.~effect/Effect/evaluate node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/core.ts:585:30 ❯ FiberImpl.runLoop node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:654:41 ❯ FiberImpl.evaluate node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:595:23 ❯ node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:5689:9 ❯ node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:5767:19 ❯ Module. node_modules/.pnpm/effect@4.0.5/node_modules/effect/src/internal/effect.ts:5786:5 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯ Test Files 1 failed | 1 passed (2) Tests 2 failed | 61 passed (63) Start at 09:21:21 Duration 4.13s (transform 56%, import 30%, tests 10%, setup 3%) Transform transforming modules took 3.69s · 56% of tracked time, re-done on every run persist transforms across runs with fsModuleCache: true learn more: https://vitest.dev/guide/improving-performance#caching-between-reruns FINAL note: You are running `vp test` as a Vite+ built-in command. If you meant to run the test npm script, use `vpr test` instead. RUN v5.0.1 /home/ubuntu/wt/desktop-app-05 Test Files 2 passed (2) Tests 63 passed (63) Start at 09:21:41 Duration 2.35s (transform 53%, import 33%, tests 9%, setup 5%) Transform transforming modules took 2.08s · 53% of tracked time, re-done on every run persist transforms across runs with fsModuleCache: true learn more: https://vitest.dev/guide/improving-performance#caching-between-reruns