-
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
Try show navigation menu name in the block inspector, toolbar, list view and breadcrumbs #46457
Conversation
Size Change: +118 B (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
@@ -47,6 +55,27 @@ export const settings = { | |||
}, | |||
], | |||
}, | |||
__experimentalLabel: ( { ref } ) => { | |||
// Attempt to find entity title if block is a template part. |
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.
Nit: I think this should say navigation, not template part?
The PR works well for me. If I update a name, it is correctly displayed after saving. I think we need to discuss if the inspector should show both the customized name and the normal block title. |
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.
After save, this works well.
The one thing that was unexpected was changing the name under the advanced menu and it not updating everything until I hit save. I would expect everything to change visually before save, and only be persisted after hitting save. This is the pattern for everything else in the editor.
One quirk with the current way it works -- when I update the name the dropdown in the menu panel changes but not the selected state:
@draganescu I think this is related to the discussion around showing the menu name in the list view. |
What?
Related #43261
Fixes #42154
Shows the navigation menu name in the block inspector, list view and breadcrumbs.
Why?
If we explore the navigation block being considered a 'synced' block
How?
__experimentalLabel
for the navigation block, in much the same way as the template part block implements this.useBlockDisplayTitle
hook for showing the title in the inspector. Does this for template part, reusable and navigation blocks.A lot of this code could be improved. For example
useBlockDisplayInformation
should really return the data thatuseBlockDisplayTitle
does. Hard coded checks for block types also shouldn't be necessary in the long run.For accessibility, I think it'd be good if some of these places did still include the normal block title as part of the aria label or description. Sighted users can often infer this from the block logo and other visual clues, but that's not always possible when using a screen reader.
It's an existing bug, so a fix could be attempted in a separate PR.
Testing Instructions
Prerequisite: Ensure your navigation block menu isn't called 'Navigation'.
Testing Instructions for Keyboard
Screenshots or screencast
Toolbar and Inspector
List View
Breadcrumbs