-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Improve visual clarity of reusable block #28318
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
Conversation
|
Size Change: +203 B (0%) Total Size: 1.37 MB
ℹ️ View Unchanged
|
| const blockLabel = getBlockLabel( blockType, attributes ); | ||
| // If label is defined we prioritize it over possible possible | ||
| // block variation match title. | ||
| const blockDisplayName = |
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.
I don't recall why we were not using BlockTitle here instead of calculating again cc @youknowriad
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.
There was a lengthy PR with a long discussion about the label here. I think @talldan was involved in it maybe? Though I don't have a direct answer.
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.
Looks like BlockTitle didn't show the label when this was initially implemented, but was later updated to do so.
Using BlockTitle here is a nice improvement.
youknowriad
left a comment
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.
Looks good to me.
The only thing about this implementation is that it's not something we could adapt to template parts for instance. While the "reusable blocks" is a concept the block editor knows about, the "template part" is not, it's not a generic concept IMO.
As we continue to improve on template parts it might become more clear how much they should coincide with reusable blocks and it might be good to tweak things again. |
|
Let's merge this. @mtias, could you please rebase |
Only show the name next to the icon if it's a reusable block.
be3f707 to
dd59c81
Compare

See #27890.
Closes #28281.
Displays the actual reusable block name in the following places:
Examples