Skip to content

Stop the corner update toasts being cut off at the bottom - #9246

Merged
danielhanchen merged 14 commits into
mainfrom
fix-overlay-toast-shadow-clip
Aug 24, 2026
Merged

danielhanchen merged 14 commits into
mainfrom
fix-overlay-toast-shadow-clip

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Aug 19, 2026 •

Copy link
Copy Markdown
Member

What was wrong

The llama.cpp update toast reads as cut off along its bottom edge: no shadow under it, and when the rail's cap lands a few px short of the card, its rounded bottom corners are sliced off in a straight line.

It shows up on any of the corner cards, in both themes. On the report at b10360 -> b10472-mix-4b653db the top corners are rounded and lifted while the bottom is a flat cut, which is the tell.

Cause

All four corner overlays share one rail in app/provider.tsx: the two update banners, the download panel and the loaded models card. That rail is overflow-y-auto, so it clips at its padding box, and it reserved a gutter sideways only (-mx-3 px-3), never underneath.

Every surface in the rail offsets its shadow downwards (0 2px 8px -2px light, 0 8px 28px -6px dark), so with the bottom card flush against the clip edge, all of its shadow fell outside the box. The card then looks like the window has sliced it. Separately, a cap a few px short of a card cut into the card itself, since nothing in it can give up height, which is the sheared-corners variant in the screenshot.

The gutter was deliberately sideways only: useStackGeometry measures the rail's own scrollHeight, and block padding inflates it, so a card that fits under the composer would measure as one that does not and the rail would lift over the composer for nothing.

Fix

  • STACK_SHADOW_GUTTER = 16, from the deepest shadow the rail carries (dark theme, 8 + 28/2 - 6 below the card). Nothing is reserved above, since neither theme's shadow reaches past the top edge.
  • railCardsHeight() discounts the rail's measured padding from both height probes in measure(), so the placement still reads the cards alone. The reason the gutter was skipped no longer holds.
  • railBottomOffset() and railMaxHeight() add the gutter on top of the band the cards may fill rather than out of it, so every card keeps the exact position it had. A negative block margin cannot do this job: bottom anchors the margin edge, and with top and height auto the engine solves for top, so in Chromium the padding moved the card instead of the box.

Since the clip is at the padding box, this also buys 16px of slack: a cap that lands short of a card now shows it whole instead of taking its corners off.

Verification

Measured on the running rail at 1280x800, with the update card in it:

before after
rail classes ... px-3 ... px-3 pb-4
rail bottom / max-height 16px / 768px 0px / 784px
card inset from bottom, right 16px, 16px 16px, 16px
clip room below the card 0px 16px
sliced with a cap 10px short 10.25px 0px

Also checked the two placements that clipping depends on are unchanged: stackGeometry returns the same bottom and cap for a discounted measurement as it did for an unpadded one.

Tests

  • New tests/overlay-shadow-gutter.test.ts: the gutter clears the deepest shadow, the cards keep their inset and their band, a cap slightly short of a card no longer slices it, the measurement discounts the padding, and the placement is unchanged by it.
  • tests/update-banner-flex-priority.test.ts: the rule pinning "no block padding on the rail" is replaced by the pair it becomes, pb-4 on both rails plus the discount in both probes, and a new case for the compensated offset and cap.
  • tests/monitor-stack-inset.test.ts: the probe-ordering regex now matches the scrollHeight read through railCardsHeight.

npm run typecheck clean, and the suite passes apart from tests/queued-model-capabilities.test.ts, which fails the same way on main (src/features/chat/utils/mmproj-fallback is missing).

@ThomasEricB

ThomasEricB commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Perhaps @shimmyshimmer you could consider taking a quick look at #9196 and see if the issue with the toast there (reported by me) is related to this one? That one also happened between llama.cpp b10360 -> b10472

@danielhanchen

Copy link
Copy Markdown
Member

The three test_update_release_notes.py failures here are the guard, not this PR.

Those tests count the literal maxHeight: stack.maxHeight in provider.tsx to check that every overlay stack is capped. railMaxHeight(stack.maxHeight) is the same measured cap plus STACK_SHADOW_GUTTER, so the cap is still applied twice and the count went to zero.

Fixed on main in #9253: the assertion now matches the cap being derived from stack.maxHeight through an optional wrapping call, which still fails if the cap is dropped, hardcoded, or applied to only one of the two stacks. Checked against this branch with only that test file swapped in: 3 failures becomes 187 passed.

Nothing to change here. Rebase once #9253 lands.

