Repository navigation
Conversation
Owner
Author
|
Closing; this draft belongs in WordPress/gutenberg instead. |
|
Size Change: +64 B (0%) Total Size: 8.6 MB 📦 View Changed
|
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.
What
This is a draft follow-up to WordPress#79000 that explores the render-time/effective-value approach suggested in review.
Instead of repairing the stale horizontal Navigation
submenuVisibility: "always"state withsetAttributes, this branch treats that impossible combination as the horizontal default while rendering/editor UI runs:submenuVisibility:hovershowSubmenuIcon:trueThe stored block attributes are left untouched unless the user makes an explicit attribute change.
Why
PR WordPress#79000 prevents passive rendering from dirtying related entities, but selecting the stale Navigation block can still dirty the template part because the repair effect still writes attributes. This draft removes that effect and applies the effective values to editor rendering/context instead.
The PHP render path also coerces the same impossible combination before rendering, so pre-existing stored invalid attributes do not render differently between editor and frontend.
Notes / risks to review
submenuVisibility: "always"are interpreted at render time.Testing
php -l packages/block-library/src/navigation/index.phpnode --check test/e2e/specs/editor/blocks/navigation-passive-rendering.spec.jsgit diff --checkwp-scripts format --check packages/block-library/src/navigation/edit/index.js test/e2e/specs/editor/blocks/navigation-passive-rendering.spec.jsLocal wp-env/E2E is still blocked in this workspace because Docker/OrbStack is not running.