fix(php-transformer): share fragment-equivalent variant menus - #2250
Merged
Merged
Conversation
…ragment Desktop and mobile navigations with the same labels and paths were split into two entities when one URL kept an in-page fragment. Compare destinations without that fragment so both blocks can reference one navigation entity.
…tion entity Shell identity still ignores a selected item's geometry carrier, but the navigation post keeps it so both viewports render the source item box.
Contributor
Author
|
Holding: verification on a fresh import found that trunk (with #2248) no longer extracts shared header/footer parts for this responsive-variant capture; bisected to #2248, tracked in the new regression issue. The shared-menu behaviour here can't be verified end to end until that is fixed. AI disclosure: Claude (Anthropic) via OpenCode. |
…s diverge Navigation compilation can split the unlabeled shell candidate so a responsive pair no longer clusters, and a document-wide landmark scan drops large pages. Hoist a dominant desktop/mobile pair into one shared header and footer instead.
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
Desktop and mobile header menus with the same labels and paths stayed independent when one URL kept an in-page fragment. A rename in the Site Editor could not update both viewports. The shared navigation post also dropped the current item's geometry carrier, so the rendered item box no longer matched the source.
Depends on #2245 (paragraph-labelled menus become
core/navigation) and #2248 (one menu entity per destination list). Those are already on trunk. #2248 and static-site-importer#1865 were merged before this follow-up; they do not setrefon hosts (inline children stay until SSI materializes) and they compared full URLs, fragment included.After #2248, a responsive-variant capture that previously extracted shared
headerandfooterparts produced no template parts. #2251.Root cause
NavigationEntityProjectionclustered onlabel + url, so/journaland/journal#sectionwere different menus.ShellExtraction::withoutCurrentNavigationState()also strippedbe-inline-geometry-*from the current item when building the entity that both viewports render. Shell identity still needs that strip; the rendered entity does not.The missing parts are a separate ordering/identity failure. Navigation compilation makes the unlabeled shell candidate diverge, so
sharedShellsnever reaches the viewport-partition hoist. Inline extraction then claims the pair asheader-1/footer-1, or a document-wide landmark regex exhausts PCRE on a large page and rejects the whole area. Either way the template-boundheader.htmlandfooter.htmlparts are not emitted.Fix
ref) so WordPress can render before SSI binds an integerref.header-1/footer-1parts. When shell candidates do not cluster, hoist a dominant desktop/mobile pair into one template-bound header and footer.Regression test
php php-transformer/tests/contract/shared-navigation-entity.phpFails before (
git stashof the projection / shell change):and, for the geometry line:
Passes after:
php php-transformer/tests/contract/shared-shell-plan.phpFails before this commit (inline variants, no shared header/footer):
Passes after:
Also passed:
php php-transformer/tests/unit/shell-landmark-policy.php,php php-transformer/tests/unit/route-current-navigation.php.Verification
Paired SSI dev package imported the private capture (quality_pass, 0 fallbacks).
parts/header.htmlandparts/footer.htmlexist. Provenance reasonresponsive_variant_partition. Both header navigations are self-closingcore/navigationblocks with the sameref(onewp_navigation)./,/shop/, and/services-1/./,/shop/, and/services-1/.Static Site Importer
mainHomeboy Test is green after the later CI fix (run 36270107473). No SSI change in this pass.Fixes #2246
Fixes #2251
AI disclosure: implemented by xAI Grok 4.7 via OpenCode (
opencode run), orchestrated and reviewed by Claude (Anthropic).