Repository navigation
Studio: only dodge an overlay box that reaches the corner stack - #8210
Conversation
The corner stack lifts over anything published to the frame store whose bottom is past the halfway line. The chat composer publishes, and on an empty chat the welcome layout pads it down from the top rather than docking it, so it clears that line while leaving the corner free. The stack lifted anyway: the update banners, the download panel and the loaded models card all sat in the middle of the page with nothing underneath them. Dodge only a box that reaches the strip the stack occupies, which is its own inset plus the shortest it ever is. A docked composer does and is still dodged, which matters: the composer column is 46rem and the card 268px, so below a 1584px viewport the card lands on Send, and 1280, 1440 and 1512 are all below it. The welcome composer does not, so the stack stays in the corner. Same rule for the other publisher, so a monitor dragged up the screen stops dragging the stack with it. It is still in the column, so the height cap keeps the stack clear of it as before.
d9e2559 to
0969d3c
Compare
|
Checked the P1 rather than taking it at face value, and it is right. The numbers, since they are worse than "a narrower window": The composer column is The suggested remedy is only half right though. Keeping the stack clear of the composer unconditionally is what put the banners in the middle of the page in the first place: on an empty chat So the gate is now "does the box reach the strip the stack occupies", not "is it past halfway". A docked composer does and keeps its lift, so Send stays clickable. The welcome composer does not, so the stack stays in the corner. The Playwright workaround this comment objected to is gone with it. |
|
@codex review |
The cutoff was a guess at the shortest the stack ever is, and it did not line up with stackMaxHeight's own floor. A box ending between 32px above the cutoff and the cutoff was read as not reaching, so it went to the capped branch, where the cap could not fit MIN_STACK_ROOM under it and returned that floor anyway. The stack then overlapped the box by up to 24px: at 830px high with a box ending at 700, the cap came out 120 and put the stack's top at 694. Ask the cap instead. A box reaches the stack when the room under it is less than the stack's floor, which is exactly when the cap would be impossible, so the two cannot disagree. The floor drops out of stackMaxHeight with it, since nothing tighter now gets there. Neither composer case moves: the welcome one keeps the corner, the docked one keeps its lift. A sweep of every bottom edge on an 830px window is now a test, so no capped box can overlap the stack again.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4fbb6cd4c
ℹ️ 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".
| if (reachesStack(frame, viewportHeight)) return ownMargin; | ||
| // At least MIN_STACK_ROOM by construction: anything tighter reaches, and was | ||
| // lifted instead of capped. | ||
| return Math.min(ownMargin, roomBelow(frame, viewportHeight, bottomInset)); |
There was a problem hiding this comment.
Re-evaluate capped frames after applying another frame's lift
When a docked composer and a monitor are published together, bottomInset may have been raised by the composer even though this monitor did not satisfy reachesStack at the default inset. For example, with the added 1280×830 composer (top = 664) and a monitor ending at 660, the shared inset is 174 but this returns 830 - 174 - 660 - 8 = -12 for maxHeight; the resulting invalid CSS cap is ignored and the stack overlaps the monitor. Determine reachability using the final shared inset (or lift again) rather than assuming the single-frame cutoff still guarantees MIN_STACK_ROOM after another frame moves the stack.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, and reproduced exactly: that pair returns maxHeight: -12. Browsers drop an invalid max-height, so the cap disappeared precisely where it was needed and the stack was free to grow over the monitor.
My own regression, from the previous commit. Removing the MIN_STACK_ROOM floor was justified by "nothing tighter reaches this branch", which holds for one box at the default inset and stops holding the moment another box raises the shared one.
Fixed by settling the inset rather than folding each box against a fixed one. Reachability now takes the inset in force, and stackGeometry keeps asking until no box wants more, which bounds at their count since each can only promote once. That pair now lifts to 438 with a cap of 376, clearing both. The floor stays removed, since it was papering over this rather than preventing it.
Swept every column box from 60 to 814, at four heights, alone and paired with the docked composer: no overlap and no cap at zero or below. Both new tests fail against the previous commit.
Each box was asked whether it crowded the corner at the default inset, then the largest lift was taken. With two boxes that is wrong in one direction: lifting over the first moves the stack up into the second, and a box that had room at the corner has none there. A docked composer and a monitor ending at 660 on an 830px window hit it. The composer lifts the stack to 174, the monitor is still read as having room, so it takes the capped branch and the cap comes out at -12. Browsers drop an invalid max-height, so the cap vanished exactly where it was needed and the stack grew over the monitor. Settle the inset instead: keep asking until no box wants more, which bounds at their count since each can only promote once. Reachability now takes the inset in force rather than a fixed one, which is also what makes the cap safe, so the MIN_STACK_ROOM floor removed last commit stays gone rather than papering over it again. Swept every column box against the docked composer: no overlap and no cap at zero or below.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f78c4c1ade
ℹ️ 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 belowMonitor = viewportHeight - bottomInset - frame.bottom - STACK_GAP; | ||
| return Math.max(MIN_STACK_ROOM, Math.min(ownMargin, belowMonitor)); | ||
| // Lifted over: bottomInset already cleared it. | ||
| if (reachesStack(frame, viewportHeight, bottomInset)) return ownMargin; |
There was a problem hiding this comment.
Do not treat a capped lift as clearing the frame
When another publisher raises bottomInset enough to make a high monitor reach the stack, liftOver may clamp at viewportHeight - MIN_STACK_ROOM without actually getting above that monitor, yet this branch assumes it was cleared and restores ownMargin. For example, at 830px high, a monitor spanning top=16,bottom=300 plus an expanded docked composer/prompt queue requesting bottomInset>=403 causes the monitor's lift to clamp at 710; the stack then spans y=16..120, directly overlapping the monitor's top controls. Check that the final inset really clears frame.top before taking this branch, and otherwise retain a below-frame cap or another attainable placement.
Useful? React with 👍 / 👎.
#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.
The problem
On a chat page the update banners, the download panel and the loaded models card sit a few hundred pixels up the middle of the page instead of in the bottom-right corner.
The corner stack lifts over anything published to the frame store whose bottom is past the halfway line. The chat composer publishes, and on an empty chat
ThreadWelcomepads it down from the top withpt-[27.5dvh]rather than docking it, so its bottom clears the halfway line while the corner underneath it stays free. The stack lifted anyway, and it is one container, so all four overlays went with it.The change
Dodge only a box that reaches the strip the stack occupies: its own inset plus the shortest the stack ever is, which is the collapsed card. One predicate, applied to both publishers.
Why the docked composer still has to be dodged
Not cosmetic. The composer column is
max-w-[46rem]centred in the content area, the card isw-[268px]atright-4, andSIDEBAR_WIDTH_DEFAULTis 280, so the card's left edge isviewport - 284and the composer's right edge is(viewport + sidebar + 736) / 2. They overlap while the viewport is under 1584px:playwright_chat_ui.py)With a model loaded the card lands on Send and eats the click, which is what the chat UI suite caught as a 60s timeout on a visible button. So the docked case keeps its lift, and lifting over a docked composer still leaves the stack at the bottom of the screen, roughly 170px up on a 830px window, not adrift in the middle.
Checks
npm run typecheckcleannpm test: 1313 passing, 0 failingnpm run i18n:check:strictpassesnpm run buildsucceedsmain, none newThree tests added, using boxes measured from a 1280x830 window: the docked composer is dodged, the welcome composer is not, and a monitor away from the corner no longer lifts the stack. All three fail against the old halfway-line rule.