-
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
Use custom name in block sidebar if available (retaining block type information) #65641
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. |
Size Change: +62 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
I'm just going to flag that I'm not sure if there might be accessibility concerns that we should consider here for non-sighted users who may lack the ability to perceive the nature of this block (i.e. a Group block) without the affordances offered by:
I wonder if @jeryj can offer any insight here? I'm wondering whether removing all context about the block from this panel is actually helping our users. It might look "cleaner" but potentially at the cost of adding confusion. |
I re-read #53735, and it looks like the block renaming feature was introduced to make blocks easier to distinguish/find in the List View. If only the custom block name was shown in the inspector control, it would feel less relevant in the Settings and Styles panels below. Another reason is that in Figma for example, the Layers panel shows the custom name, but the design panel shows the original component name: Therefore, I lean towards keeping it the way it is. |
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.
It's confusing to me to rename the sidebar settings with the renamed section. I would rather not put the custom name in the inspector controls. In the list view, the custom name is helpful because it helps you identify which item you want to select. You can't select anything via the inspector, so I think it should remain Group Block so it's an accurate representation of what you have selected. |
I think @jeryj has a point - and actually seeing the block description under block name is quite weird. |
Thinking back to when we introduced renaming, I'm sure we had a similar discussion. I cannot find it though as Github appears to have buried it. |
Seeing the custom name in the Inspector can provide helpful context when List view is closed. Technically the icon should communicate the block type but I appreciate that's not a great affordance currently in term of a11y, maybe a tooltip would help? Block descriptions are generic... if the block has a custom name it's generally no longer generic and the description can be confusing. I'd be tempted to hide it. |
@jameskoster @richtabor does this suggestion have any downsides? |
TBH @draganescu's suggestion seems like the best compromise. |
Just makes it seem more complicated than it needs to be. For example, the heading block would read: "Heading block. Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content." I don't think the description should change based on if you have a custom block name or not, and it would be duplicative to have a Heading label above the description, then lead with "Heading block.". |
Well, that is a trade off compared to not having the block type shown anywhere in the inspector and having to intuit from the block icon or from opening the list view what kind of block you have selected.
There is no duplication? This PR removes the block type from the title of the panel, to leave the title of the panel exclusively to the block name, manually set by the user. |
Between all options I think the last suggestion from @jameskoster is the best: a label that happens to also look like a label. |
7ed66b6
to
596b51e
Compare
@t-hamano @jameskoster @richtabor I've updated the PR to utilise the I don't know about the accessibility of this approach and whether it's necessary that we "decorate" the Badge with additional meta data to denote that it is the name of the block. |
Flaky tests detected in 596b51e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12351606254
|
What?
Removes the block's name (e.g.Group
) from the inspector controls if a custom name is defined.Use custom name (e.g. "My cool block") in block sidebar details panel if defined and include a "badge" to retain information about the original block type (e.g.
Group
).Why?
Suggested by @richtabor in #65398 (comment).
Discussion in this PR has evolved the concept somewhat.
How?
Change code.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast