Skip to content

Studio: glass theme dims the wallpaper instead of blurring it, page controls take the model button glass, Reduce motion off by default - #16751

Merged
shimmyshimmer merged 14 commits into
mainfrom
studio-glass-blur-scope
Nov 5, 2026
Merged

shimmyshimmer merged 14 commits into
mainfrom
studio-glass-blur-scope

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Glass theme polish: wallpaper dimming instead of blur, model-button glass on every page, and Reduce motion off by default

What changed

Wallpaper under glass

  • The 1.5px blur on the wallpaper artwork has been removed. It applied on every route, New chat included.
  • Every route except the New chat welcome view now dims the wallpaper the way an open conversation already did (0.7 of the conversation visibility).
  • Images, Video and Audio dim it a little further (0.56). The root marks those routes with data-wallpaper-media.
  • New chat shows the image at full strength with no blur.

Controls on non-chat pages take the chat model button's glass

  • On Model hub, Library, Scheduled, API, Images, Video, Audio and the other pages, resting surfaces get the Select model button's fill, sheen, edge and backdrop blur. That covers cards and panels, fields and search boxes, outline buttons, the selected tab or view toggle, and the hub pills, chips and download card.
  • Only buttons that already draw a hover or selected pill get the frost; text-only tabs and filters (Library's Suggested / Favorites row and the All / Chats / Projects / Sections / Archived filters) stay plain.
  • The model picker at the top of these pages (Images, Video, Audio, API) gets the full Select model treatment, including the Liquid 3D edge.
  • Grouped cards (API panels and stats, Library grid cards) get 8px more blur and a fill lifted 6% toward white than single controls. Library cards carry a library-card class for this, and the API status chip and dividers carry glass-inset / glass-divider.
  • In dark mode the API stats grid shows the wallpaper in the gaps between its cells instead of painting a second fill behind them.

Light mode

  • Light glass draws no grey outlines outside the chat composer. The Liquid and Liquid 3D rims, hover pills, the white control glass and the plain-glass menus keep their top highlight and inner glow but lose the 1px grey ring. The composer keeps its outline and full sheen.
  • Page controls use the white control glass (--glass-control, 30% white) and cards a lighter 45% white sheet. Both are edged with a shared inner light (--glass-light-inner: top highlight plus a soft top and bottom glow) instead of a hairline. Native 1px borders are off on these surfaces, rounded boxed panels such as the API code sample lose their outline, and checkboxes, radios and switches keep theirs.
  • API cards use a thinner 30% fill, so the frost shows, and carry no outline. The stats grid is one glass card with single hairline dividers instead of framed cells.
  • The sidebar, both model pickers and the API status chip drop their grey outlines. The sidebar has no edge line, and the pickers and chip take the shared inner light.
  • Pages skip the extra wallpaper dimming, which under the white reading wash left the image at about 1%, and the wash itself is 12 points thinner.
  • New chat lifts the Visibility slider along sqrt(v) (24% shows about 49%, 100% stays 100%), so the slider changes the image across its whole range. Browsers without sqrt() fall back to a capped 2x multiply.

Strips removed

  • The Library tab row frosted a strip of wallpaper while nothing was under it. It now frosts only once rows scroll beneath it.
  • The API model bar no longer blurs, and its 24px fade is hidden over a wallpaper. Together these drew a band behind the picker.

Menus

  • In dark Liquid glass, the sidebar chat row menus (Rename, Pin, Move to and the rest, plus sub-menus) lost the glass rim: a flat dark .sidebar-menu rule with box-shadow: none !important outranked it. A more specific rule in the same layer gives them the same rim and lift as the More menu.

Sheen

  • The Liquid and Liquid 3D sheen, rim and edge highlights run at 90% of their previous strength.
  • The chat composer keeps the full sheen; its original values are restored on the composer surface.

Sign-in button

  • The submit button on the login and "Setup your account" pages is about 7% smaller. Its size is em-based, so the whole button scales evenly.

Reduce motion

  • New installs default to Off instead of System, on both the frontend store and the backend personalization model.
  • System and On remain selectable. A missing or invalid value falls back to Off.
  • Existing installs that already saved System keep it.
  • The Playwright harnesses emulate prefers-reduced-motion: reduce to keep menus and transitions instant. With Off they would ignore that, so the shared helper (tests/studio/_playwright_robust.py) and six full-app suites seed Reduce motion as System before the page loads.

Verification

  • npm run typecheck, npm test (14941 pass), npm run build
  • python -m pytest studio/backend/tests/test_personalization_settings.py (61 pass)
  • tests/window-material.test.ts covers the new rules: dimming with no artwork blur, page control glass, page model pickers, the row-menu rim, the cleared Library and API strips, the 90% sheen with the composer exception, the pill-only hover rule, grouped cards, and the light mode fills, inner light edges, outline-free rims, wash and New chat curve. tests/reduce-motion-default.test.ts covers the new default.
  • Checked by hand in an isolated Studio built from this branch (PyTorch-free, macOS, dark Liquid 3D glass with a wallpaper) by reading computed styles in the browser:
    • Model hub, Library, API, Scheduled and Images controls carry the glass blur and fill, and the API stats gaps are clear.
    • The model picker reads 90% sheen while the composer keeps the full value.
    • The API bar and its fade are hidden, and New chat wallpaper opacity is 1 while other pages are dimmed.

Not tested here

  • The light mode values were checked from computed styles; the wallpaper image itself did not render in the browser used for checking, so the visual balance against a real image was judged by the reviewer, not here.
  • The non-Liquid materials were only checked through the stylesheet tests.
  • Windows and Linux shells, and the native macOS vibrancy material, were not run.
  • Images, Video and Audio generation need a GPU, so only the idle page chrome was checked.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

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

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T11:52:06.825574Z a7c1cdb 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 chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 99422132d3

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

Comment thread studio/frontend/src/index.css Resolved
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2dfa77ed14

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

Comment thread studio/frontend/src/index.css Resolved
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: a7c1cdb6a6

ℹ️ 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 9ebc608 into main Nov 5, 2026
@shimmyshimmer
shimmyshimmer deleted the studio-glass-blur-scope branch November 5, 2026 12:02
danielhanchen added a commit to Imagineer99/unsloth that referenced this pull request Nov 5, 2026
…s off the thread

Light Glass welcome rules (unslothai#16751) read the data-chat-welcome root flag, and the
Windows page blur rule (unslothai#16671) uses the child path to the pinned sidebar container.
The guard now also covers data-windows-wallpaper-page, which holds the hidden chat.

[skip ci]
danielhanchen added a commit to NilayYadav/unsloth that referenced this pull request Nov 6, 2026
## What changed

Typing in a long, idle chat could stall in Unsloth Desktop on Windows.
The wallpaper fade rule used a descendant search inside `:has()`, so
editing the composer could trigger a costly style recalculation across
the chat. The slowdown reproduced with turn navigation disabled and no
model running.

Use direct-child selectors for the two wallpaper layouts. The plain
Glass backdrop contains the image directly, and an uploaded wallpaper
wraps it in a frame. Both keep their existing fade behavior.

## Verification

- In Windows WebView2, median keydown-to-second-frame latency in the
same synthetic 600-message chat fell from **160.1 ms to 5.0 ms**. The
same source builds passed all 16 wallpaper fade cases.
- Extended the existing thread-ancestor performance guard to check every
combinator in wallpaper paths inside `:has()`. On the original
stylesheet, the three prior checks pass and the new check fails on the
fade selector. All 28 tests across the thread-ancestor, wallpaper and
appearance suites pass with the fix.

Playwright sent the final key at 1.88 seconds in both recordings. The
full phrase appeared at 4.09 seconds before the fix and 1.88 seconds
after it. The capture compares the parent and implementation commit. The
follow-up commits only change the regression tests.

![Before and after typing in an idle 600-message chat on Windows
WebView2](https://raw.githubusercontent.com/Imagineer99/unsloth/8fd91c242dc7fc4461a96973630e1f9da4016468/pr-media/long-chat-typing.gif)



## Glass users and the latest main

The fade selector was one of four whole-thread `:has()` searches on the
workspace that holds the chat. With Glass on (stored per origin, so
Desktop can have it on while the same chat at 127.0.0.1:8888 does not),
the other three still made every keystroke re-walk the thread:

- `:not(:has(.aui-thread-welcome-center))` and
`:has([data-tour="chat-compare-view"])` on the workspace (wallpaper dim,
plus two Glass rules added in unslothai#16643)
- `.aui-thread-viewport:has(.aui-thread-welcome-center)` on the thread
scroller itself

The welcome and compare views now set `data-chat-welcome` /
`data-chat-compare` on `<html>` in a layout effect (counted, so compare
panes and remounts stay correct), and the viewport rule uses the fixed
child path to the welcome block. The branch is merged with main. The
guard test now checks every `:has()` anchored on an element that holds
the thread, including ones nested in `:not()`.

Typing into an idle 600-message chat, headless Chromium, same server, JS
and DOM, only the stylesheet differs, arms interleaved, 6 reps each,
median [min-max]:

| Glass | Arm | Style recalc per key | 88-char burst | Keydown to 2nd
frame |
|---|---|---|---|---|
| on | main (A/A: two arms) | 26.4 / 23.4 ms | 2.97 / 2.87 s | 36.7 /
33.1 ms |
| on | fade fix only | 23.4 ms [20.6-30.1] | 2.85 s | 34.0 ms |
| on | this PR | 1.4 ms [1.4-2.4] | 0.68 s | 13.7 ms |
| off | main (A/A: two arms) | 22.7 / 20.8 ms | 2.51 / 2.41 s | 31.2 /
30.0 ms |
| off | fade fix only | 1.1 ms [1.0-1.4] | 0.62 s | 15.8 ms |
| off | this PR | 1.1 ms [0.9-2.4] | 0.65 s | 13.9 ms |

No visual change: 192 wallpaper states (workspace and chat root,
backdrop / frame / crossfade, ready, fade, welcome / conversation /
compare / compare with an empty pane, Glass on and off) compute the same
display, opacity, viewport wash and composer glass values on main and on
this PR in Chromium, Firefox and WebKit (576 cells, 0 differ; dropping
the rules flips 96 of 192, so the check is live). The real app shows the
same computed values on main and on this PR for welcome, conversation
and compare, with and without Glass.

Typing a 57-character question at 80 ms per key into the same
600-message chat with Glass on (4.6 s is the floor):

![Typing into an idle 600-message chat with Glass on, main above and
this PR
below](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/16656/typing-edd898b05ecd.gif)


## Issue unslothai#16603

Fixes unslothai#16603. Bisecting the Studio frontend from `v0.1.913` to `main` on
a seeded 200-turn agent chat (about 427K tokens: reasoning, tool cards,
web sources, compaction markers, code, KaTeX), headless Chromium, same
server and data for every build:

| Build | Style work per keystroke | 88-key burst | Scroll long tasks |
| --- | --- | --- | --- |
| before unslothai#16333 | 15.6 ms | 1.29 s | 189 ms |
| unslothai#16333 (the fade `:has()` this PR bounds) | 619 ms | 58.1 s | 268 ms |
| `v0.1.914-beta` | 144 ms | 13.9 s | 280 ms |
| `main` | 136.5 ms | 11.4 s | 935 ms |
| `main` + this PR | 4.6 ms | 1.32 s | 27 ms |

unslothai#16751 (Reduce Motion default off) made scroll pay the same walk more
often (61 ms to 188 ms per wheel step); this PR removes the walk, so no
separate change is needed there, and it is why turning Reduce Motion on
did not help typing. A spoofed agent session that grows to 30 turns with
tool calls, file edits, web search and compaction rounds goes from 23.7
to 100.3 ms per key on `main` and stays near 1.2 ms per key with this
PR.

unslothai#16801 adds a CI gate that fails when selector matching per keystroke
grows with chat length; it should merge after this PR.

---------

Co-authored-by: Daniel Han <[email protected]>
danielhanchen added a commit to Imagineer99/unsloth that referenced this pull request Nov 6, 2026
…the chat grows (unslothai#16801)

Adds a browser CI gate that fails when typing in a long chat costs more
as the chat grows, the shape of unslothai#16603.

**Stacked on unslothai#16656. Please merge unslothai#16656 first**: this branch contains
its commits, and the gate fails on current `main` by design (that is the
regression it catches).

## Why

unslothai#16603 came back because nothing in CI measured per-keystroke cost
against chat length. Bisecting the Studio frontend from `v0.1.913` to
`main`:

| Build (200-turn agent chat, about 427K tokens) | Style work per
keystroke |
| --- | --- |
| before unslothai#16333 | 15.6 ms |
| unslothai#16333 (wallpaper fade `:has()`) | 619 ms |
| `v0.1.914-beta` | 144 ms |
| `main` | 136.5 ms |
| `main` + unslothai#16656 | 4.6 ms |

unslothai#16333 added a descendant `:has()` on elements that hold the whole
thread (`[data-wallpaper-workspace]`, `[data-chat-content-root]`), so
Chromium (Desktop, Chrome, Edge) walks every message on each keystroke.
Firefox is not affected, which matches the "browser is fine" reports.
unslothai#16751 (Reduce Motion default off) then made scroll pay that walk more
often (61 ms to 188 ms per wheel step), which is why turning Reduce
Motion back on did not help typing. unslothai#16300 (`d56738f40`) already removed
two other unslothai#16333 rules that restyled the whole page on every key
(real-app bisect: 563.8 to 91.2 ms per key), which is why 0.1.914 was
slow but not as slow as unslothai#16333. The fade rule stayed. unslothai#16656 removes
every such rule and adds a static guard test; this PR adds the runtime
gate so a new rule of that shape, or anything else that scales with chat
length, cannot ship again.

## What the gate does

`tests/studio/playwright_long_thread_gate.py` runs **first** in every
frontend lane, right after `npm ci`: Frontend CI (Linux, Windows),
Composer compatibility (Ubuntu, macOS, Windows, Safari) and Inline
images (Ubuntu, macOS, Windows).

1. Builds `smoke-thread-weight.html` for production
(`vite.long-thread.config.ts`) and seeds an agent-style history inside
the real app ancestors (`?shell=1`: sidebar workspace, wallpaper, chat
content root) with open reasoning, tool cards, web sources, compaction
markers, code, KaTeX and tables. The fixture shape is checked, so a
fixture that stops rendering something fails.
2. Measures the 200-turn chat first. Two untraced keys decide how much
to trace: a healthy page traces 10 keys, a slow one 2, and a page
hundreds of times slower than healthy fails on the untraced number
alone.
3. Fails if `:has()` matching costs more than 5 ms per key at 200 turns,
or if total selector matching per key grows more than 2x from 40 to 200
turns. A second repeat runs only when the ratio is near the limit. Both
checks are ratios or tiny budgets on selector matching, so a slow runner
cannot fail them.

## What a failure says

A failure prints ms per key at each size, how far over budget it is and
the top selectors with their match attempts. Selectors tried on most of
the DOM are marked as likely victims of a whole-page restyle. It then
pins down the trigger: it removes `:has()` rules from the stylesheet
text before fresh page loads (rules switched off in a page that already
rendered leave Chromium's `:has()` state behind and blame the wrong
rule) and bisects for the rule whose removal makes typing cheap, trying
rules that search an element holding the thread first. Each rule found
is mapped to its likely source with a text match, worded as a
possibility. On current `main`:

```
FAIL: :has() matching costs 63.6 ms per keystroke at 200 turns, budget 5.0 ms (12.7x over); total selector matching 358.9 ms/key
  pin-down at 60 turns, untraced style recalc per keystroke: 48.5 ms with all 262 :has() rules, 1.1 ms with none of them
  Measured: removing only this rule takes the keystroke from 48.5 to 1.8 ms (no :has() rules: 1.1 ms); this rule on its own costs 4.9 ms:
    :is([data-wallpaper-workspace], [data-chat-content-root]):has(> .chat-wallpaper[data-ready] .chat-wallpaper-image[data-fade="false"]) .thread-bottom-fade
    It is possible this section caused the issue, but we cannot be sure (a text match):
      studio/frontend/src/index.css:6210 (exact text match)
    Pattern: `:has(> .chat-wallpaper[data-ready] .chat-wallpaper-image[data-fade="false"])` on `:is([data-wallpaper-workspace], [data-chat-content-root])` searches all descendants (no leading `>`, or a space inside), so Chromium re-walks everything under that element after each DOM change, whether or not anything matches.
      `[data-wallpaper-workspace]` (first found in studio/frontend/src/app/routes/__root.tsx:720) holds the whole thread, so every keystroke walks every message.
```

`tests/studio/test_css_culprit.py` covers the source mapping and the
`:has()` shape check.

## Replay against past stylesheets

The gate on this branch, with only `index.css` swapped in from each
commit (CPU runner):

| `index.css` from | Verdict | Time | Pin-down |
| --- | --- | --- | --- |
| before unslothai#16333 (`4ce36bc3b5`) | PASS | 25 s | |
| unslothai#16333 (`65e868dcf5`) | FAIL | 104 s | fade rule: 276.0 to 1.5 ms
without it |
| unslothai#16442 (`6401ceda29`) | FAIL | 105 s | fade rule |
| `v0.1.914-beta` | FAIL | 101 s | fade rule |
| `main` | FAIL | 104 s | fade rule: 48.5 to 1.8 ms without it |
| this branch | PASS | 28 s | |

On GitHub runners a passing gate takes 30 to 77 s per lane plus 12 to 24
s for Chromium (staging run of every lane on Linux, Windows and macOS).

## Other changes

- The smoke fixture gains `rich` agent content (markdown, table, list)
and the `?shell=1` app shell.
- The gate's Chromium step installs missing Linux libraries only when
Chromium cannot launch, through `retry-with-apt-lock.sh` with
`APT_ACQUIRE_RETRIES=0` and a 10 minute step timeout, like the other
browser steps.

---------

Co-authored-by: imagineer99 <[email protected]>
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