-
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 block name in inspector controls when available #65398
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: +44 B (0%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
This comment was marked as resolved.
This comment was marked as resolved.
@t-hamano localising the block title (Group, Paragraph, etc) makes sense, but since the name is user-generated why would it need to be localised? |
The localization here is intended to localize the parentheses, not the block name. Because we're not sure if parentheses are appropriate in all languages. |
Derp, of course. Ignore me :D |
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.
Tests well - I tried some interesting things like using a really long name and the text wraps as expected.
Code is as expected. I think it's good to ship if the design aspect is all squared away.
@jameskoster Took a look and didn't object so I'm going to merge this. Thanks for review folks 🙇 |
@richtabor PR to resolve this https://github.com/WordPress/gutenberg/pull/65641/files |
What?
Uses the custom name for a block in the block inspector controls when set.
Why?
The list view shows the custom name of the block but this isn't reflected in the inspector controls. It's helpful to have this affordance made consistent.
How?
Shows any
attributes.metadata.name
in the inspector controlsBlockCard
when available.I did consider amending the lower level
useBlockDisplayInformation
to make this part oftitle
if available, butname
is already exposed on that hook so it seems better to just use that directly as required.Testing Instructions
Rename
and provide a custom name{Custom name} (Group)
.Testing Instructions for Keyboard
Screenshots or screencast