Repository navigation
Studio: give toasts and floating cards the composer's glass in Glass mode - #19970
Conversation
…mode Toasts, the update cards, downloads, loaded models, the API and live monitors, the library selection bars, the guided tour card and a few error cards now share the composer's fill, blur, rims and bevel, with no drop shadow. The corner rail only becomes a scroll container when its cards overflow, so WebKit's blur reaches the wallpaper instead of a grey layer.
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Swish! 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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. 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". |
…date banner layout red since #19970) (#20005) ## Problem The update banner layout check (`tests/studio/playwright_update_banner_layout.py`) fails 6 of its 2159 checks on main. It fails on the Linux `Chat UI Tests (chat)` leg, the Windows `Chat UI Tests` leg and the Mac `Chat UI, API, Update and GGUF inference` leg, on every staging run built on current main, for example #19837, #14119, #14292, #15300 and #19627: ``` [banner] FAIL 921x534 new chat expanded: the bottom card is on the corner, not floating above it lastPaintedFromBottom=4 (want 16) [banner] FAIL 390x500 new chat collapsed: the bottom card is on the corner, not floating above it lastPaintedFromBottom=9.1 (want 16) ``` The other four failures are the same check on the Train and Model hub pages, at the same two sizes. The cards in the corner rail (update, llama.cpp update, downloads, loaded models) are supposed to sit 16 px above the corner. At these two window sizes the bottom card lands 4 px and 9 px from the edge instead. #19970 made the rail `overflow: visible` while its cards fit, and scroll only once they outgrow it (`data-rail-scrolls`), so WebKit can blur glass cards against the page. That part is right. But `overlayRailScope` decided "outgrow" with `scrollHeight > clientHeight`, and for an `overflow: visible` box Chromium leaves the end padding out of `scrollHeight`. Cards that run into the rail's 16 px bottom padding, but not past its border, read as `scrollHeight == clientHeight`: the rail never starts scrolling, and the bottom card sits in the gutter. The same 921x534 layout on a bare page in Chromium, cards running 12 px into the bottom padding: | rail | `scrollHeight` / `clientHeight` | bottom card from the corner | |---|---|---| | `overflow: visible` (main) | 534 / 534 | 4 px, and the rail does not scroll | | `overflow: auto` (before #19970) | 546 / 534 | scrolls | Before #19970 the rail was always a scroll container, so the same layout scrolled. ## Fix `railOverflows()` in `studio/frontend/src/lib/toast-offset.ts`: - It keeps the `scrollHeight` test. - It also measures the span of the rail's in-flow cards plus its top and bottom padding against `clientHeight`. Dragged cards are `fixed` elsewhere and are left out. - `overlayRailScope` uses it, so the rail scrolls whenever its cards do not fit. - While they fit, the rail stays `overflow: visible`, so #19970's WebKit glass fix is unchanged. On the bare page above: - Cards 12 px into the padding: the old test reports no overflow, `railOverflows` reports overflow. - Cards that fit with room to spare: both report no overflow, and the bottom card sits at 16 px. ## Verification - `tests/toast-offset.test.ts`, new case: cards running into the bottom padding with `scrollHeight == clientHeight` count as overflow; a fitting stack, a stack with a dragged `fixed` card, and an empty rail do not; a real `scrollHeight` overflow still does. `toast-offset.test.ts` and `glass-floating-cards.test.ts`: 27 passed. - `npm run typecheck` and `eslint` on both files: clean. - The browser check itself, `tests/studio/playwright_update_banner_layout.py`, run against a local Studio install of main (`6047d3b980`) with the same driver CI uses: - Before, main: `2159 checks, 6 failed`. The same six as CI: 921x534 expanded and 390x500 collapsed on New chat, Train and Model hub, `lastPaintedFromBottom=4` / `9.1`. - After, the same install with only this PR's `toast-offset.ts` rebuilt in: `2153 checks, 0 failed`. - The six corner checks are not run in those six layouts any more, because the rail now scrolls there, exactly as it did before #19970. The check only judges the corner while the rail is not scrolling. Every other check, including "can be scrolled into the rail's view" for each card, passes on both sides. ## Screenshots Bottom-right corner of the two failing layouts, from the driver's own screenshots of the run above. At rest the pixels are the same on both sides: the stack does not fit these windows, and the bottom card runs into the gutter either way. What changes is that the rail is a scroll container again when its cards outgrow it, as before #19970, rather than an `overflow: visible` box that lets them spill into its padding. 
With Glass on, several floating surfaces stayed opaque grey on top of the wallpaper:
Toasts did use glass, but in a menu style with a drop shadow, so they didn't match the composer.
What changed
[data-sonner-toast]), the update cards (.toast-surface) and the floating cards (new.glass-cardclass) now use the composer's own glass rules: fill, blur, Frosted grain, Liquid rims and sheen, and the Liquid 3D bevel. They are added to the composer's selector lists, so they stay in sync with it. There is no drop shadow; the edge comes from--composer-shadow, and the composer outline setting applies to them as well..menu-soft-surfaceis set with a layered!important, so the card shadow is overridden inside@layer utilities.overflow-y-auto). In the macOS app, cards inside it rendered as a flat dark grey (rgb 29,29,29 across the whole card, darker than the solid #272727). That is a translucent fill over black, not over the wallpaper. The rail now scrolls only while its cards actually overflow (overlayRailScopesetsdata-rail-scrolls)..glass-cardis a glass lens host, like the other glass popups.Verification
npm run typecheck,npm test(17471 pass, 0 fail) andnpm run buildall pass.tests/glass-floating-cards.test.ts.backdrop-filter, rim-onlybox-shadowand bevel. Before this change, downloads and the live monitor were solid.Not tested here
backdrop-filter, and this host can't inspect the Desktop webview.