Repository navigation
Scope viewport entrances to device documents through core viewport queries - #5260
Merged
Merged
Conversation
chubes4
force-pushed
the
feat/media-scoped-entrances
branch
from
November 9, 2026 17:49
6ec0d9c to
16f6c10
Compare
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.
Problem
A source can play an entrance animation on some devices only. Wix, for example, animates sections on desktop and tablet but not on phones. When Data Liberation merges device documents into one tree, the replay runtime has no device scope, so a desktop-only entrance would animate on mobile too. Because of that, Data Liberation has to keep such routes as dual documents (Automattic/data-liberation-agent#1613, step 3).
Fix
Entrance evidence can carry an optional
deviceslist: the device-document keys whose source plays the entrance. This is the same vocabulary asdevice-only/device-hide.WP_Theme_JSON::get_viewport_media_queries()(withinclude_desktop) to the runtime. An entrance's device scope therefore always matches block visibility, even if the theme's breakpoints change later.after) pose and doesn't arm the observer.devicesbehaves exactly as before.Evidence
tests/contract/viewport-entrance-runtime-browser.mjsgets another-devicemode: at 1440px, a["mobile"]entrance renders its final visible pose. Thenormalmode now carries["desktop"]and still runs the full transition and repeat lifecycle. The new mode fails on trunk (other-device: final visible markup) and passes with the fix.mobile: 480px, tablet: 782px, gives{"mobile":"(width <= 480px)","tablet":"(480px < width <= 782px)","desktop":"(width > 782px)"}.viewport-entrance-runtime.phpandviewport-entrance-shared-footer.phpcontracts pass, and phpcs is clean.deviceswhen it merges one-sided entrance evidence, follows in a separate PR.AI disclosure: diagnosed and implemented by Claude (Opus) via the Pi coding agent for Chris Huber, outside Homeboy Cook (Homeboy daemon stale after an upgrade; operator authorized a direct fix). Verification: the browser contract was run locally against trunk and against the fix, plus the core query extraction on WP 7.1, the PHP contracts and phpcs; full suites in CI.