-
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: Surface the associated Menu name in the List View tab #68441
base: trunk
Are you sure you want to change the base?
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. |
Thanks for the PR ✨. I've fixed the second point here. |
Hi @getdave , |
👋 Unfortunately my availability to contribute to Core is limited so I likely won't get around to this. Looks like @fabiankaegy pinged some folks though so hopefully they can help. |
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 the PR! Three pieces of feedback from me:
- Navigation name can get long, so we need to consider how it should be displayed.
- We should not hard-code concatenations of localized text - they should all be translatable, like this:
{ sprintf( /* translators: %s: Navigation menu name. */ __( 'Menu (%s)' ), navigationMenu?.title || __( 'Untitled menu' ) ) }
- Let's consider whether we really need to add the menu name here. In this comment, it is suggested to add the menu name to the block card.
Fixes Point 1 of #68177
What?
This PR surfaces the name of the currently selected menu next to the word "Menu" in the Navigation block's List View tab, making it easier for users to identify which menu is associated with the block directly within the editor interface.
Why?
Currently, to identify which menu is linked to a Navigation block, users must navigate through multiple steps:
This multi-step process can be cumbersome, especially for less experienced users. This change simplifies this by immediately displaying the menu name alongside the "Menu" label, improving discoverability and usability.
How?
This change uses the
useNavigationMenu
hook to display the current menu name next to the "Menu" label in the Navigation block's List View tab. The aim is to provide immediate feedback without overloading the UI.Testing Instructions
Screencast
Screen.Recording.2025-01-01.at.1.21.31.PM.mov