Repository navigation
Studio: keep the overlay stack off a maximised Live monitor - #8190
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2d2bdd041a
ℹ️ 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".
| // stack across the box's own top edge, over the controls it is dodging: a | ||
| // monitor resized to fill the viewport had its Close button swallowed by the | ||
| // loaded models card. Nothing above it is free, so stay in the corner. | ||
| if (lifted > viewportHeight - MIN_STACK_ROOM) return STACK_INSET; |
There was a problem hiding this comment.
Keep the maximised monitor's resize grip reachable
When a monitor is too tall to lift over and loaded models are present, returning the normal bottom-right inset places the persistent loaded-models card directly above the monitor's native bottom-right CSS resize grip. The overlay stack has z-[9998] and the card has pointer events enabled, while the monitor is only z-50, so after maximising the monitor the user can close it but can no longer drag the grip to shrink it again. The oversized case needs a placement that avoids both the top controls and the bottom-right resize handle.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed, and fixed in a192fa7. Before this PR the clamped lift left the corner free, so the grip was reachable and the header was not; returning the plain corner inset traded one for the other. Measured the grip rather than guessing at it: driving a resize: both element from the corner inwards, Chromium still resizes at 15px in and stops at 16px, Firefox stops at 13px. So the stack now clears the monitor's bottom edge by one STACK_INSET when it has to sit inside it, and a monitor too tall to lift over that still ends above the bottom edge keeps the plain corner and is capped to the room underneath instead, which clears both. Reintroducing the plain corner return turns the two maximised-monitor cases red.
| // stack across the box's own top edge, over the controls it is dodging: a | ||
| // monitor resized to fill the viewport had its Close button swallowed by the | ||
| // loaded models card. Nothing above it is free, so stay in the corner. | ||
| if (lifted > viewportHeight - MIN_STACK_ROOM) return STACK_INSET; |
There was a problem hiding this comment.
Cap a cornered stack before it reaches the monitor header
When the stack is tall—for example, an expanded download list can use 60dvh and the loaded-models list can use another 42dvh, before banners are counted—returning the corner inset does not keep the stack away from a maximised monitor's top controls. stackMaxHeight returns nearly the full viewport height for this low frame, so the bottom-anchored stack can grow back to top: 16px; its pointer-enabled surfaces then cover the Close button again. The new test only checks the stack's bottom edge, but this case requires limiting its height or otherwise positioning the whole stack clear of the monitor header.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Right, and fixed in a192fa7. stackMaxHeight took the frame.bottom > viewportHeight / 2 branch and returned ownMargin = H - 32, so the corner inset alone did not hold the top: at 1440x900 an expanded download list (60dvh) plus the loaded models card (42dvh) clamps to the cap and grows to top 16, back over the header. The cornered case is now capped below the monitor's header, and the branch is decided on the frame's own inset so the two functions cannot disagree. Reintroducing just the uncapped height turns the two maximised-monitor cases red.
Dropping the lift put the stack back in the corner, which left two gaps. Its height was still uncapped there, so an expanded download list plus the loaded models card grew from the bottom right back over the Close button the inset had just moved off; and the corner itself is where the monitor's native resize grip sits, so the card buried the only way back to a smaller monitor. A monitor that cannot be lifted over but still ends above the bottom edge now keeps the corner and is capped to the room underneath it. One that fills the viewport leaves no free space at all, so the stack sits inside it, clear of the grip at the bottom and stopping below the header at the top.
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! 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". |
|
main's CI red is three independent causes, not one, and none of the three PRs is green on its own. That is why these have all been sitting at CI_FAILING with no review items of their own.
The two Studio PRs each cover exactly the other's failure. On #8197, Chat UI fails on the overlay intercept and Repo tests (CPU) passes. On #8190, Chat UI passes and Repo tests (CPU) fails with those same 6. Core fails on both, because its cause is in zoo. Checked together on a staging repo rather than on the org queue: unsloth main 32 checks pass, 0 fail. The zoo suite inside Core goes from So the merge order that clears the board is zoo#1018 first, then #8197 and #8190 in either order. Once those land, #7867, #7951, #8051, #8121 and #8128 should all go green as well; every one of them has zero open review items and is red only because it inherits this. The staging composition used #8197 at |
|
Reconciled against #8210, which landed on the same two files while this was open. Not redundant. #8210 rewrote the spine, and it is the better spine, so this is now written on top of it rather than against the code it replaced. But the specific thing this PR is for survived #8210 untouched: Rewritten to only that residual, plus one case that is genuinely new: the predicate has to be asked at the inset in force, so it composes with #8210's settling loop. A box with room at the corner on its own, that the composer's lift then walks the stack into, was being clamped onto. #8210's own sweep finds it once the sweep reaches tall enough boxes, as Two things carried over from the previous revision were wrong and are corrected: the header arithmetic, now checked against Body updated with the geometry table, the sabotage results and the gates. One thing I could not do from here: this PR's head branch is on |
#8210 rewrote the same two functions on main while this branch was open, so the overlap resolves in main's favour and the maximised-monitor case is rebuilt on top of it rather than reverting the refactor. Kept from main: reachesStack, roomBelow's bottomInset parameter, the settled inset in stackGeometry. Its "is this box in the way" test replaces this branch's "is it past the halfway line", and it also subsumes this branch's second case: a box leaving MIN_STACK_ROOM underneath itself does not reach the stack, so the corner stays free without a branch of its own. Kept from this branch: the case main still has no answer for. Bounding the lift to the stack's floor parks the stack across the box's own top edge, over the controls it is dodging, which is how a monitor resized to fill the viewport had its Close button swallowed by the loaded models card. liftOver goes back to the unbounded lift, liftFits asks whether it fits, and dodgeInset picks between it and a seat inside the monitor clear of its resize grip. stackMaxHeight holds the other edge of that seat, below the header.
|
Merged main in and resolved the conflict with #8210, which rewrote the same two functions while this was open. What main does today. A box that crowds the corner gets lifted over, and the lift is bounded so the stack keeps its 120px of room at the top of the screen. For a Live monitor resized to fill the viewport that bound is the whole problem: there is nothing above the monitor to lift into, so the stack parks itself across the monitor's own header, over the drag handle and Close button it was meant to be dodging, and the height cap that comes with it squashes the loaded models card to nothing. What this branch adds. When the lift does not fit, seat the stack inside the monitor instead, one inset clear of its native resize grip, and cap its height below the header. The grip matters because it is the only way back to a smaller monitor. What came from #8210 and stayed. Same 1440x900 viewport both times, same Live monitor dragged to the corner and resized to fill the screen, one build each. The boxes are drawn on top afterwards. Before, on main: After, on this branch: Measured off those two pages, monitor filling 16,16 to 1424,884:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6eec7deaeb
ℹ️ 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".
| return Math.max( | ||
| STACK_INSET, | ||
| Math.min( | ||
| viewportHeight - frame.top + STACK_GAP, | ||
| viewportHeight - MIN_STACK_ROOM, | ||
| ), | ||
| viewportHeight - frame.bottom + MONITOR_GRIP + STACK_GAP, | ||
| ); |
There was a problem hiding this comment.
Restrict the inside-frame fallback to the Live monitor
When the docked composer grows above the 128px lift threshold—for example, in a short browser viewport with the 12-row input and the 28dvh prompt queue open—this branch also handles that frame because publishers carry no obstacle type. It consequently seats the z-[9998] overlay stack inside the composer rather than above it, allowing the loaded-models/download surfaces to cover the Send controls again. Distinguish monitor frames before applying the grip/header fallback, or retain clear-above behavior for non-monitor publishers.
Useful? React with 👍 / 👎.
| return Math.max( | ||
| STACK_INSET, | ||
| Math.min( | ||
| viewportHeight - frame.top + STACK_GAP, | ||
| viewportHeight - MIN_STACK_ROOM, | ||
| ), | ||
| viewportHeight - frame.bottom + MONITOR_GRIP + STACK_GAP, | ||
| ); |
There was a problem hiding this comment.
Keep the seated stack above the monitor surface
When a tall monitor starts below the viewport top but still cannot be lifted over (for example top: 100px and bottom: viewportHeight - 16px), this fallback moves the stack from the remaining strip above the monitor into its frame. The monitor container is z-[9999] in floating-monitor.tsx, while both provider stacks are z-[9998], so a widened monitor then paints over the update/download/model cards and intercepts their controls; with the normal 256px monitor, the cards' right-aligned controls are still underneath it. Either preserve the usable space above the monitor or adjust the stacking order now that the geometry explicitly clears the header and resize grip.
Useful? React with 👍 / 👎.


