Fix navigation block inserter behavior: prioritize submenus and disable direct insert. #68263
+13
−5
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.
Closes #68184
What?
This PR fixes the behavior of the navigation block inserter by disabling direct block insertion and adding 'core/navigation-submenu' to the prioritized block list. It ensures that all navigation block variations, including submenus, are easily accessible and consistent across both the canvas and list views.
Why?
The current behavior of the navigation block inserter causes an inconsistent user experience by directly inserting blocks without showing the block inserter UI. This makes it difficult to insert navigation blocks, especially submenus. By disabling direct insertion and ensuring proper prioritization of blocks, we aim to provide a more predictable and consistent block insertion process across all contexts.
How?
directInsert
property fromtrue
tofalse
in bothinner-blocks.js
andunsaved-inner-blocks.js
to prevent direct block insertion.PRIORITIZED_INSERTER_BLOCKS
constant to include'core/navigation-submenu'
, ensuring submenus are prioritized and accessible in the block inserter.renderAppender
logic to ensure that the block inserter UI appears consistently and provides clear navigation options.Testing Instructions
Screenshots or screencast
Screen.Recording.2024-12-24.at.1.08.44.PM.mov