Repository navigation
fix(app): stop the browser pane jumping while resizing panels - #60757
Conversation
There was a problem hiding this comment.
The change looks sound. I couldn't reproduce the jump here because it needs the desktop app's native view on Wayland at a high device pixel ratio. I also couldn't run the component tests: Playwright's Chromium wouldn't start in this environment. typecheck:tsc passes in app and gui-plugins.
From reading the code: panelsMoving() only drives the embeds' moving input. So during a resize drag the native view switches to the still exactly as it does during panel animations, and nothing else changes. All four resize handles in the app are covered. A click without a move never hides the page, and if a panel closes mid-drag, the release listener on the document still clears the flag. The new test is small and checks the fixed behaviour without depending on frame timing.
Public API: unchanged. The only addition is an optional onDraggingChange prop on the internal UI ResizeHandle, which is backwards compatible.
No blocking concerns.
Issue for this PR
Closes #
Type of change
What does this PR do?
On Linux (Wayland, high zoom), dragging a sidebar or panel edge made the side panel's browser page jump around on every move. It overlapped the chat, opened gaps, and fell out of line with its own tab strip.
The browser page is a native view. During a drag,
EmbedViewsent new bounds on every frame, and main applied them right away. The DOM around the view only reaches the screen a frame or more later, especially at a device pixel ratio of 4+, so the view and its panel drew from different frames. Panel open/close animations already avoid this:panelsMoving()hides native views and shows a still of the page in their place. Resize drags didn't count as movement.ResizeHandletakes anonDraggingChangecallback. It getstrueon the first move (so a plain click on the handle doesn't blink the page) andfalseon release.panel-motionaddssetPanelResizing, andpanelsMoving()is now true during a resize drag as well as during flights.setPanelResizing.During a drag the page shows as a still, cropped to its box, that moves exactly with the DOM. The live view comes back when you release. Each frame also does less work, because the child page no longer re-lays out on every move.
How did you verify your code works?
browser-pane.spec.ts, using the realResizeHandle, panel motion and host embeds. It fails without the change.bun run check;bun typecheckandtypecheck:tscin app, ui and gui-plugins; built e2etabs,side-panelsandpanel-edges(46 passed); app components suite run cold with no optimizer reloads. The one failure,composer.spec.ts:3, is an existing flake in prompt history (it also fails 1 in 3 on repeat) and unrelated to this change.Visual
Checklist