Repository navigation
Let the floating monitor paint over the notification stack - #8199
Conversation
Windows Unsloth UI CI is red on main. The smoke drags the API monitor to the
corner, resizes it to fill the viewport, then clicks its Close button, and the
click never lands:
waiting for get_by_test_id("floating-monitor").get_by_role("button", name="Close")
- element is visible, enabled and stable
- <div class="menu-soft-surface pointer-events-auto ... w-[268px] ...">
from <div class="pointer-events-none fixed right-4 z-[9998] ...">
The interceptor is the loaded models card, in the bottom-right overlay stack.
The stack is supposed to dodge this monitor, and usually does: stackBottomInset
lifts it clear of a monitor in its column. The dodge has a floor, though. A
monitor filling the viewport leaves nowhere to lift to, so the lift is clamped
to MIN_STACK_ROOM and the stack is parked at the top of the screen, which is
exactly where that monitor's title bar and Close button now are. The clamp is
right, since a stack pushed off screen would be worse. What was wrong is what
happens next: the monitor's container sits at z-50 and the stack at z-[9998], so
a passive status card paints over a window the user is dragging, resizing and
closing.
Raise the monitor's container to z-[9999]. Still below the startup screen, which
blocks the app while the backend comes up, and below tooltips, which have to
stay readable above whatever spawned them.
tests/studio/test_overlay_layering.py reads the numbers out of the source and
compares them, rather than pinning any one of them, so renumbering a layer does
not break it. It also catches the two stacks drifting apart from each other.
Mutation-tested, all six caught: monitor back under the stack; stack raised over
the monitor; the two stacks disagreeing; the monitor's container losing its z
entirely; startup screen dropping below the monitor; tooltips dropping below the
monitor.
|
This is not Windows-only. So both |
|
This PR fixes the three red Chat UI checks on main. All three fail at The remaining red checks here are not this PR's:
Merged with #8197 and #8175 onto |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4702b54316
ℹ️ 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".
| <div | ||
| ref={setConstraintsElement} | ||
| className="pointer-events-none fixed inset-4 z-50" | ||
| className="pointer-events-none fixed inset-4 z-[9999]" |
There was a problem hiding this comment.
Keep modal dialogs above the floating monitor
When the persisted monitor is open while a modal appears—for example RemoteCodeConsentDialog, TransformersUpgradeDialog, or StopRunningChatsDialog mounted in __root.tsx—this raises the interactive panel to 9999 while the shared alert-dialog overlay and content remain at z-50 in components/ui/alert-dialog.tsx. A monitor moved or resized across the dialog will therefore paint over it and intercept its clicks; at the supported near-viewport size it can hide the confirmation entirely. Place the monitor in a layer above the 9998 status stack but below modal surfaces, or raise those modal surfaces accordingly.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed, and the three of these share one root cause worth naming.
Verified z-indexes in the tree: ui/alert-dialog.tsx 50, tauri/window-titlebar.tsx 70 and 80, api-monitor/api-monitor-overlay.tsx 50, the bottom-right notification stack 9998, this panel now 9999.
So the suggested remedy, a layer above 9998 but below modal surfaces, does not exist: 9998 is already above all three. The notification stack has been painting over modals and native window chrome since before this PR. What this PR changes is that the monitor joins that tier, where previously it tied with the modal overlay at 50 and was resolved by DOM order.
That makes all three real, and it also means the honest fix is not a different number for this one panel. It is an ordered layer scale where modals and native chrome sit above transient overlays. Doing that here would widen a two-file fix for a Windows UI smoke block into a layering rework, so I am taking it as a follow-up rather than folding it in, and I will say so on the PR.
| <div | ||
| ref={setConstraintsElement} | ||
| className="pointer-events-none fixed inset-4 z-50" | ||
| className="pointer-events-none fixed inset-4 z-[9999]" |
There was a problem hiding this comment.
Keep desktop window controls above the monitor
On Windows/Linux with the custom titlebar, a monitor resized to the top of its inset-4 constraint begins at y=16 and can extend across the titlebar's 34px band. Raising it to 9999 puts its pointer-events-auto panel above the titlebar and window-control toolbar, which remain at z-[70] in components/tauri/window-titlebar.tsx; the overlapping lower portion of the drag region and minimize/maximize/close buttons then paints behind the monitor and receives no pointer events. Preserve a higher layer for native window chrome or keep the monitor clear of that band.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed. The titlebar is z-[70] and its controls z-[80], both below the 9998 stack, so this band was already reachable by an overlay before this PR. The monitor's inset-4 floor puts it at y=16 against a 34px band, so the overlap is the lower 18px and only when the panel is dragged to the top. Real, narrow, and part of the same layering problem. Tracking it with the other two.
| <div | ||
| ref={setConstraintsElement} | ||
| className="pointer-events-none fixed inset-4 z-50" | ||
| className="pointer-events-none fixed inset-4 z-[9999]" |
There was a problem hiding this comment.
Avoid covering the API monitor overlay
When the persisted resource monitor is open and new API traffic auto-opens ApiMonitorOverlay, both panels coexist and default to the bottom-right corner, but the API panel remains at z-50 in features/api-monitor/api-monitor-overlay.tsx. This new 9999 layer forces the resource monitor over the API panel, covering the API panel's header and Close button at their shared right edge; if the resource monitor has been resized across the viewport, the API panel becomes entirely inaccessible. Coordinate these two interactive panels through collision avoidance or active-window stacking rather than globally placing one above the other.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed, and this is the one I would fix first of the three: two interactive panels that both default to the bottom-right corner, one now unconditionally above the other, is a collision the user cannot resolve. Your suggestion of collision avoidance or active-window stacking is the right shape, and it is not a z-index change. Tracking it with the other two.
|
Convergence pass. Review: 3 items, all correct, all reacted and answered inline. They share one root cause, so recording it here rather than only in the threads. Verified z-indexes in the tree: The suggested remedy, a layer above 9998 but below modal surfaces, does not exist: 9998 is already above all three. The notification stack has been painting over modals and native window chrome since before this PR. What changes here is that the monitor joins that tier, where it previously tied with the modal overlay at 50 and was resolved by DOM order. So the real fix is an ordered layer scale where modals and native chrome sit above transient overlays, plus collision handling between the two bottom-right interactive panels, which is not a z-index change at all. That is a larger piece of work than a two-file fix for a Windows UI smoke block, so it is a follow-up rather than something folded in here. The API monitor collision is the one I would do first: two panels defaulting to the same corner with one unconditionally above the other is a state the user cannot get out of. CI: 3 red, none of them this PR's.
Current main is merged in, and the suites this PR is about are green: |
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! 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". |
The Live resource monitor and the API monitor panel both default to the bottom-right corner, and #8199 moved the monitor from z-50 to z-[9999] to get it over the notification stack. The API panel stayed at z-50, so from then on the monitor painted over that panel's rows and its "Expand to full monitor" button, and a monitor resized across the viewport -- which the Windows UI smoke does on purpose -- hid the panel completely, Close button included. Raising the API panel too would only move the argument up a layer. Studio already solves this in this exact corner and does not use z-index for it: the notification stack does not outrank the monitor, it steps over it, reading the boxes the monitor and the chat composer publish to the monitor frame store. The API panel now does the same thing one rung further in. * It reads every published box but its own and takes the first free anchor: the corner it shipped in, else the same column stepped over whatever is in the way, else another corner. A free corner means nothing moves. * It publishes its own box, so the notification stack steps over it as well. That was a second collision -- a passive status card at z-[9998] sat on a panel at z-50 -- and it goes away for free. * Dragging it freezes the placement. A user who wants the panels overlapping is not argued with. The drag offset is folded back into the anchor on release, as the monitor does, so the published box stays honest and a window shrunk afterwards still pulls the panel back on screen. Neither panel keeps a position across reloads, so a panel stranded off the edge has no way back. Geometry cannot answer the case the smoke creates, because a monitor filling the viewport leaves nowhere clear. So the two panels now share one layer and the one the user touched last comes forward, with one override: a panel with no pixel showing cannot be clicked, so it cannot be raised by that rule, and it comes forward on its own. Only the API panel asks for that -- it is the one that opens and places itself. With the monitor maximised the panel lands bottom-left, which is the corner that leaves the monitor's own Close button and resize grip free. The z-indexes themselves move into studio/frontend/src/lib/z-layers.ts, which is the first place the ordering is written down rather than inferred from six files: OVERLAY_STACK 9000 < FLOATING_PANEL 9100 < FLOATING_PANEL_TOP 9101 < STARTUP_SCREEN 9999 < TOOLTIP 999999 Renumbering the top band only. Nothing else in the tree sits between 121 and 999998, so every relationship with every other surface is unchanged; the two notification stacks and the two panel containers move onto the constants, and the startup screen and tooltips keep their classes with the test pinning them to the scale. The in-page band -- dialogs, sheets, dropdowns, the Tauri titlebar, all on Tailwind's own scale at 50 to 120 -- is deliberately left alone: putting modals over the notification stack is a real question, but toasts above modals is the usual convention rather than an accident, and the titlebar half of it needs a desktop build to verify. reads z-layers.ts instead of a class literal and still asserts the panels beat the stack and stay under the startup screen and tooltips, and the Windows UI smoke's drag-resize-close on the monitor passes. Mutation-tested, sixteen, all caught: never stepping over anything; the refuge corner preferring the right-hand side; the panel climbing into the top chrome; taking the first candidate whatever it covers; dodging only the first published box; "fully covered" reading as merely overlapping, and a strip left showing on each of the four edges; a hand-placed panel not being pulled back on screen; a hidden panel staying hidden; raising notifying when nothing changed; every panel claiming the front; the stack going back over the panels; the front panel climbing two steps; a named layer dropping into the in-page band; the monitor hard-coding its z again; one notification stack drifting off the named layer; the startup screen dropping below the panels.
The Live resource monitor and the API monitor panel both default to the bottom-right corner, and #8199 moved the monitor from z-50 to z-[9999] to get it over the notification stack. The API panel stayed at z-50, so from then on the monitor painted over that panel's rows and its "Expand to full monitor" button, and a monitor resized across the viewport -- which the Windows UI smoke does on purpose -- hid the panel completely, Close button included. Raising the API panel too would only move the argument up a layer. Studio already solves this in this exact corner and does not use z-index for it: the notification stack does not outrank the monitor, it steps over it, reading the boxes the monitor and the chat composer publish to the monitor frame store. The API panel now does the same thing one rung further in. * It reads every published box but its own and takes the first free anchor: the corner it shipped in, else the same column stepped over whatever is in the way, else another corner. A free corner means nothing moves. * It publishes its own box, so the notification stack steps over it as well. That was a second collision -- a passive status card at z-[9998] sat on a panel at z-50 -- and it goes away for free. * Dragging it freezes the placement. A user who wants the panels overlapping is not argued with. The drag offset is folded back into the anchor on release, as the monitor does, so the published box stays honest and a window shrunk afterwards still pulls the panel back on screen. Neither panel keeps a position across reloads, so a panel stranded off the edge has no way back. Geometry cannot answer the case the smoke creates, because a monitor filling the viewport leaves nowhere clear. So the two panels now share one layer and the one the user touched last comes forward, with one override: a panel with no pixel showing cannot be clicked, so it cannot be raised by that rule, and it comes forward on its own. Only the API panel asks for that -- it is the one that opens and places itself. With the monitor maximised the panel lands bottom-left, which is the corner that leaves the monitor's own Close button and resize grip free. The z-indexes themselves move into studio/frontend/src/lib/z-layers.ts, which is the first place the ordering is written down rather than inferred from six files: OVERLAY_STACK 9000 < FLOATING_PANEL 9100 < FLOATING_PANEL_TOP 9101 < STARTUP_SCREEN 9999 < TOOLTIP 999999 Renumbering the top band only. Nothing else in the tree sits between 121 and 999998, so every relationship with every other surface is unchanged; the two notification stacks and the two panel containers move onto the constants, and the startup screen and tooltips keep their classes with the test pinning them to the scale. The in-page band -- dialogs, sheets, dropdowns, the Tauri titlebar, all on Tailwind's own scale at 50 to 120 -- is deliberately left alone: putting modals over the notification stack is a real question, but toasts above modals is the usual convention rather than an accident, and the titlebar half of it needs a desktop build to verify. reads z-layers.ts instead of a class literal and still asserts the panels beat the stack and stay under the startup screen and tooltips, and the Windows UI smoke's drag-resize-close on the monitor passes. Mutation-tested, sixteen, all caught: never stepping over anything; the refuge corner preferring the right-hand side; the panel climbing into the top chrome; taking the first candidate whatever it covers; dodging only the first published box; "fully covered" reading as merely overlapping, and a strip left showing on each of the four edges; a hand-placed panel not being pulled back on screen; a hidden panel staying hidden; raising notifying when nothing changed; every panel claiming the front; the stack going back over the panels; the front panel climbing two steps; a named layer dropping into the in-page band; the monitor hard-coding its z again; one notification stack drifting off the named layer; the startup screen dropping below the panels.
* Keep the two floating panels out of each other's corner The Live resource monitor and the API monitor panel both default to the bottom-right corner, and #8199 moved the monitor from z-50 to z-[9999] to get it over the notification stack. The API panel stayed at z-50, so from then on the monitor painted over that panel's rows and its "Expand to full monitor" button, and a monitor resized across the viewport -- which the Windows UI smoke does on purpose -- hid the panel completely, Close button included. Raising the API panel too would only move the argument up a layer. Studio already solves this in this exact corner and does not use z-index for it: the notification stack does not outrank the monitor, it steps over it, reading the boxes the monitor and the chat composer publish to the monitor frame store. The API panel now does the same thing one rung further in. * It reads every published box but its own and takes the first free anchor: the corner it shipped in, else the same column stepped over whatever is in the way, else another corner. A free corner means nothing moves. * It publishes its own box, so the notification stack steps over it as well. That was a second collision -- a passive status card at z-[9998] sat on a panel at z-50 -- and it goes away for free. * Dragging it freezes the placement. A user who wants the panels overlapping is not argued with. The drag offset is folded back into the anchor on release, as the monitor does, so the published box stays honest and a window shrunk afterwards still pulls the panel back on screen. Neither panel keeps a position across reloads, so a panel stranded off the edge has no way back. Geometry cannot answer the case the smoke creates, because a monitor filling the viewport leaves nowhere clear. So the two panels now share one layer and the one the user touched last comes forward, with one override: a panel with no pixel showing cannot be clicked, so it cannot be raised by that rule, and it comes forward on its own. Only the API panel asks for that -- it is the one that opens and places itself. With the monitor maximised the panel lands bottom-left, which is the corner that leaves the monitor's own Close button and resize grip free. The z-indexes themselves move into studio/frontend/src/lib/z-layers.ts, which is the first place the ordering is written down rather than inferred from six files: OVERLAY_STACK 9000 < FLOATING_PANEL 9100 < FLOATING_PANEL_TOP 9101 < STARTUP_SCREEN 9999 < TOOLTIP 999999 Renumbering the top band only. Nothing else in the tree sits between 121 and 999998, so every relationship with every other surface is unchanged; the two notification stacks and the two panel containers move onto the constants, and the startup screen and tooltips keep their classes with the test pinning them to the scale. The in-page band -- dialogs, sheets, dropdowns, the Tauri titlebar, all on Tailwind's own scale at 50 to 120 -- is deliberately left alone: putting modals over the notification stack is a real question, but toasts above modals is the usual convention rather than an accident, and the titlebar half of it needs a desktop build to verify. reads z-layers.ts instead of a class literal and still asserts the panels beat the stack and stay under the startup screen and tooltips, and the Windows UI smoke's drag-resize-close on the monitor passes. Mutation-tested, sixteen, all caught: never stepping over anything; the refuge corner preferring the right-hand side; the panel climbing into the top chrome; taking the first candidate whatever it covers; dodging only the first published box; "fully covered" reading as merely overlapping, and a strip left showing on each of the four edges; a hand-placed panel not being pulled back on screen; a hidden panel staying hidden; raising notifying when nothing changed; every panel claiming the front; the stack going back over the panels; the front panel climbing two steps; a named layer dropping into the in-page band; the monitor hard-coding its z again; one notification stack drifting off the named layer; the startup screen dropping below the panels. * Studio: keep the panel's refuge on the side it actually came from The refuge ranking read the side back out of the candidate's left coordinate, but a 400px panel anchored right in a 768px window sits at left=352, which is left of the midpoint. The bottom-right anchor was therefore ranked as a left-hand refuge, tied with the real one, and won on order, so with the monitor over the whole viewport the panel stayed exactly where it was: on top of the Close button and the resize grip this fallback exists to keep reachable. Each candidate carries the corner it came from now. * Studio: count the overlay rails by their z-layer, not a literal z-index Two pins looked for the class string 'z-[9998] flex flex-col items-end gap-2' to find the bottom-right rails and count them. The rails read their depth from Z_LAYER now, so both counted zero and passed vacuously on one assert and failed on the next. * Studio: find the overlay rails without the literal z-index The two remaining pins split provider.tsx on 'fixed right-4 z-[9998]' to reach the rail's class list. The rails read their depth from Z_LAYER now, so that literal is gone and both splits found nothing.
Windows Unsloth UI CIis red onmain. The smoke drags the API monitor to the corner, resizes it to fill the viewport, then clicks Close. The click never lands:The interceptor is the loaded models card, inside the bottom-right overlay stack. It is not a test flake: with a model loaded and the monitor maximised, a user cannot close the monitor.
Why the dodge did not save it
The stack is supposed to dodge this monitor, and normally does.
stackBottomInsetlifts it clear of a monitor in its column, andmonitor-stack-inset.test.tscovers that in fourteen cases.The dodge has a floor. A monitor filling the viewport leaves nowhere to lift to, so the lift is clamped:
which parks the stack 120px from the top of the screen. That is exactly where a maximised monitor's title bar and Close button are. The clamp itself is correct, since a stack pushed off screen would be worse. The problem is what decides the outcome once they do overlap: the monitor's container is
z-50and the stack isz-[9998], so a passive status card paints over a window the user is dragging, resizing and closing.The fix
Raise the monitor's constraints container to
z-[9999].Ordering afterwards, highest first: tooltips
z-[999999], startup screenz-[9999], floating monitorz-[9999], overlay stackz-[9998]. The monitor stays under the startup screen, which blocks the app while the backend comes up, and under tooltips, which have to stay readable above whatever spawned them. It never coexists with the startup screen, so sharing that number is not a real contest.I considered the alternative of collapsing or hiding the stack when there is no room to dodge. That leaves banners visible in more cases, but it makes the loaded models indicator disappear exactly when a model is loaded, which is when it is meant to be there. Window beats status card.
Tests
tests/studio/test_overlay_layering.pyreads the z-indexes out of the source and compares them, rather than pinning any single value, so renumbering a layer does not break it. It also catches the browser and desktop stacks drifting apart from each other.Six mutations, all caught:
The real check is the Windows smoke, which does the drag, the resize and the click for real. It takes about twenty minutes and needs a Windows runner, so these read the numbers instead and fail in milliseconds.
Expected CI noise
Repo tests (CPU)will be red on this PR until #8197 lands. Those are the six stale contract tests that are already red onmainand have nothing to do with this change; three of them live intest_update_release_notes.py, which this branch also touches nothing in.