Skip to content
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

Merged
merged 2 commits into from
Mar 21, 2018

Conversation

jasmussen
Copy link
Contributor

This fixes #5049. It removes the "Turn into" repetitive titles, in favor of a single header, like there is for the Block menu switcher.

turn into

This fixes #5049. It removes the "Turn into" repetitive titles, in favor of a single header, like there is for the Block menu switcher.
@jasmussen jasmussen added the General Interface Parts of the UI which don't fall neatly under other labels. label Mar 14, 2018
@jasmussen jasmussen self-assigned this Mar 14, 2018
@jasmussen jasmussen requested a review from a team March 14, 2018 10:43
@aduth
Copy link
Member

aduth commented Mar 14, 2018

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).

@mtias
Copy link
Member

mtias commented Mar 14, 2018

@jasmussen do you still want to explore having a fly-out menu for these so it doesn't pile at the bottom?

@jasmussen
Copy link
Contributor Author

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:' ) }
Copy link
Member

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?

Copy link
Contributor Author

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"
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

@gziolo gziolo left a 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.

@jasmussen jasmussen merged commit f9872fd into master Mar 21, 2018
@jasmussen jasmussen deleted the fix/turn-into-consistency branch March 21, 2018 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
General Interface Parts of the UI which don't fall neatly under other labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Turn into" repetition in block actions
4 participants