Repository navigation
Studio: mount the API monitor inside a host that stays mounted, so opening it in Glass stops restyling the app - #17418
Merged
Conversation
…ening it in Glass stops restyling the app
Member
Author
|
@codex review |
Codex Review Summary: ✅ CompletedThis 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. Hooray! 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.
Summary
With Reduce motion on (the default since #17377), opening or closing the floating API monitor in any Glass material restyled the whole app root. That is the area-matrix failure on main and on every PR, in
Frontend build + bundle sanity,Composer (ubuntu-latest, browsers)andInline images (ubuntu-latest):This fixes it without touching Reduce motion, Glass, or how the panel looks or behaves.
Cause
__root.tsxrenders<ApiMonitorOverlay />before the sidebar, and the overlay returned itsAnimatePresencedirectly. Each open therefore inserted the panel'sfixedwrapper as the first child of#root, and each close removed it again.A Chrome trace with invalidation tracking shows that insertion invalidating the whole
#rootsubtree (Chromium's positional sibling invalidation). Under Reduce motion in Glass that is about 1,700 elements on open and 1,650 on close. The position is what matters. In the same page state:<div>prepended to#root<div>appended to#root<div>appended to<body>Change
ApiMonitorOverlaynow returns an always-mounted host,<div data-api-monitor-host="" className="contents">, with theAnimatePresenceinside it. The panel mounts and unmounts inside that host, so#root's children never change when it opens.display: contentskeeps the host out of layout. The panel isposition: fixedwith its own z-index, so where it sits and what it covers are unchanged.useIdpaths of everything after it are unchanged.tests/api-monitor-stable-host.test.tspins this: the overlay returns the host, the host is not conditional and iscontents, andAnimatePresencesits inside it. On main's overlay the test fails.Measured
Production long-thread build, Chromium, the area matrix's own
Page.sweep, elements restyled by theapi_monitorarea:All of these are now well inside the 10x ceiling (at most 3.6x), and CPU stays inside it too (liquid 7.1x, liquid-3d 5.9x at 200 turns).
Testing
tests/api-monitor-stable-host.test.tspasses, and fails on main's overlay.api-monitor-snapshot,drag-costs-no-render,floating-panel-position,glass-motion,find-in-page,keyboard-shortcuts.tsc --noEmitis clean.Nothing on screen changes: the panel opens in the same place with the same fade, so there are no before and after screenshots.