Pattern Editing: Fix sibling blocks to edited pattern not being disabled#75994
Pattern Editing: Fix sibling blocks to edited pattern not being disabled#75994
Conversation
…ion` sometimes being enabled
|
Size Change: +5 B (0%) Total Size: 6.84 MB
ℹ️ View Unchanged
|
ramonjd
left a comment
There was a problem hiding this comment.
Good spotting.
I checked:
- the test scenario in the PR description (unsynced + synced)
- synced + unsynced + synced, arrow up and down
- template part + unsynced
- nested unsynced patterns
Works well!
Before
Kapture.2026-02-27.at.16.34.41.mp4
After
Kapture.2026-02-27.at.16.36.56.mp4
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Flaky tests detected in 7b9066a. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/22474017830
|
…led (#75994) * Derived Block Editor Modes: Fix blocks outside `editedContentOnlySection` sometimes being enabled * Add tests * Minimize unrelated changes ---- Co-authored-by: talldan <talldanwp@git.wordpress.org> Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
|
I just cherry-picked this PR to the wp/7.0 branch to get it included in the next release: e770170 |
What?
I've noticed a bug I introduced in #75818. If a user inserts a synced pattern and an unsynced one as siblings, then proceeds to click 'Edit pattern' on the unsynced pattern, the Synced Pattern is still visible in List View and navigable to using the keyboard.
This is an inconsistency as all other blocks are usually hidden and disabled.
Why?
In #75818 I lowered the precedence of the block editing modes for
editedContentOnlySectionso that synced patterns can override it, but I've quickly realized this is the wrong move.How?
The right balance is instead to keep the code that disables blocks outside the
editedContentOnlySectionat a very high precedence (it overrides all other block editing modes).The code that sets the
defaultmode for blocks insideeditedContentOnlySectionshould still have the lowered precedence from #75818 to ensure synced patterns nested in an unsynced pattern have the right block editing modes.Testing Instructions
Expected: keyboard block navigation is constrained to the unsynced pattern, the synced pattern is not present in List View
In trunk: keyboard block navigation can escape the unsynced pattern, the synced pattern is present in List View
Screenshots or screencast
Before
Kapture.2026-02-27.at.13.17.07.mp4
After
Kapture.2026-02-27.at.13.20.00.mp4