The rest of the red on this PR is main breakage from before #9189, #9213 and #9202 landed, and clears on the same rebase.

danielhanchen added a commit that referenced this pull request Aug 19, 2026
…spelled

Three tests assert every bottom-right overlay stack caps itself, and counted the
literal `maxHeight: stack.maxHeight` in provider.tsx to do it. #9246 keeps the cap
but wraps it -- `maxHeight: railMaxHeight(stack.maxHeight)`, which is the same
value plus a constant gutter so the rail's overflow clip stops slicing the shadow
off its bottom card -- and all three went red against a PR that had not removed a
single cap.

The tests are right about what they care about and wrong about how they check it.
This file already made the same mistake once and fixed it the same way; the
comment two lines below one of these assertions says so:

    Counted by the layer they sit on, not by a literal z-index: the
    overlay rail reads its depth from Z_LAYER now.

_capped_stacks matches the cap being DERIVED from stack.maxHeight, through an
optional wrapping call. That still fails on everything the count was protecting,
verified by mutation: the cap dropped entirely, the cap hardcoded to a number so
it no longer tracks the measurement, and only one of the two stacks capped -- the
exact bug the "== stacks" comparison exists to catch. #9246's wrapped form passes,
and its branch goes from 3 failures to 187 passed with this test alone swapped in.

