fix(php-transformer): keep responsive variant chrome out of a second header - #2241
Merged
Merged
Conversation
…header A shared template part is visible on every viewport. Binding it while a responsive document still contains that landmark rendered the header twice. Leave those landmarks page-owned unless every copy can be hoisted.
chubes4
marked this pull request as ready for review
September 26, 2026 01:01
This was referenced Sep 26, 2026
Closed
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
Inner pages rendered the site header twice at desktop width: the template bound a header part, and the page content still contained a second header landmark inside the desktop document variant. The extra chrome pushed the first navigation link and the rest of the page down.
Root cause
Responsive document variants often do not share one landmark identity, so
inlineSharedShells()cannot replace both copies.sharedShells()still extracted the variant it recognized as shared chrome, bound that part on the page template, and left the other variant's landmark inpost_content. A template part is visible at every viewport, so the rendered page had both.Fix
Before a shared shell is committed, refuse extraction when a responsive document variant still contains a site-level landmark for that area. Identical chrome across variants is still hoisted, because every copy is removed and the check does not fire. Divergent variants stay page-owned inside their visibility-gated documents, so the template does not add a second header.
Regression test
php tests/contract/shared-shell-plan.phpFails before:
Passes after:
Also passed:
wordpress-site-plan,viewport-hidden-document-variants,entry-point-transform-parity.Verification
Fresh import with Static Site Importer
origin/main@6f0eff4packaged against this commit. Four inner routes at 1440:At 390 the desktop document is
display:none, the mobile document isdisplay:contents, and exactly one header landmark is visible.Fixes #2237
AI disclosure: implemented by xAI Grok 4.7 via OpenCode (
opencode run), orchestrated and reviewed by Claude (Anthropic).