gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Improve consistency of alignment tool placement

Open jameskoster opened this issue 3 years ago • 8 comments

What problem does this address?

Some alignment tools, e.g. Justification, are present in both the block toolbar and the Inspector.

Others, e.g. Vertical Alignment, Alignment (normal width, wide width, full width), Text Alignment are only available in the block toolbar. This inconsistency can be confusing and make the overall experience feel less predictable and robust.

What is your proposed solution?

In the Inspector these controls would occupy a relatively small footprint, and the Design Tools menu can hide them when not in use. So generally it might be most convenient for these controls to be available in both places. That is to say, if an alignment tool is present in the toolbar it should be present in the Inspector too.

Adding text alignment to the Typography panel would seem fairly trivial:

Group 1

This would be a non-default typography tool, and be present only if explicitly added, or an alignment was made in the post. But its presence here is also sensible in terms of setting default text alignments in global styles, where we might want to include, for example, justified text as an option. That is a separate exploration.

For block/flex alignments, long term I would be more inclined to combine these into a single control, similar to Figma:

But that's one for a separate issue (https://github.com/WordPress/gutenberg/issues/49448).

A nearer term optimization would be to duplicate over the vertical and horizontal justification dropdowns from the block toolbar:

Container

Issue updated Apr 13.

jameskoster avatar Mar 22 '23 14:03 jameskoster

Adding text alignment to the Typography panel would seem fairly trivial:

Screenshot 2023-03-29 at 18 52 49

As would adding alignment to the Layout panel:

Screenshot 2023-03-29 at 18 54 18

It's a shame they don't fit neatly into two columns, but there's not much we can do to fix that without compromising the individual button size, or increasing the width of the entire Inspector.

Long term I would be more inclined to combine these into a single control, similar to Figma:

But that's one for a separate issue (https://github.com/WordPress/gutenberg/issues/49448).

jameskoster avatar Mar 29 '23 17:03 jameskoster

Text alignment in Typography somehow feels wrong to me, but I suppose it would make sense there especially in Global Styles, where it needs to be able to encompass justified text.

As far as the longer term, I would agree that the Figma model works relatively well, perhaps with the exception of the space-between property, which hidden in the "spacing mode" advanced options becomes a bit buried. But given that it's a harder to underestand property, it might be appropriate after all.

But I wonder if there isn't a simpler and more compact way to port over the alignments from the block toolbar in the mean time. We have some older mockups. Dropdowns from the block toolbar:

Container group

And the inspector would then have the same icons, also showing the same dropdowns:

Container

Because that mockup is old, we'd need to sync it up with the work @SaxonF is doing on the Layout panel, but as is, would this be feasible?

jasmussen avatar Apr 12 '23 12:04 jasmussen

That could work if the Figma-esque combined control is too much effort.

Side note: It would be good to install a consistent design for indicating which item is selected in these menus. Should we adopt the check icons more broadly?

jameskoster avatar Apr 13 '23 09:04 jameskoster

Side note: It would be good to install a consistent design for indicating which item is selected in these menus. Should we adopt the check icons more broadly?

Yes, good call.

Container

Should I update the ticket with these?

jasmussen avatar Apr 13 '23 09:04 jasmussen

Please go ahead :)

jameskoster avatar Apr 13 '23 10:04 jameskoster

Updated and added "Needs Dev".

jasmussen avatar Apr 13 '23 10:04 jasmussen

Possibly related to the alignment piece of this issue: "Global Styles: Add alignment support in global typography styles" — #48202.

Currently, text alignment doesn't seem to be included anywhere in the Global Styles panel, making moving the alignment controls to the Inspector less trivial.

vcanales avatar Jun 23 '23 02:06 vcanales

Also relates to some 3rd party usability testing findings in #55993 (many users perceive the block toolbar as a shortcuts menu, not somewhere a setting might only appear).

culturerich avatar Jul 24 '24 09:07 culturerich