Follow-up to #8082. Rebased onto current
main, which now has #8210.What is left after #8210
#8210 replaced the two-line "is it near the bottom" boolean with
reachesStack, derived fromstackMaxHeight, and madestackGeometrysettle rather than take a single max. That is a better spine than the one this branch was written against, and this branch is now rewritten on top of it.What #8210 did not change is the clamp:
liftOverclamps rather than refuses. For a box whose top edge is above that clamp the clamp does not clear the box, it parks the stack across the box's own top edge, which is where the monitor's collapse and Close buttons are.The geometry
A monitor dragged to the top left and resized to fill the window, which is what
tests/studio/playwright_chat_ui.py:exercise_floating_monitor_geometrydoes immediately before it clicks Close. Viewport 1280x900, frame{left: 16, top: 16, right: 1264, bottom: 884}. The header band, from the panel border down past the Close button, is y 16..80.maintodaymainreaches inset 780 asviewportHeight - MIN_STACK_ROOM, and the loaded models card is the first persistent overlay in the stack, so it lands on the Close button and swallows the click. Same result at 1280x720: inset 600, cap 104, stack at y 16..120.After
A box the lift cannot clear is sat inside rather than lifted over. The inset clears the native resize grip in the opposite corner, which is the only way back to a smaller monitor, and the cap holds the top of the stack below the header.
The predicate is asked at the inset in force rather than a fixed one, so it composes with #8210's settling loop: a box that has room at the corner on its own, but that the composer's lift walks the stack into, is sat inside too rather than clamped onto. That case is new here and was found by extending #8210's own sweep, where it showed up as
bottom=530 height=600 n=2.Constants
Both are checked against
floating-monitor.tsxrather than carried over from the previous revision, which had the arithmetic slightly wrong.MONITOR_HEADER = 64. The panel's 1px border,p-3, the 24px control row (size-6Close button, perbutton.tsx),pb-2plus its 1px rule, andmb-2come to 54, rounded up.MONITOR_GRIP = 16. The panel carriesresizeonce it has been dragged or resized. Every engine that paints a grip draws it at the platform resizer's 15px; iOS Safari paints none. The previous revision said Firefox was 12px, which was wrong.Tests
Added to
monitor-stack-inset.test.ts, alongside #8210's cases rather than replacing them:a monitor too tall to lift over keeps its header and grip cleara monitor resized to fill the viewport keeps its header and grip cleara maximised monitor keeps its header clear under a shared lifta monitor too tall to lift over but clear of the bottom is sat undera tall monitor that can still be cleared is lifted over#8210's
no pairing produces an overlap or an unusable capsweep is extended with heights 600 and 814, which reach boxes that fill the column. For those the contract cannot be "no overlap", since the stack is inside the box, so it becomes "clears above, clears below, or keeps the header and the grip usable".two obstacles are folded one at a timehad a direction assertion,both.bottom < unioned.bottom, that only held under the old clamp. It is repinned on the consequence: folding clears both boxes, and the bounding box cannot clear both. That is now true whichever way the union errs, so it guards folding rather than this change.Each new assertion was checked by breaking the fix three ways and confirming it goes red:
tooTallToClearforced false, ie.main's behaviourownMarginMONITOR_GRIPset to 0Gates
npm test1321 pass, exit 0.npm run typecheckexit 0 on both projects.biome checkexit 0 on both files.The change is integer arithmetic on numbers already measured by the caller, with no equality comparisons against them and margins of 8px or more, so nothing in it is engine-dependent. The two browser-facing quantities are the constants above.