Repository navigation
Studio: stabilize floating live monitor geometry - #7579
Conversation
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Delayed GPU rows arriving after the first /api/system response were clipped or briefly pushed outside the inset, because min-height: min-content and the computed max-height sat on the same element the ResizeObserver watched. Chromium and WebKit let min-content win, so the panel grew past the cap and was corrected a frame later (the CI failure: content growth bottom inset expected 884, got 932). Firefox lets max-height win, so the panel never resized, the observer never fired and the cap was never lifted: the VRAM rows stayed hidden for good. - Move the rows into a flex-1 min-h-0 overflow-y-auto region and observe the unclamped content wrapper, so growth is seen even while capped. - Derive the wanted height from chrome + content instead of the rendered box, so top moves up in the same pass and nothing overshoots. - Replace min-height: min-content with a resolved number clamped to maxHeight, keeping the initial size as the minimum. - Re-measure the natural width when the surface resizes, deferred to rAF, so a monitor first opened in a narrow window widens again and Firefox does not report an observer loop. - Point the growth probe at the content region, where a real row renders. Verified on Chromium, Chrome, Firefox and WebKit across [Windows, Linux, WSL, macOS] x [NVIDIA, AMD, CPU] payloads.
|
Thanks for this, the drag, resize, edge clamping and reopen fixes are all solid and I could reproduce every one of the original bugs on main. I pushed one commit on top to fix the content growth path, which is what the red Chat UI jobs were catching. What was wrong
That gives two different symptoms on one code path. The monitor's open state is persisted, so on every reload with it open it mounts RAM only and then grows when the first
The same thing happens when a GGUF model loads on a different backend and adds the inference row, and when the Appearance font scale changes while the monitor is open. What the commit changes
VerificationChromium, Chrome 147, Firefox and WebKit, against
Your own Two things worth knowing that are not regressions from this PR:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 852ace5622
ℹ️ 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".
| } | ||
|
|
||
| const width = Math.min(desiredWidth, constraintsBox.width); | ||
| const height = Math.min(desiredHeight, constraintsBox.height); |
There was a problem hiding this comment.
Honor the resized height when clamping vertical position
When a user moves the monitor, gives it an explicit native-resize height, and later GPU/inference rows make the natural content taller than that height, this uses desiredHeight rather than the rendered monitorBox.height to calculate maxTop. The content remains scrollable within the user's explicit height, but reconcileGeometry nevertheless moves the panel upward as though it had expanded, leaving an unnecessary gap below it. For panels with monitor.style.height, base this bound on the rendered height so delayed content does not reposition a hand-resized monitor.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed and fixed in 6cd4a35. Reproduced it by parking the monitor against the bottom inset, growing it with the native grip to a height between the old and new natural content height, then delivering GPU rows: the panel jumped up 58.5px and left a 19px gap below the inset in Chromium, 58.5px in Firefox. desiredPanelHeight now reports the rendered height when monitor.style.height is set, so a hand-resized panel scrolls and stays put. Gap is 0px in Chromium, Firefox and WebKit after the change.
|
The org Chat UI jobs are still sitting in the queue, so I ran the same script end to end on a staging runner against a live Studio. It gets past the assertion that was failing and finishes the whole flow: Worth noting the shutdown step and the console error assertion at the end had not been running at all since the geometry failure aborted the script before reaching them. Both pass now. |
A panel with an explicit native-resize height scrolls its content rather than growing, but reconcileGeometry still clamped its position against the taller natural height, pulling it up and leaving a gap below the inset. Report the rendered height for such panels, and pull the layout equality check and the anchor/clamp choice into helpers.
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? 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". |
|
One note so the wall of red does not mislead: every one of the 15 workflow runs on In the meantime the full Linux, macOS and Windows all pass on the same tree. Nothing outstanding from my side. |
The floating Live Monitor had several related geometry bugs caused by combining transform-based dragging with the browser's native resize behavior.
Dragging against the window edges
Problem: Dragging the monitor fully left or right could place it against the window edge instead of keeping the intended 16px margin. Its final position could also depend on when the opening animation finished.
Fix: The monitor now uses a fixed 16px inset surface and explicit top/left coordinates. Dragging clamps its settled dimensions inside that surface instead of relying on a transform.
Resizing before and after moving
Problem: Resizing from the native lower-right grip could appear stuck, shift the card, or grow much more than the pointer moved. Chromium could also remember a resize that was blocked at the window edge, then reveal that hidden size as soon as the monitor was dragged elsewhere.
Fix: The native lower-right resize grip is preserved, but it now operates on stable top/left geometry. The monitor uses its initial rendered size as its minimum and the space from its current position as its maximum. A blocked inline resize is normalized to the size actually being rendered before dragging begins.
Content and window size changes
Problem: GPU rows that appeared after the first system response could be clipped by the initial height. Resizing the window could also leave stale limits or move the monitor outside its inset, especially if the window changed during an active drag.
Fix: The monitor observes both its own size and its inset surface. It reconciles its position and limits when content or viewport dimensions change, rebases any active drag session, and keeps the initial bottom-right anchor until the user moves the monitor. Narrow windows can reduce the preferred width without losing the inset.
Closing and reopening
Problem: Reopening the monitor before its exit animation completed could reuse the previous drag position or native resize dimensions.
Fix: Each reopened monitor gets a fresh geometry instance, while system polling still stops as soon as the overlay is closed.
Verification
npm run typechecknpm testnpm run build