Repository navigation
WP Build Polyfills: keep the boot frame steady on load and across admin navigation - #52235
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Backup plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Boost plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Search plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Social plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Protect plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Videopress plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Wpcomsh plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Premium Analytics plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 1 file.
|
Paint boot's stage on the empty app container before it mounts, hold a wp-build page's first render until its markup has parsed, and keep the stage out of cross-document view transitions so it no longer zooms out over the next page. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014sK5iF6puPdBLBbBVhBB4U
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014sK5iF6puPdBLBbBVhBB4U
55fac16 to
03dc9eb
Compare
CGastrell
left a comment
There was a problem hiding this comment.
Verdict: approve. No blockers. Mechanism is sound and I confirmed the gating against WP 7.0.4: wp_enqueue_view_transitions_admin_css is on admin_enqueue_scripts and the template enqueues {slug}-wp-admin-prerequisites there too, so both handles are in the queues by admin_head, and WP_Dependencies::do_items() never clears queue. The generated container has no whitespace text node, so :empty holds. pageswap is the right seam — the old snapshot is captured after handlers run.
The changelog set is also right: of the 12 plugins that bundle the package, stats reaches it only through My Jetpack (not a wp-build page by default), and starter-plugin / mu-wpcom-plugin are excluded by convention. The Activity Log: prefix is correct for backup/boost/protect/search — Boost's and Backup's own modern dashboards are both default-off, so Activity Log is each one's only visible wp-build surface today.
Three non-blocking notes, all about accuracy rather than behavior:
-
The render hold ignores
prefers-reduced-motion.wp-admin/css/view-transitions.csswraps@view-transition { navigation: auto }in@media (prefers-reduced-motion: no-preference), but the style handle is enqueued on every WP 7.0 admin screen. PHP can't see the media query, so a reduced-motion user pays the 240–411ms hold and never gets a transition for it. I don't think that's cleanly fixable —<script>takes nomediaandrel=expectis already ruled out — so the ask is wording. The docblock onprint_render_hold()("Only where Core enables cross-document view transitions") and the PR's trade-off note both read as if the cost tracks the benefit. Worth saying it is unconditional on WP 7.0+ wp-build pages. -
class-wp-build-admin-frame.php:26is now false. "Pages without a boot layout are unaffected: the selectors match nothing" was true while every selector keyed off.boot-layout--single-page.[id$="-wp-admin-app"]:emptymatches before any boot layout exists, and onJetpack_Activity_Log::render_fallback()(activity-log/src/class-jetpack-activity-log.php:295) where one never appears. Suggest: "Pages without a boot mount container are unaffected: the selectors match nothing." -
A container that never mounts keeps the panel forever (
class-wp-build-admin-frame.php:98-104).:emptyis the only "not mounted yet" signal, so on an asset 404, a boot load error, or the Activity Log fallback above,#wpbodystays pinned to100vhwith the white panel on the backdrop indefinitely. Today that failure reads as a blank white page; after this it reads as a successfully-rendered empty app, which is harder to spot as broken. A one-line note on the rule would save the next reader the rediscovery.
Nothing else: no new sibling-package calls, the one Phan suppression is a justified test no-op, the CSS is logical-property clean, and the new tests pin both gate branches plus the CSS-not-JS approach.
— Terminator
The render hold runs under reduced motion too, the `:empty` selectors match before any boot layout exists, and a container that never mounts keeps the panel. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
@CGastrell Addressed all three in 403bcaf, comment wording only:
Generated by Claude. |
Fixes JETPACK-2574
Proposed changes
Jetpack's wp-build dashboards (Forms, Newsletter, Activity Log, Social, VideoPress, Premium Analytics, Podcast) flash in two places: while the page loads, and when you move to or from one through the admin menu. This keeps the frame steady in both. All three changes live in
WP_Build_Admin_Frame, which everyWP_Build_Polyfills::register()call already arms.@wordpress/buildpage template's critical CSS setsbody.js { background: #fff }, so the area beside the admin menu stays white until boot mounts, then jumps to the admin-menu backdrop around a rounded stage. On desktop (783px and up) the empty[id$="-wp-admin-app"]container now gets that backdrop and a 12px white panel where boot's stage lands. The panel is plain#fff: boot's theme provider whitens the stage on every admin color scheme, while the root surface token is#fcfcfc. Below 783px the template's white already matches boot's full-screen stage, so nothing changes there.#wpadminbarand#adminmenumainwere parsed, so the transition captured a page without its chrome: every menu item faded out on its own and the page cross-faded into a blank frame. A deferred, render-blocking script in<head>(<script src="data:text/javascript," defer blocking="render">) now holds the reveal until parsing completes.wp-view-transitions-adminstylesheet is enqueued (WordPress 7.0+) and a*-wp-admin-prerequisitesscript is queued, which the generated page template does on its own page. Elsewhere, first paint is not delayed.@wordpress/bootunresolved.srcthroughesc_url(), which stripsdata:URLs.::view-transition-old(boot--stage):only-childswitched it tozoomOut, so the previous screen reappeared in its rounded patch and shrank. When the navigation has a view transition, apageswaphandler adds a class to the root that unnames boot's stage, inspector and canvas surfaces, andpagerevealremoves it. Boot's in-app route transitions are unchanged.Trade-offs:
rel=expectrejected.<link rel="expect" blocking="render">was tried first and held only 3 of 6 navigations in Chrome, so it isn't used.Related product discussion/links
wp-includes/view-transitions.php(WordPress 7.0), Core Trac #64529Does this pull request change what data or activity we track or use?
No.
Testing instructions
Use WordPress 7.0+ and Chrome, with reduced motion off in the OS, on a connected site where Jetpack → Forms, Newsletter and Activity Log are available. Those three are wp-build dashboards by default.
Load flash (JETPACK-2574)
Frame flash between pages (JETPACK-2561)
<head>contains<script id="wp-build-admin-frame-render-hold" src="data:text/javascript," defer blocking="render">. It is absent on other screens, such as Posts or My Jetpack, and on WordPress versions before 7.0.No regressions
@wordpress/bootbare-specifier error in the console.🤖 Generated with Claude Code
https://claude.ai/code/session_014sK5iF6puPdBLBbBVhBB4U