Conversation
…m-element hosts A presentation-only custom element wrapping a nav was captured as companion HTML before NavigationPattern could see the landmark, so paragraph-wrapped menu labels never became editable navigation links.
…nition A custom-element nav that also carries a display:none accessibility hint must stay on the path that preserves that hint, instead of being replaced by a navigation block that drops it.
A block list's text-align and a row flex list's justify-content were dropped when the list became a flex core/navigation, so items started at the container edge instead of the source position.
layout.justifyContent packs a wrapping column on the cross axis, so a right-aligned list still started at the container edge. Restate the source packing as a row on the generated list.
A global row rule also right-aligned other menus. Hang the packing declarations off the source list's own classes.
When desktop and mobile menus have the same ordered items, both core/navigation blocks reference one wp_navigation entity so a single rename updates every viewport.
Responsive document classes can live on layout-shell wrapper attributes, so identical variant menus still share one navigation entity.
Page content is parsed before render filters can replace a sentinel ref, so init writes the created wp_navigation id into stored blocks.
Contributor
Author
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
When a capture has desktop and mobile document variants, each viewport's menu is a separate inline
core/navigation. Renaming an item in the Site Editor updates only that block. The other viewport keeps the old label.Depends on #2245 (
fix/desktop-menu-navigation) and must merge after it. This branch is rebased onto that branch; the commits here are only the shared-entity change.Root cause
Variant menus are intentionally kept as separate
core/navigationblocks so each viewport can keep its own presentation. Nothing then bound those blocks to onewp_navigationpost. Identical ordered(label, destination)sets stayed inline, so an edit could not propagate.Responsive document classes often live on layout-shell wrapper attributes, not only
className, so a className-only scope check misses the pair. A sentinelrefalso cannot be left in stored page content: the navigation renderer reads attributes before a render filter can replace them, and an unresolvedrefdrops the inline items.Fix
After shell extraction, group
core/navigationblocks that sit in different responsive variant scopes and share an ordered(label, destination)set (fragments ignored, matching shell identity). Both blocks get the sameref. Divergent item sets stay inline and independent. Variant attributes (overlayMenu, classes) stay on each block.Theme bootstrap creates one
wp_navigationpost for that item set and, oninit, writes the real post ID into stored page/template content so render and the Site Editor both bind to it. A later rename is not overwritten.Regression test
php php-transformer/tests/unit/shared-variant-navigation.phpFails before (
git stashof the fix):Passes after:
Also passed:
php php-transformer/tests/contract/shared-shell-plan.php,php php-transformer/tests/contract/wordpress-site-plan.php,php php-transformer/tests/contract/header-link-cluster-navigation.php,php php-transformer/tests/unit/paragraph-label-desktop-menu.php.Verification
Fresh import with SSI
origin/main(9c83decd) paired to this implementation viastudio create --static-site-importer-path.core/navigationblocks sharing oneref. A third one-item menu on some routes stays unreferenced.Journalin thewp_navigationpost (the Navigation screen write):/,/blog,/shop, and/services-1HTML each containJournaltwice (both variant navs).>Blog<is gone.Journalvisible, first menu linky=45.x=580versus the fix(php-transformer): hoist viewport-partitioned chrome into shared parts #2243 baselinex=733(y=45); that offset is the parent fix(php-transformer): recognize paragraph-labelled menus inside custom-element hosts #2245 residual, not this change.Fixes #2246
AI disclosure: implemented by xAI Grok 4.7 via OpenCode (
opencode run), orchestrated and reviewed by Claude (Anthropic).