Issue 21563 — window-edge restore proof Head: 8505e5b40fbc2f20830622f8f2f6d565f00a8435 Base: 22b89ef061 This is unit-runtime evidence, NOT a native Electron multi-display capture. The displayless Linux VM cannot verify OS snapping or actual display selection. Reporter input: primary (0,0) 1920x1280; secondary (1920,0) 1280x1920. Saved bounds: x=1921 y=30 width=1280 height=945. Right edge 3201 exceeds secondary edge 3200 by 1 DIP. Before: fallback {width:1100,height:780}. After: original saved bounds object. 2 DIP and substantial overflow rejected; removed-secondary fallback retained. === Baseline and RED === ### BASELINE (HEAD test file) @ 968dd51704 $ cd apps/desktop && /home/ubuntu/wt/issue-21563/node_modules/.bin/vp test run src/window/DesktopWindow.test.ts 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.5 /home/ubuntu/wt/issue-21563/apps/desktop Test Files 1 passed (1) Tests 20 passed (20) Start at 22:05:45 Duration 1.36s (import 53%, transform 30%, tests 10%, setup 7%) exit=0 ### RED (with new test) diff --git a/apps/desktop/src/window/DesktopWindow.test.ts b/apps/desktop/src/window/DesktopWindow.test.ts index dbdde033ca..2cc60b7c73 100644 --- a/apps/desktop/src/window/DesktopWindow.test.ts +++ b/apps/desktop/src/window/DesktopWindow.test.ts @@ -472,6 +472,24 @@ describe("DesktopWindow", () => { ); }); + it("restores snapped bounds that overflow a display edge by a rounding pixel", () => { + const displays = [ + { x: 0, y: 0, width: 1920, height: 1280 }, + { x: 1920, y: 0, width: 1280, height: 1920 }, + ]; + const snappedBounds = { x: 1921, y: 30, width: 1280, height: 945 }; + const offscreenBounds = { ...snappedBounds, x: 2320 }; + + assert.deepEqual( + DesktopWindow.resolveInitialMainWindowBounds(snappedBounds, displays), + snappedBounds, + ); + assert.deepEqual( + DesktopWindow.resolveInitialMainWindowBounds(offscreenBounds, displays), + DesktopAppSettings.DEFAULT_MAIN_WINDOW_SIZE, + ); + }); + it.effect( "opens and reopens the window without backend readiness when local execution is disabled", () => $ cd apps/desktop && /home/ubuntu/wt/issue-21563/node_modules/.bin/vp test run src/window/DesktopWindow.test.ts 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.5 /home/ubuntu/wt/issue-21563/apps/desktop ❯ src/window/DesktopWindow.test.ts (21 tests | 1 failed) 125ms ❯ DesktopWindow (21) × restores snapped bounds that overflow a display edge by a rounding pixel 9ms ⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ FAIL src/window/DesktopWindow.test.ts > DesktopWindow > restores snapped bounds that overflow a display edge by a rounding pixel AssertionError: expected { width: 1100, height: 780 } to deeply equal { x: 1921, y: 30, width: 1280, …(1) } - Expected + Received { - "height": 945, - "width": 1280, - "x": 1921, - "y": 30, + "height": 780, + "width": 1100, } ❯ src/window/DesktopWindow.test.ts:483:12 481| const offscreenBounds = { ...snappedBounds, x: 2320 }; 482| 483| assert.deepEqual( | ^ 484| DesktopWindow.resolveInitialMainWindowBounds(snappedBounds, disp… 485| snappedBounds, ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯ Test Files 1 failed (1) Tests 1 failed | 20 passed (21) Start at 22:05:47 Duration 1.10s (import 58%, transform 21%, tests 13%, setup 7%) exit=1 === GREEN initial === 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.5 /home/ubuntu/wt/issue-21563/apps/desktop Test Files 2 passed (2) Tests 32 passed (32) Start at 22:06:40 Duration 1.44s (import 56%, transform 25%, tests 11%, setup 8%) exit=0 === Integrated verbose runtime === 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.5 /home/ubuntu/wt/issue-21563 ✓ |@t3tools/desktop| src/settings/DesktopAppSettings.test.ts > DesktopSettings > falls back to defaults when the settings file is malformed 8ms ✓ |@t3tools/desktop| src/settings/DesktopAppSettings.test.ts > DesktopSettings > persists disabling and re-enabling local execution without clearing backend settings 1495ms ✓ |@t3tools/desktop| src/settings/DesktopAppSettings.test.ts > DesktopSettings > loads lenient persisted desktop settings JSON 7ms ✓ |@t3tools/desktop| src/settings/DesktopAppSettings.test.ts > DesktopSettings > rejects window bounds that do not satisfy the domain schema 6ms ✓ |@t3tools/desktop| src/settings/DesktopAppSettings.test.ts > DesktopSettings > persists sparse desktop settings documents 205ms ✓ |@t3tools/desktop| src/settings/DesktopAppSettings.test.ts > DesktopSettings > saves through a symlinked settings file without replacing the link 1954ms ✓ |@t3tools/desktop| src/window/DesktopWindow.test.ts > DesktopWindow > restores bounds only when the window fits within a connected display 2ms ✓ |@t3tools/desktop| src/window/DesktopWindow.test.ts > DesktopWindow > restores snapped bounds that overflow a display edge by a rounding pixel 0ms ✓ |@t3tools/desktop| src/window/DesktopWindow.test.ts > DesktopWindow > opens and reopens the window without backend readiness when local execution is disabled 23ms ✓ |@t3tools/desktop| src/window/DesktopWindow.test.ts > DesktopWindow > blocks only repeated Cmd+W input before it reaches the native window menu 5ms ✓ |@t3tools/desktop| src/window/DesktopWindow.test.ts > DesktopWindow > zooms main with a focused popup and reapplies preview zoom 10ms ✓ |@t3tools/desktop| src/window/DesktopWindow.test.ts > DesktopWindow > zooms the app from Ctrl+wheel like the menu does 6ms ✓ |@t3tools/desktop| src/window/DesktopWindow.test.ts > DesktopWindow > reloads and inspects the main window even when a popup has focus 9ms ✓ |@t3tools/desktop| src/window/DesktopWindow.test.ts > DesktopWindow > does not open main or splash windows once quitting has started 8ms ✓ |@t3tools/desktop| src/window/DesktopWindow.test.ts > DesktopWindow > destroys a main window when quit races native creation without loading or revealing it 21ms ✓ |@t3tools/desktop| src/window/DesktopWindow.test.ts > DesktopWindow > destroys a splash window when quit races native creation without loading or revealing it 7ms ✓ |@t3tools/desktop| src/window/DesktopWindow.test.ts > DesktopWindow > quietly cancels backend ready when quit races preview cleanup 4ms ✓ |@t3tools/desktop| src/window/DesktopWindow.test.ts > DesktopWindow > quietly cancels activation when quit races preview cleanup 3ms ✓ |@t3tools/desktop| src/window/DesktopWindow.test.ts > DesktopWindow > quietly cancels renderer event when quit races preview cleanup 41ms ✓ |@t3tools/desktop| src/window/DesktopWindow.test.ts > DesktopWindow > persists normal bounds and state for a maximized window 4ms ✓ |@t3tools/desktop| src/window/DesktopWindow.test.ts > DesktopWindow > preserves unrestorable bounds until the user changes the window 6ms ✓ |@t3tools/desktop| src/window/DesktopWindow.test.ts > DesktopWindow > flushes normal bounds when minimized before the debounce completes 5ms ✓ |@t3tools/desktop| src/window/DesktopWindow.test.ts > DesktopWindow > persists the current main window bounds before the window closes 6ms ✓ |@t3tools/desktop| src/window/DesktopWindow.test.ts > DesktopWindow > opens safe off-origin renderer navigations in the system browser 5ms ✓ |@t3tools/desktop| src/window/DesktopWindow.test.ts > DesktopWindow > retries opening the real main on activate when a failed post-readiness open left only the splash 7ms ✓ |@t3tools/desktop| src/window/DesktopWindow.test.ts > DesktopWindow > delivers capture completion and late errors without taking focus back 5ms ✓ |@t3tools/desktop| src/window/DesktopWindow.test.ts > DesktopWindow > does not reopen a closed main window for a completed capture 4ms ✓ |@t3tools/desktop| src/settings/DesktopAppSettings.test.ts > DesktopSettings > migrates legacy implicit update channels to the runtime default 54ms ✓ |@t3tools/desktop| src/settings/DesktopAppSettings.test.ts > DesktopSettings > preserves explicit stable update channel on nightly builds 11ms ✓ |@t3tools/desktop| src/settings/DesktopAppSettings.test.ts > DesktopSettings > persists wsl backend toggle and normalizes invalid distro names 2014ms ✓ |@t3tools/desktop| src/settings/DesktopAppSettings.test.ts > DesktopSettings > applies WSL Windows fallback with persisted and volatile updates 300ms ✓ |@t3tools/desktop| src/settings/DesktopAppSettings.test.ts > DesktopSettings > migrates legacy wslMode=wsl to wslBackendEnabled on load 11ms Test Files 2 passed (2) Tests 32 passed (32) Start at 22:07:50 Duration 17.04s (transform 66%, tests 20%, import 8%, setup 6%) === Final head runtime after main merge and strict identity assertion === 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.5 /home/ubuntu/wt/issue-21563 Test Files 2 passed (2) Tests 32 passed (32) Start at 22:08:56 Duration 6.40s (transform 61%, import 20%, setup 17%, tests 2%)