-
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
Make sure the directly inserted block in the Nav block is a Page link #48740
Conversation
Size Change: +9 B (0%) Total Size: 1.34 MB
ℹ️ View Unchanged
|
Flaky tests detected in 88b63db. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4325753236
|
What's the rationale there? It kind of tripped me up. To clarify for anyone else looking, if the menu only contains links, then clicking the [+] exposes the following popover which is optimised for adding Page Links: But if there are other blocks in the menu (e.g. Search) then clicking the [+] exposes this: |
If your navigation only contains links then we assume its most likely that you only want to add more links, but if your navigation contains other blocks then we don't want to assume that you want to add more links. |
Yep, this is a good one, thank you. As far as I can tell, all it does is default to Page Links instead of Custom Links. This is good.
This is a separate issue. The idea is that in 80% of the cases, you are building menus with menu items, so the plus should default to inserting menu items. Just like how the plus in a Buttons block just inserts buttons. How do you break out of that? You have those other shortcuts of common blocks at the bottom. And as soon as you have blocks other than just menu items, you get the regular inserter. I think the principle is largely still right, but the inserter as it appears is clunky, and made worse by the recent ok/cancel buttons. We also show "recently updated", when ideally we could show all your pages: We've had designs for this in various iterations for a while now, this is an older design, lives here if you want to tinker. |
...in which case I'm sure @jameskoster and I would love some input on that in #47310 🙏 If it's not working let's try and improve it 🚀 |
@Mamaduka @ntsekouras I believe this one will also need a backport to ensure that we get the right type of block inserted by Nav block. @jasmussen can confirm if this is critical. |
This is an important one. |
@getdave Does this issue help to resolve? |
I'm not sure this was the right move. Sure you can now insert a link to a page (which was already easy), but how do you now insert a link to a post? It's extremely difficult. |
I just cherry-picked this PR to the wp/6.2 branch to get it included in the next release: 1049c85 |
cc'ing @WordPress/gutenberg-design who requested this change. Are you happy with the new experience or do you want to revert? |
With the merger of Page Link and Custom Link being side by side in the inserter, it should still be easy. But in the 80% of cases, you are building menus for navigating your website, so when the choice is between making it easy to insert pages or insert posts, I would always lean towards pages. |
I think it was already easy to insert pages: |
It's really confusing to see posts when building a site's navigation. If we were to retain the use of custom link we'd need to make sure posts don't show up in the recently updated, pushing pages further down, which doesn't seem worth it. I had the impression the page item let you create a new page directly if one didn't exist, but it doesn't seem to be working for me. That's another reason for custom link to be avoided, as it's trying to do too much, suggesting you insert your term as a url as well. All of this would be confusing for someone starting their menu. |
Seems like I might have been wrong about the URL Popover prioritizing pages. I guess my pages were all alphabetically higher in the list than posts when I tested. 😄 I still think it's way too difficult now to insert anything else other than a page, 'Custom Link' could at least be in the 'Transform' section over some of the choices that are present currently. It's really not uncommon for sites to have links in the nav that are external or have extra parameters. |
What?
Makes the directly inserted block in the Nav block a Page variation instead of a Custom Link.
Why?
Because most of the time people just want to insert a link to a Page. Let's default to that.
How?
Update the
attributes
of the default block (which is the directly inserted one) to include atype
attribute set topage
. This will cause the variation to be active.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Screen.Capture.on.2023-03-03.at.17-21-33.mp4