Skip to content

Studio chat UI test: drag the monitor grip again when a native resize stops early - #16861

Merged
danielhanchen merged 1 commit into
mainfrom
ci-monitor-resize-retry
Nov 6, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci-monitor-resize-retry

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Chat UI Tests (chat) on Linux has started failing on unrelated PRs with the same assertion in the floating monitor geometry check:

tests/studio/playwright_chat_ui.py:956, in exercise_floating_monitor_geometry
AssertionError: [ui] FAIL: resize width: expected 296, got 260

It failed 3 of the last 17 completed Unsloth UI CI runs (#16858, which only touches the bookmarks test, plus inprocess-native-tool-formats and download-speed-limit, the #16828 branch, which only touches backend hub code). #16828 also hit it once more with got 256, and a rerun passed. Playwright and Chromium are the same version (1.64.1) in passing and failing runs, and nothing under studio/frontend merged in the window where it started.

The numbers point at the pointer drag, not the resize logic. The check drags the native grip with mouse.move(..., steps = 10) from 8 px inside the corner to 40 px past it. 260 is 256 plus the first 4 px step, and 256 is no step at all. So the native resize took at most the first pointer step and dropped the rest. The same step passes in the other 14 runs on the same code.

Change

tests/studio/playwright_chat_ui.py, the "resize width / height" step only. The drag target is an absolute point, so if the box is not at the wanted size after the drag, the test drags the grip again from wherever the corner is now, up to three drags, and logs a line when it retries. The width, height, left edge and top edge assertions after it are unchanged, so a resize that really stops following the grip still fails after the third drag.

Testing

  • python -m py_compile tests/studio/playwright_chat_ui.py.
  • This PR's own Unsloth UI CI run exercises the step on Linux.
  • I could not reproduce the dropped steps locally. The change only adds the retry, so it cannot make a passing run fail.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T02:35:30.046081Z ac3b2dc Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: ac3b2dcebb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@danielhanchen
danielhanchen merged commit f988934 into main Nov 6, 2026
@danielhanchen
danielhanchen deleted the ci-monitor-resize-retry branch November 6, 2026 03:49
danielhanchen added a commit that referenced this pull request Nov 6, 2026
…ze, and report them (#16885)

## Summary

Follow-up to #16861, whose retry did not fix the Linux `Chat UI Tests
(chat)` failure in the floating monitor check:

```
[ui] resize stopped at 260x141, dragging the grip again
[ui] resize stopped at 256x141, dragging the grip again
AssertionError: [ui] FAIL: resize width: expected 296, got 256
```

Since #16861 merged it failed 4 of 12 completed `Unsloth UI CI` runs,
including main (run 42159942657), and all three drags ended at 256-260
px wide with the height unchanged. So the pointer was not losing steps,
as #16861 assumed. The box would not grow at all.

256 px is the panel's natural width (`minWidth` in
`useFloatingPanelLayout`), and 260 px is the narrow viewport the check
sets just before the resize (`{"width": 260, "height": 400}`). That
points at the panel's `maxWidth`/`maxHeight` still holding the narrow
viewport's values when the resize starts. CSS `min-width` then wins and
pins the box. The limits only follow the viewport through a
`ResizeObserver` on a CPU-throttled page, and `wait_for_box("viewport
restore", ...)` passes as soon as the 256 px box fits, without waiting
for the limits.

## Change

`tests/studio/playwright_chat_ui.py`, the resize step only:

- remove #16861's retry loop;
- before the drag, wait up to 5 s for the monitor's computed `max-width`
/ `max-height` to allow the target size;
- if they never do, fail with the computed min/max width and height and
the inline style. That would be a real layout bug: the panel cannot be
resized after the window was narrowed;
- if the drag still lands short, log the same limits before the existing
assertions.

The size and position assertions are unchanged.

## Testing

- `python -m py_compile tests/studio/playwright_chat_ui.py`.
- This PR's own `Unsloth UI CI` run exercises the step. I could not
reproduce the throttled-page timing locally, so the limits in the log of
the next failing run (if any) are the evidence for or against the stale
`maxWidth` reading above.
danielhanchen added a commit that referenced this pull request Nov 6, 2026
…efore dragging it (#16909)

## Summary

`Chat UI Tests (chat)` keeps failing on unrelated PRs in the floating
monitor geometry step:

```
[ui] resize landed at 260x141 with limits {'minWidth': 256, 'maxWidth': 260, ..., 'inline': 'opacity: 1; left: 988px; top: 0px; ... max-width: 260px; ...'}
AssertionError: [ui] FAIL: resize width: expected 296, got 260
```

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.ts` sets `maxWidth = constraints.width -
left`. With the 1280 px viewport and 16 px insets the constraint box is
1248 px wide, and `1248 - 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:

1. The active drag into the shrunken viewport's corner snaps the panel
back to its anchor, so its horizontal position is "right edge"
(`intent.left === null`).
2. At the 260 px viewport that anchor puts it at left 0. On
`set_viewport_size(viewport)` the next layout pass moves it back to the
right edge, but left 0 is inside the restored viewport too, so
`wait_for_box("viewport restore", is_inside)` can pass before that pass
runs.
3. `drag_monitor_to(0, 0)` then grabs a panel still at left 0 and drops
it at left 0. `finishDrag` only 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.
4. The native resize fires the layout's `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 helper `pointer_drag` already uses) before the `is_inside`
check 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

- The failing runs' logged limits match the sequence above exactly
(`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`.
- This PR's own `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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant