Repository navigation
Studio: mark the root when the chat wallpaper is ready instead of html:has() - #16117
Merged
Merged
Conversation
…l:has() #15973 cleared the Desktop titlebar over a ready wallpaper with four html:has(...) rules, which titlebar-modal-layering forbids: a :has() on the document root re-matches on every DOM change. ChatBackground now sets data-chat-wallpaper-ready (and -workspace-ready) on <html> while the app's own wallpaper is ready, ref-counted, and the rules key off those. The guard's attribute check also allows other attributes on the titlebar's tag.
Member
Author
|
@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. |
|
Codex Review: Didn't find any major issues. 🎉 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". |
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.
The 12th frontend failure #15973 (customizable chat background images and effects) left on main. #16116 fixes the other 11.
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 whytitlebar-modal-layeringforbids 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
ChatBackgroundsetsdata-chat-wallpaper-readyon<html>while the app's own wallpaper is ready, plusdata-chat-wallpaper-workspace-readywhen it sits in the workspace. The marks are reference-counted and removed when the wallpaper unmounts, deactivates or loses its frame.> .chat-wallpaperrelation the old selectors used. So the settings previews never mark the root, just as they never matched before.html[data-chat-wallpaper-ready]andhtml[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-layeringmatcheddata-slot="window-titlebar"immediately followed bydata-viewport-backdrop-open=, and Studio: add customizable chat background images and effects #15973 had putdata-wallpaper-sidebar-pinnedbetween them. The pattern now allows other attributes inside the same opening tag.Verification
tests/titlebar-modal-layering.test.tsandtests/chat-background.test.ts: 12 passed. On main the titlebar case fails.index.cssfails the root:has()check, and droppingdata-viewport-backdrop-openfrom the titlebar fails the attribute check.smoke-chat-background.htmlI added stand-inwindow-titlebar(sidebar pinned, twodata-wallpaper-chrome-controls) andwindow-titlebar-decorationelements, with base styles in@layer utilitieslike the real classes. Computed styles, main and this branch alike:<html>marks (branch)rgb(255, 255, 255)(--sidebar)Text shadow on the controls also matches (
rgb(254, 254, 253) 0px 1px 8pxwhen ready).tsc --noEmit -p tsconfig.app.jsonis clean.