Repository navigation
Chat UI: let the floating monitor settle after the viewport restore before dragging it - #16909
Merged
Merged
Conversation
…efore dragging it After the narrow viewport the anchored panel sits at left 0, which is also inside the restored viewport, so the restore wait could pass a frame before the layout moved it back to the right edge. The drag that followed started and ended at left 0, kept the right-edge anchor, and the resize snapped the panel back right with 260 px of room: resize width 260, expected 296.
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Chat UI Tests (chat)keeps failing on unrelated PRs in the floating monitor geometry step:Seen on the staging runs for #16890 and #16782 today, with identical numbers. The limits logging added in #16885 is what shows the cause, and it is not the stale viewport limit #16861 and #16885 assumed.
use-floating-panel-layout.tssetsmaxWidth = constraints.width - left. With the 1280 px viewport and 16 px insets the constraint box is 1248 px wide, and1248 - 988 = 260. So during the resize the panel was moved to the right edge, though the step had just dragged it to the top left and the limits wait before the resize saw room for 296 px.The sequence:
intent.left === null).set_viewport_size(viewport)the next layout pass moves it back to the right edge, but left 0 is inside the restored viewport too, sowait_for_box("viewport restore", is_inside)can pass before that pass runs.drag_monitor_to(0, 0)then grabs a panel still at left 0 and drops it at left 0.finishDragonly makes an axis absolute when the drag changed it ("a null axis stays anchored to the far edge"), so the horizontal anchor stays on the right edge.ResizeObserver,placeAxis(null, maxLeft)puts the panel at the right edge (left 988), and the width is capped at the 260 px left there.The component is doing what it is designed to do: a user cannot start a drag in the frame between a window resize and the layout pass. Only the test grabs it too early.
Change
tests/studio/playwright_chat_ui.py, test only. After restoring the viewport, wait for the monitor to stop moving (wait_for_settled, the frame-polled helperpointer_dragalready uses) before theis_insidecheck and the drag. The layout pass runs within that wait and restarts it if it moves the panel, so the drag starts from the panel's real spot. The comment on the limits wait from #16885 no longer blames a stale viewport limit.Testing
left: 988px,max-width: 260px,1248 - 988 = 260), on two runs on different staging repos.python -m py_compile tests/studio/playwright_chat_ui.py.Chat UI Tests (chat)run exercises the step. The failure is a timing race, so a single green run cannot prove the fix by itself; I will keep watching the staging runs after it lands.