Repository navigation
Studio: follow the chat background from #15973 through three frontend guards - #16116
Merged
Merged
Conversation
- general-settings-token-sync stubs @/features/chat-background, which General Settings now imports - smoke-chat-background.html loads /crypto-boot.js before its module entry, as every page must - the wallpaper composer outline is set through --composer-shadow, so toasts and composers keep reading one shadow variable; computed box-shadow is unchanged with the outline on and off
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. |
danielhanchen
pushed a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Oct 30, 2026
danielhanchen
pushed a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Oct 30, 2026
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? 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". |
danielhanchen
added a commit
that referenced
this pull request
Oct 30, 2026
…l:has() (#16117) The 12th frontend failure #15973 (customizable chat background images and effects) left on main. #16116 fixes the other 11. ``` not ok - the titlebar dims for viewport backdrops without a :has() on the document root expected not to match /(?:^|[\s,{}(>~+])(?:html|body|:root)...:has\(/ ``` To clear the Desktop titlebar over a ready wallpaper, #15973 added four rules of the form `html:has(:is([data-wallpaper-workspace], [data-chat-content-root]) > .chat-wallpaper[data-ready]) [data-slot="window-titlebar"] ...`. The titlebar renders outside the wallpaper's subtree, so a plain descendant selector cannot reach it. A `:has()` whose subject is the document root, though, makes every DOM mutation anywhere a candidate for re-matching. That is why `titlebar-modal-layering` forbids it, and why the viewport-backdrop dimming next to it goes through a store and an attribute instead. Here the product needed the change, not the test. ## Change - `ChatBackground` sets `data-chat-wallpaper-ready` on `<html>` while the app's own wallpaper is ready, plus `data-chat-wallpaper-workspace-ready` when it sits in the workspace. The marks are reference-counted and removed when the wallpaper unmounts, deactivates or loses its frame. - The check reads the wallpaper's direct parent, the same `> .chat-wallpaper` relation the old selectors used. So the settings previews never mark the root, just as they never matched before. - The four rules now key off `html[data-chat-wallpaper-ready]` and `html[data-chat-wallpaper-workspace-ready]`. They are still unlayered, so they keep beating the titlebar's Tailwind utilities. The pinned-sidebar segment rule stays more specific than the transparent-controls rule, so it still wins. - `titlebar-modal-layering` matched `data-slot="window-titlebar"` immediately followed by `data-viewport-backdrop-open=`, and #15973 had put `data-wallpaper-sidebar-pinned` between them. The pattern now allows other attributes inside the same opening tag. ## Verification - `tests/titlebar-modal-layering.test.ts` and `tests/chat-background.test.ts`: 12 passed. On main the titlebar case fails. - Sabotage: restoring main's `index.css` fails the root `:has()` check, and dropping `data-viewport-backdrop-open` from the titlebar fails the attribute check. - Behaviour. The titlebar only renders in the Desktop app on Windows and Linux, so I measured it rather than screenshotting it. On `smoke-chat-background.html` I added stand-in `window-titlebar` (sidebar pinned, two `data-wallpaper-chrome-controls`) and `window-titlebar-decoration` elements, with base styles in `@layer utilities` like the real classes. Computed styles, main and this branch alike: | State | titlebar bg / backdrop-filter | first controls (pinned sidebar) bg | other controls bg / backdrop-filter | decoration | `<html>` marks (branch) | |---|---|---|---|---|---| | no wallpaper | red / blur(4px) | red | red / blur(4px) | visible | none | | wallpaper ready | transparent / none | `rgb(255, 255, 255)` (`--sidebar`) | transparent / none | hidden | ready, workspace-ready | | after Reset all | red / blur(4px) | red | red / blur(4px) | visible | none | Text shadow on the controls also matches (`rgb(254, 254, 253) 0px 1px 8px` when ready). - Full frontend suite: the only failures left are the 11 that #16116 fixes. `tsc --noEmit -p tsconfig.app.json` is clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#15973 (add customizable chat background images and effects) left 12 frontend unit tests red on main. Every PR's
Frontend unit testsandFrontend build + bundle sanityjobs fail on them, for example #16109, #16110 and #16112. This fixes 11 of the 12. The last one is the titlebar:has()on the document root, which needs a product change and goes in its own PR.1. General Settings token sync (9 tests)
general-tab.tsxnow importsresetChatBackgroundfrom@/features/chat-backgroundfor Reset all preferences. The test's stub map was one module behind, so this adds"@/features/chat-background": { resetChatBackground: async () => true }.2. Every page loads the polyfill (1 test)
The new smoke page skipped the
crypto.randomUUIDpolyfill that every other page loads before its module entry. It now carries the same<script src="/crypto-boot.js"></script>.3. Toasts and composers read one shadow variable (1 test)
The wallpaper composer draws an outline instead of a drop shadow, which is a deliberate design. It now sets that through the variable rather than around it:
--composer-shadow: inset 0 0 0 1px var(--border); box-shadow: var(--composer-shadow);. The "Composer outline" off rule sets--composer-shadow: none, and its:has()is more specific, so it still wins. Nothing reading--composer-shadowsits inside the composer surface, so the override reaches nothing else.Verification
general-settings-token-sync9/9,crypto-uuid-boot4/4,toast-composer-shadow2/2 andchat-background7/7 pass. The one remaining failure istitlebar-modal-layering's document-root:has(), as described above.smoke-chat-background.html, driven the waytests/studio/playwright_chat_background.jsdrives it (reset, upload an image, toggle Composer outline):box-shadowof both preview composers and the live composer isoklch(0.9208 0 0) 0px 0px 0px 1px insetwith the outline on andnonewith it off, on main and here alike.index.cssswapped, is 80 / 26 pixels for outline on / off. Main against main is 71 / 26, so that is the run-to-run noise floor and there is no visible change.Screenshots
Chat background settings with an uploaded image on this branch. Composer outline on: the previews and the live composer keep the 1px outline.
Composer outline off: no outline and no shadow, as on main.