-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alternative Nav Offcanvas show link UI for submenu creation #46857
Alternative Nav Offcanvas show link UI for submenu creation #46857
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
packages/block-editor/src/components/off-canvas-editor/block.js
Outdated
Show resolved
Hide resolved
Size Change: -3 B (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works as advertised and is an improvement to the UX. IMO adding the REPLACE_*
actions to getLastInsertedBlockClientId
makes sense.
I can handle that 👍 Update: here is a PR for that #46898 |
This one will be rebased once #46885 lands. We can then utilise the new selector and look to land this feature. |
2603131
to
8df4b1c
Compare
The code has changed a fair bit and it's worth re-testing now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works great. The code is clean and makes sense.
What?
Alternative approach to #46582.
Shows the Link UI in the Nav Offcanvas when creating a submenu.
Why?
Currently it's not possible to get the full link creation experience when creating submenus in the offcanvas.
How?
Builds on research and foundations of #46582 and the work in #46744 to simplify the task of showing the Link UI when creating submenus.
Currently on
trunk
the feature already works with one exception which I have previously detailed which concerns creating submenus from nav items which are not currently submenus.Instead of using a single
replaceBlocks
call and providing the new custom link as inner blocks in that single call we now split this process into two stagesWith the changes to the reducer which tracks the last "inserted" block clientId the
getLastInsertedBlockClientId
returns correctly for the problem scenario previously described.As a result you now see the Link UI regardless of whether you created a submenu from an existing submenu or from a standard custom link
Testing Instructions
Add submenu item
.Add submenu item
.Testing Instructions for Keyboard
Screenshots or screencast
Screen.Capture.on.2023-01-05.at.13-47-42.mp4