-
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
Make block more menu transformations consistent #5606
Conversation
This fixes #5049. It removes the "Turn into" repetitive titles, in favor of a single header, like there is for the Block menu switcher.
I thought there might have been a related issue, but I expect this could worsen scenarios where the menu opens off-screen and it's impossible to reach transform options (by virtue of the fact that this makes the menu longer). |
@jasmussen do you still want to explore having a fly-out menu for these so it doesn't pile at the bottom? |
A strong maybe on that one. I do think there are more "at the root" improvements we can make to transformations. Some are being discussed in #5585, and @iseulde also suggested we consider only having one way to transform, the block toolbar or the ellipsis. I could definitely see it becoming a scalabililty issue. |
<span | ||
className="editor-block-switcher__menu-title" | ||
> | ||
{ __( 'Transform into:' ) } |
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.
Should we preserve the translators 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.
I felt like it was unnecessary given the label was changed from sprintf( __( 'Turn into %s' ), title ) into __( 'Transform into:' ) — and also because I can't show the translator comment in context of the label because it's no longer a variable that gets inserted.
@@ -27,9 +27,12 @@ function BlockTransformations( { blocks, small = false, onTransform, onClick = n | |||
return ( | |||
<Fragment> | |||
<div className="editor-block-settings-menu__separator" /> | |||
<span | |||
className="editor-block-switcher__menu-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.
Are you using this class for something? We try not to inherit styles by reusing classes.
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 did use it to inherit, indeed. Pushed a change which simply duplicates the styles, but I'm not sure that's the best way to do it either.
It seems like the More Menu, and the Block More Menu (block ellipsis menu) and the Block Switcher should all use a generic Menu component. But I'm not sure I have the skills necessary to make that happen, or whether it should happen in this PR. If yes then feel free to push to this branch.
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 thought there might have been a related issue, but I expect this could worsen scenarios where the menu opens off-screen and it's impossible to reach transform options (by virtue of the fact that this makes the menu longer).
It is already long :) I think the biggest issue is that we have it in two places. However, I like this change because it makes them look similar.
I'm fine with merging it as it is. In the long run, we should explore having a fly-out menu or remove it completely from the block's drop-down menu to avoid the issue where half of the drop-down goes off-screen.
This fixes #5049. It removes the "Turn into" repetitive titles, in favor of a single header, like there is for the Block menu switcher.