Repository navigation
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrowly scoped desktop bug fix that restores saved window positions when snapping produces a documented 1px display-edge overhang, while retaining fallback behavior for windows farther off-screen. It includes focused regression tests and does not affect product defaults, schemas, deployment, or static-analysis settings. You can add or adjust custom eligibility rules. Learn more. |
A snapped window is persisted up to 1px past the display edge, and windowFitsWithinDisplay required strict containment, so resolveInitialMainWindowBounds discarded the saved bounds and fell back to the default size on the primary display. Allow a 1px overhang on each edge. Part of pingdotgg#21563
1b018b2 to
9999a85
Compare
|
Note Written by This PR does not meet the verification requirement. The diff changes restored desktop window placement, but the body explicitly says the app was not checked and provides only a unit-test result, with no before/after screenshots of the snapped-window restoration. Attach before/after captures from a desktop run with the reported display layout, show the snapped window surviving relaunch, and retain the focused one-pixel and off-screen regression results before requesting reconsideration. |
Problem
A window snapped to the edge of a display reopens at the default size on the primary display after a relaunch (#21563, first part). The snapped window is persisted up to 1px past the display edge, e.g.
{"x":1921,"y":30,"width":1280,"height":945}on a display spanning x 1920 to 3200, so the right edge is 3201.windowFitsWithinDisplayrequires the saved bounds to lie entirely within one display, soresolveInitialMainWindowBoundsfinds no display that fits and falls back to the default size.Change
windowFitsWithinDisplayinapps/desktop/src/window/DesktopWindow.tsaccepts bounds that overhang a display by at most 1px on any edge. Nothing else changes. The second part of the issue (a window re-created in the same process moving to x=640) is not covered, since it was not accepted.Scope and approval
Triaged and accepted by the maintainer, first part only: #21563 (comment)
Verification
New unit test in
apps/desktop/src/window/DesktopWindow.test.ts,restores bounds that overhang a snapped display edge by at most 1px. With a primary 1920x1080 display and a secondary display at x=1920, it checks that the issue's snapped bounds are restored, and that bounds 2px past the edge or entirely off every display still fall back to the default. Without the change it fails (expected { width: 1100, height: 780 } to deeply equal { x: 1921, y: 30, width: 1280, … }); with it the whole file passes (21 tests after the rebase onto main; #22557 pruned the file's other tests). Format, lint andapps/desktoptypecheck are clean.I did not check this in the app: it needs a second physical display, so the unit test is the only evidence.
Part of #21563
Claude Sonnet 5.5 (xhigh) via T3 Code.