-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Navigation: add transformations from a link to other allowed nav blocks #34978
Conversation
da57ab2
to
0646703
Compare
Size Change: +183 B (0%) Total Size: 1.06 MB
ℹ️ View Unchanged
|
76310e1
to
ef44be2
Compare
My assumptions about transforms were incorrect yesterday. So this one is ready for 👀 We already do some basic filtering when block types are not registered, or if a child block type can't be inserted |
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.
Thanks for working on this! Code-wise it looks good and it's working well ✅
The one thing I'm not sure about is the transforms from Submenu block to other block types, because in doing that all the submenu children are lost. Users might not realise that happens at first, especially because something like "Home Link" feels like it could easily be a submenu parent too.
In the context of #34041, the requirement is only for Navigation Links to transform to other blocks because the other blocks won't be so easily accessible without the quick inserter, so we could just not add any transforms to Submenus for now. Or if we do want to add those transforms, they should pop up a warning that all the contents of the Submenu will be lost.
Thanks for taking a look @tellthemachines Good thought, I suppose that might be more of a concern in a mega menu. I added an |
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.
Great work! This feels like the right balance between being able to revert a Submenu back to Link, and not inadvertently losing all the children when transforming to something else 🚀
Thanks for the review @tellthemachines ! |
Small part of #34041
This adds to transforms for other navigation blocks (search, home link, social icons, site-logo and spacer.
CleanShot.2021-09-20.at.14.41.46.mp4
TODO
trunk
when attempting to transform to a submenu. Navigation Editor: avoid crash when transforming navigation link #34980 fixes thisTesting Instructions
npm run build
Question: How useful are the Navigation Link Variations?
Specific navigation link variations like a Post Link, Page Link, Category Link (CPT Link) etc feel like they clutter up the inserter and the transformation mechanism is separate from a normal block transform. Since we're interested in simplifying workflows I wonder if we could remove these from being so prominent. 🤔