Repository navigation
Studio: glass theme dims the wallpaper instead of blurring it, page controls take the model button glass, Reduce motion off by default - #16751
Conversation
…im media pages more
…r auth submit button
…still collapses animations
…fixes and New chat visibility curve
|
@codex review |
Codex Review SummaryThis 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. |
There was a problem hiding this comment.
💡 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".
|
@codex review |
There was a problem hiding this comment.
💡 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".
|
@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". |
…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]
## 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.  ## 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):  ## 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]>
…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]>
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
data-wallpaper-media.Controls on non-chat pages take the chat model button's glass
library-cardclass for this, and the API status chip and dividers carryglass-inset/glass-divider.Light mode
--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.sqrt(v)(24% shows about 49%, 100% stays 100%), so the slider changes the image across its whole range. Browsers withoutsqrt()fall back to a capped 2x multiply.Strips removed
Menus
.sidebar-menurule withbox-shadow: none !importantoutranked it. A more specific rule in the same layer gives them the same rim and lift as the More menu.Sheen
Sign-in button
Reduce motion
prefers-reduced-motion: reduceto 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 buildpython -m pytest studio/backend/tests/test_personalization_settings.py(61 pass)tests/window-material.test.tscovers 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.tscovers the new default.Not tested here