Nothing about the assertions' subject changes. A cap that stops reading
stack.maxHeight still fails.
danielhanchen added a commit that referenced this pull request Aug 19, 2026
…spelled (#9253)

Three tests assert every bottom-right overlay stack caps itself, and counted the
literal `maxHeight: stack.maxHeight` in provider.tsx to do it. #9246 keeps the cap
but wraps it -- `maxHeight: railMaxHeight(stack.maxHeight)`, which is the same
value plus a constant gutter so the rail's overflow clip stops slicing the shadow
off its bottom card -- and all three went red against a PR that had not removed a
single cap.

The tests are right about what they care about and wrong about how they check it.
This file already made the same mistake once and fixed it the same way; the
comment two lines below one of these assertions says so:

    Counted by the layer they sit on, not by a literal z-index: the
    overlay rail reads its depth from Z_LAYER now.

_capped_stacks matches the cap being DERIVED from stack.maxHeight, through an
optional wrapping call. That still fails on everything the count was protecting,
verified by mutation: the cap dropped entirely, the cap hardcoded to a number so
it no longer tracks the measurement, and only one of the two stacks capped -- the
exact bug the "== stacks" comparison exists to catch. #9246's wrapped form passes,
and its branch goes from 3 failures to 187 passed with this test alone swapped in.

Nothing about the assertions' subject changes. A cap that stops reading
stack.maxHeight still fails.
@danielhanchen

Copy link
Copy Markdown
Member

Confirmed both rails in studio/frontend/src/app/provider.tsx still clip at the padding box with no room under the bottom card, so the toast really does lose its shadow, and the compensation in railBottomOffset/railMaxHeight keeps the cards where they were. Could you get Frontend CI green so this can be reviewed for merge?

@shimmyshimmer shimmyshimmer left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex review

Reviewed the PR changes around the overlay rail shadow gutter, geometry compensation, and tests. I did not find a clear correctness issue that requires changes.

Notes:

  • The compensation approach (adding bottom padding while discounting it from measurement) is consistent with keeping existing card placement while avoiding overflow clipping.
  • The new helper functions make the geometry adjustment easier to test and isolate.
  • The added tests cover the key invariant: the visual gutter should not consume the measured card band.

Leaving this as a comment review only (not approving).

@shimmyshimmer

Copy link
Copy Markdown
Member Author

Perhaps @shimmyshimmer you could consider taking a quick look at #9196 and see if the issue with the toast there (reported by me) is related to this one? That one also happened between llama.cpp b10360 -> b10472

Ooo it's a little different, seems like another user already made a PR for your issue

@ThomasEricB

Copy link
Copy Markdown
Contributor

Ooo it's a little different, seems like another user already made a PR for your issue

I just wanted to make sure if your PR didn't overlap with the other one. Thanks

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@shimmyshimmer
shimmyshimmer force-pushed the fix-overlay-toast-shadow-clip branch 3 times, most recently from 2394509 to 5580d4c Compare August 19, 2026 14:06
@shimmyshimmer

shimmyshimmer commented Aug 19, 2026 •

Copy link
Copy Markdown
Member Author

Thanks, that matches what I found. Rebased onto main so #9253 comes with it, and tests/studio/test_update_release_notes.py is 187 passed on this branch now with no change to the guard.

Frontend is green locally on the rebased tree: 4032 tests pass, typecheck clean, build clean. The two remaining reds were both main's rather than this branch's, and the rebase picks up the fix for each. Chat UI Tests (banner) was failing in python -m playwright install-deps, which is #9289. (Python 3.13) was failing on tests/test_warm_window_review_fixes.py::test_health_snapshot_returns_a_settled_verdict, where the test stubbed CHAT_ONLY_REASON but not CHAT_ONLY_DETAIL and an mlx-vlm bump left a live detail behind, which is #9274. Both are in this branch's base now.

Also pushed one more commit here off the review above: the gutter is now split into 16 below and 8 above, since the light shadow does paint above the card and a capped rail was clipping it.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 5580d4c2ce

ℹ️ 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

Copy link
Copy Markdown
Member

Confirmed both rails in studio/frontend/src/app/provider.tsx still clip at the padding box with no room above or below the cards, and the split gutter with the discount in both measure() probes keeps every card at the position it had.

The bottom-right rail that holds the llama.cpp and Unsloth update toasts, the
download panel and the loaded models card is overflow-y-auto, so it clips at its
padding box. It reserved a gutter sideways only, so the bottom card sat flush
against the clip edge: every surface in the rail offsets its shadow downwards,
so all of that shadow fell outside the box and the card's bottom edge read as
cut off. A cap landing a few px short of a card sliced its rounded corners off
at the same edge.

The gutter was left off downwards because the placement measures the rail's own
scrollHeight and block padding inflates it. railCardsHeight discounts it
instead, and railBottomOffset/railMaxHeight add the gutter on top of the band
the cards may fill, so the cards stay exactly where they were.
The bottom gutter was sized from blur/2, which is the blur's standard deviation
rather than its painted extent, and the comment claimed neither theme paints
above a card. Measured off the rendered blur instead: the dark shadow reaches
30px below a card and 12px above it, the light one 8px and 4px.

Bottom stays 16, where the dark tail is down to one level of #181818 and the
light one has been gone for 8px, and where the viewport edge clips it anyway at
the corner placement. Top becomes 8, so the first card in the rail keeps its
halo instead of being cut flat.
@shimmyshimmer
shimmyshimmer force-pushed the fix-overlay-toast-shadow-clip branch from 5580d4c to ad52a11 Compare August 20, 2026 10:49
@shimmyshimmer

Copy link
Copy Markdown
Member Author

Rebased onto main. #9334 rewrote measure() in the same hunks, so the conflict was real rather than textual and worth spelling out.

Main now reads the rail card by card: natural off the uncapped probe, per-card grown heights beside it, and a floor from usableFloorRoom rather than from the squeezed total, which instead feeds collapsedRoom. The gutter discount belongs on the two totals only. natural and collapsed are both railCardsHeight(node.scrollHeight, gutter) now, since scrollHeight spans the padding box and overflowing compares collapsedRoom against the cards' own cap. The per-card readings are offsetHeight on the cards themselves, so they carry none of the rail's padding and are left alone. usableFloorRoom is bounded by natural, which arrives already discounted.

The source guard in update-banner-flex-priority.test.ts moved with it: it pinned const floor = railCardsHeight(...), which no longer exists, and now pins collapsed instead. void node.scrollHeight (the flush) and node.scrollHeight > node.clientHeight (the overflow read) stay undiscounted on purpose, the second because both sides of that comparison include the padding.

4094 frontend tests pass, tests/studio/test_update_release_notes.py is 187 passed, typecheck and build clean. eslint on the touched files is 12 errors against main's 14 on provider.tsx alone, all react-hooks/refs and all pre-existing.

Last round's fix was scoped by an argument rather than by a measurement, and
the argument was wrong. The rail reaches five of the eight resize targets, not
two, and its lower gutter also sits on the composer.

## The rail reaches five grips, and took three

The harness now carries all eight targets and the driver reports geometric
reach separately from what the rail actually takes, so the set is measured
rather than asserted. Rail scrolling and pointer-active:

| state | reaches | took, before this commit |
| --- | --- | --- |
| 1280x800 | north-east, south, south-east | north-east 32 of 144 |
| 420x760 | those plus north-west, south-west | north-east 32, north-west 32, south-west 80 |

The narrow window is the case I had reasoned away: a card is
`w-[calc(100vw-2rem)]`, so the rail spans nearly the full width and the
left-hand corners come into range. The north-east one needs no narrow window
at all, because the top gutter lifts the rail's box from 16px below the ceiling
to 8, and that corner target is 12px tall. Neither is reachable on the merge
base.

All eight take `Z_LAYER.WINDOW_RESIZE_EDGE` now. The window controls go up with
them as `Z_LAYER.WINDOW_CONTROLS`, because Close's corner and the north-east
grip overlap and the button is what a click there should mean; they were
`z-[80]`, which beat the grips and lost to the stack, and both of those were
the wrong way round. Each control keeps 900 of 900px with the grips above it,
measured.

## The lifted rail sat on the composer it had just dodged

`liftOver` left `STACK_GAP` over the box it dodges. That was enough while the
rail's box ended where its cards did; the box now hangs 16px lower, so at a gap
of 8 the lower 8px of the gutter covered the composer's top edge, 1088px2 of it
at 1280x800. Nothing protects the composer the way `FLOATING_PANEL` protects
the Live monitor: it is ordinary in-page chrome and the stack is meant to paint
over that, so the placement is what has to keep off it.

The clearance is `max(STACK_GAP, STACK_SHADOW_GUTTER_BOTTOM)`, which puts the
rail's box edge exactly on `frame.top` and the cards 16px above it rather than
8. That is the only branch where a card moves, and it moves because something
under it has to stay clickable, which is what `MONITOR_GRIP` already does.

## And the driver's own path filter

`studio-frontend-ci.yml` enumerates the Playwright drivers that start it, so a
PR touching only this one skipped the Chromium run; `studio-ui-smoke.yml`
triggers on `tests/studio/**` but its step loops over firefox and webkit only.

4836 node tests, typecheck, build, bundle in budget, and 2000 states per engine
green in Chromium, Firefox and WebKit.
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 24, 2026
@unslothai unslothai deleted a comment from shimmyshimmer Aug 24, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 24, 2026
@unslothai unslothai deleted a comment from shimmyshimmer Aug 24, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 24, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 24, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 24, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 24, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 24, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 24, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 24, 2026
@unslothai unslothai deleted a comment from shimmyshimmer Aug 24, 2026
@unslothai unslothai deleted a comment from Etherll Aug 24, 2026
@unslothai unslothai deleted a comment from Etherll Aug 24, 2026
@unslothai unslothai deleted a comment from shimmyshimmer Aug 24, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

danielhanchen and others added 2 commits August 24, 2026 08:04
The window-controls toolbar sits inside a positioned, numbered header, so that
header is a stacking context and a z-index on the toolbar is compared inside it
rather than against the resize grips outside it. WINDOW_CONTROLS could not do
what its name said, so it goes, along with its entry in the layer order.

Measured rather than argued, in all three engines: with the grips and the header
both at z-[70] as they were before this branch, Close loses 92 of its 900px and
the other two 60 each, to the 4px north edge strip crossing the buttons and, for
Close, the corner as well. Adding the toolbar number leaves that untouched, and
so does raising the grips: all three shapes measure the same. The overlap is the
titlebar's own, from before this branch, and raising the header to take it back
would put a full-width opaque band over the top of the notification stack, which
this change has no business doing.

The harness had two gaps behind the wrong answer. It rendered the controls with
no header above them, and it rendered the grips first, which is the reverse of
window-titlebar.tsx -- and document order is what decides between equal
z-indexes, so the pre-change control run was measuring a titlebar that does not
exist. Both are fixed, with a compareDocumentPosition guard so the order cannot
drift again and a source guard against a new z-index on the toolbar.
@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: d53e5c17ac

ℹ️ 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

Copy link
Copy Markdown
Member

Before and after from two isolated installs, the merge base db207cdb0 against head 37f0ae57b. One Studio built from each tree, one scene driven against both, and the numbers read from the same page that was photographed.

The surface is the download manager panel, which is the same toast shape the report was about, and the crop is its bottom-left corner: 28px of card and 28px below it. BEFORE the card's bottom edge is cut flat where the rail's overflow-y-auto clips; AFTER the rounded corner and its shadow sit clear of it.

card edge, before and after

The whole card, for context:

the card, before and after

read from the page before after
paintable room under the bottom card 0px 16px
rail computed padding-bottom 0px 16px
rail computed padding-top 0px 8px
rail's own bottom inset 16px 0px
rail max-height 388.5px 412.5px
card top / height 776 / 108 776 / 108

The last row is the part worth checking: the card does not move and does not shrink, so the gutter is paid for by the rail dropping its own edge and growing its own cap, not taken out of the cards. The card's text is identical on both sides too, so nothing in the picture varies except the rail.

Both sides carry the same shadow, rgba(0, 0, 0, 0.16) 0px 2px 8px -2px. Worth noting for anyone reproducing this: hub.css gives .hub-download-panel that shadow in light and box-shadow: none in dark, which is the opposite of the menu-soft-surface toast, so a dark shot of this particular surface has nothing to clip and comes out identical on both sides.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 24, 2026
@danielhanchen
danielhanchen merged commit 54de1e8 into main Aug 24, 2026
40 of 41 checks passed
@danielhanchen
danielhanchen deleted the fix-overlay-toast-shadow-clip branch August 24, 2026 09:27
danielhanchen added a commit that referenced this pull request Aug 24, 2026
…it is missing (#9654)

`Overlay rail shadow gutter, other engines` has failed on every studio-ui-smoke
run since #9246 added it, and passed on #9246 itself. The difference is the
frontend-dist cache.

The harness serves its own vite via `npm run dev` in studio/frontend. That job
never installs the frontend dev dependencies: it installs Studio, and setup.sh
installs them only when it has to build the frontend. The frontend-dist cache
exists precisely to stop that build, and the restore action asserts the
installer reported the frontend up to date. So on a cache miss setup.sh builds,
node_modules exists and the step passes; on a hit there is no node_modules,
`npm run dev` exits 127 with `sh: 1: vite: not found`, and the step fails.
#9246's own run missed the cache. Every run since has hit it.

The harness is right and its use in studio-frontend-ci.yml is right, where
`npm ci` has already run. Only the new step's assumption was wrong: what that
shard has already paid for is the WebKit and Firefox install, not a frontend
toolchain.

So the shard installs the dependencies itself, conditional on the binary rather
than unconditional, because on the cold-cache path setup.sh has already put them
there and `npm ci` would delete and refetch them. The step then checks the binary
actually arrived, since a silent install would surface later as a Playwright
timeout rather than as a missing toolchain.

start_vite now refuses up front with the cause and the remedy. "vite exited with
code 127" reads as a vite crash; the toolchain was never installed, and the two
must not look the same. This is what made the failure look like flake: identical
job, identical commit, green or red depending on a cache key.

While here, the wildcard-host detector added in #9623 only matched a command at
the start of a line, so `UNSLOTH_STUDIO_PASSWORD=... unsloth studio -H 0.0.0.0`
in the Launch section passed the guard. It now matches the command anywhere on
the line. Twelve fixtures pin what the detector must catch and must not, because
every negative assertion in that file passes when the detector sees nothing: a
detector that quietly stops matching turns the whole file green while guarding
nothing.
shimmyshimmer added a commit that referenced this pull request Aug 25, 2026
Resolved against #9246, which landed the same shadow-gutter work this branch
deletes the machinery for.

#9246 reserves a gutter so the rail's overflow clip stops cutting the card
shadows off, and pays for it with railBottomOffset, railMaxHeight and
railCardsHeight around the JS placement. The gutter is a real fix and still
applies, since the rail still scrolls; the placement is what this branch is
removing. So the gutter is carried over in CSS, with the same constants and the
same measured sizes:

  bottom-0 + paddingBottom 16 + paddingTop 8, cap calc(100dvh - 8px)

which is the cards' own band, 100dvh - 2rem, plus the 24px of gutter around it.
Measured on the merged build at 431x678: the rail's border box sits on the
floor and 4px from the right, its padding is 16/8, and the cards still land 16px
off both edges. Cap 670 = 678 - 8. Nothing inline sets bottom or maxHeight.

Also from #9246, kept as-is: the window resize grips take Z_LAYER
.WINDOW_RESIZE_EDGE, since a rail on the floor spans them. It matters less here,
because this rail is click-through in every state rather than only when it is
not scrolling, but the guard costs nothing and the layer is the right home.

Deleted with the machinery they exercise: smoke-overlay-rail-main.tsx and its
page, tests/studio/playwright_overlay_rail.py, and the two CI steps that ran it.
The harness exists to drive the real useStackGeometry, which is gone.
overlay-shadow-gutter.test.ts is rewritten against the CSS instead of the
deleted helpers, so #9246's rule that the gutter costs the cards no room is
still pinned.

The Playwright corner probe now reads the bottom off the rail's padding box
rather than its border box, which the gutter moved to the floor.
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.

3 participants