Skip to content

Studio: give toasts and floating cards the composer's glass in Glass mode - #19970

Merged
shimmyshimmer merged 3 commits into
mainfrom
studio-glass-floating-cards
Nov 27, 2026
Merged

shimmyshimmer merged 3 commits into
mainfrom
studio-glass-floating-cards

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

With Glass on, several floating surfaces stayed opaque grey on top of the wallpaper:

  • the runtime update card
  • the downloads card
  • the loaded models card
  • the API monitor and the live monitor
  • the library selection bars, the guided tour card and a few error cards

Toasts did use glass, but in a menu style with a drop shadow, so they didn't match the composer.

What changed

  • Same look as the composer. Toasts ([data-sonner-toast]), the update cards (.toast-surface) and the floating cards (new .glass-card class) 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.
  • Layered shadow override. The Liquid menu lift on .menu-soft-surface is set with a layered !important, so the card shadow is overridden inside @layer utilities.
  • WebKit corner rail fix. The corner rail that holds the update, downloads and loaded models cards was always a scroll container (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 (overlayRailScope sets data-rail-scrolls).
  • Lens. .glass-card is a glass lens host, like the other glass popups.
  • Label. The glass "Show on" option now reads "All pages (everything)" in English, since it covers every page and popup.

Verification

  • npm run typecheck, npm test (17471 pass, 0 fail) and npm run build all pass.
  • I updated the existing CSS pin tests for the selectors that grew, and added tests/glass-floating-cards.test.ts.
  • I rendered the built CSS in Chromium (dark, Liquid 3D, Glass menus on). The composer, a toast, the update card, downloads, loaded models and the live monitor now compute the same background colour, backdrop-filter, rim-only box-shadow and bevel. Before this change, downloads and the live monitor were solid.

BEFORE and AFTER in Chromium, dark Liquid 3D: downloads and the live monitor go from solid to the composer's glass; every card now matches the composer reference

Not tested here

  • The WebKit rail fix is not tested in the Desktop app. Playwright's WebKit build does not render backdrop-filter, and this host can't inspect the Desktop webview.
  • The composer's extra fill and blur inside a running conversation are not copied. The cards match the composer as it looks on the New chat screen.

…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.
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Nov 27, 2026
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-27T13:36:25.542713Z 9e3d04b Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: ec5f14a649

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

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 9e3d04b369

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

@shimmyshimmer
shimmyshimmer merged commit 6b018da into main Nov 27, 2026
6 of 43 checks passed
@shimmyshimmer
shimmyshimmer deleted the studio-glass-floating-cards branch November 27, 2026 15:20
danielhanchen added a commit that referenced this pull request Nov 27, 2026
…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.

![Before and after: bottom-right corner rail at 921x534 and 390x500 on
New chat. The two sides render the same at rest; after the fix the rail
scrolls when its cards do not
fit](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/20005/composite-255a75480d46.png)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant