Enable block "click through" overlay for Navigation block in contentOnly mode#72248
Enable block "click through" overlay for Navigation block in contentOnly mode#72248getdave wants to merge 1 commit into
Conversation
|
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. |
|
Size Change: +14 B (0%) Total Size: 3 MB
ℹ️ View Unchanged
|
jeryj
left a comment
There was a problem hiding this comment.
I'm not sure this is a good idea until we can have a drilldown/list view for the navigation block showing in the contentOnly sidebar when the navigation block is selected. At the moment, if I want to edit the text of a navigation item, I'd have to click it 3x:
- First click goes into the template
- Second click selects the navigation block to show the Add page
- Third click places the caret on the navigation item
So, as is, I think it's optimizing too heavily for an Add page flow. Once we have the drilldown or better representation for editing navigation items from the sidebar in contentOnly, I think this forced selection for the top level item could work.
|
I agree with your points @jeryj. We need to decide if optimising for the This would almost certainly be worth it if the Editable List View was available int he |
By simplified editing, does that means the contentOnly unsynced patterns experiment? It's not clear that this will land in WordPress 6.9, at the moment it looks like it probably won't as there are still lots of tasks remaining. The code for contentOnly unsynced patterns is behind an experiment toggle, so should these PRs also use the experiment toggle or are they good enough to ship in trunk as the default experience? |
7929340 to
888399e
Compare
| // selected. If the mode is 'contentOnly' then the overlay is redundant | ||
| // since there will be no controls to interact with once selected. | ||
| if ( getBlockEditingMode( state, clientId ) !== 'default' ) { | ||
| if ( editingMode !== 'default' && ! isNavigationInContentOnly ) { |
There was a problem hiding this comment.
It looks like the disabling of the block overlay was originally added to solve a specific problem with the post content block when 'Show template' is active - Prevent block overlay on blocks with a 'contentOnly' editing mode. It's so that users can click straight through to inner blocks of post content.
Part of me also wonders if it'd be a massive issue to disable the overlay on post content permanently (I think there's a "__experimentalDisableBlockOverlay": true block supports that allows for this), then it would be possible to remove this clause completely. Does Post Content need an overlay? I think when it's in 'Show Template' mode is the only time user can really access the inner blocks, so that would indicate it doesn't need it at all.
|
@talldan has a better aproach for this (I can't find the PR right now) so I'm closing this one out |
What?
Fixes #71757
This PR enables overlay click-through behavior for Navigation blocks in
contentOnlyediting mode. This is a short-term fix to ensure Navigation blocks are ready for the Simplified Editing experience in WordPress 6.9.Why?
Without the overlay active, clicks on Navigation Link children immediately select those child blocks, bypassing the parent Navigation block selection.
In trunk this stops users from seeing the
Add pageutility button we've added to the block toolbar.When the full drill down experience is implemented, it will prevent users from discovering and accessing the off-canvas editing experience, making Navigation editing more confusing in
contentOnlymode.We want to guide users towards selecting the Nav block in order that they can see the affordances we have put in place to help them add new links. This is hidden if the first click selects a sub block.
With this change:
This interaction pattern already works correctly in
defaultediting mode, and this PR extends it tocontentOnlymode specifically for Navigation blocks.How?
Modified the
__unstableHasActiveBlockOverlayActiveselector inpackages/block-editor/src/store/selectors.jsto add a targeted exception for Navigation blocks incontentOnlymode. The fix:contentOnlymodeThis is intentionally implemented as a minimal, block-specific conditional to unblock the immediate use case for WP 6.9. The code includes clear comments indicating this is a temporary solution.
Future Work
Post-6.9, we should refine and stabilize a proper block support API (e.g.,
__experimentalBlockOverlay: { contentOnly: true }) that allows any block to opt into overlay behavior per editing mode. This would make the feature extensible and remove the need for block-specific conditionals in core editor code.Testing Instructions
contentOnlymode)contentOnlymode maintain their current behavior (no overlay)defaultediting mode continue to work as beforeScreenshots / Screencast
Screen.Capture.on.2025-10-10.at.15-19-57.mp4