WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.51k stars 4.21k forks source link

Components: refining `ItemGroup` #34709

Open ciampo opened 3 years ago

ciampo commented 3 years ago

This is an overview issue to track all of the tasks necessary to refine the ItemGroup component in the context of integrating with the new design and primitives.

ItemGroup and Item

Integration with other components

mtias commented 3 years ago

What would be the purpose of the organizational unit for grouping ItemGroups? Trying to understand what it'd represent.

Should the tooltip be on each ColorSwatch component?

As a general rule, tooltips should be applied to actionable items. So if the entire Item is the action, the tooltip should be general: "Link color red; hover color blue" or something.

ciampo commented 3 years ago

What would be the purpose of the organizational unit for grouping ItemGroups? Trying to understand what it'd represent.

This is a screenshot from an early version of the Global Styles Sidebar prototype — here there are 2 different ItemGroups components, grouped under the "Palette" and "Elements" headers.

Screenshot 2021-09-14 at 13 20 47

In that older prototype version, those ItemGroups were groups using a component called ListGroup, which currently doesn't exist in Gutenberg. When trying to move that earlier prototype to Gutenberg (#32923), tyxla used instead the Panel component (for lack of a better alternative)

Screenshot 2021-09-14 at 13 25 15

These are the reasons behind the current state of the Grouping ItemGroups section in the description. Do you have any suggestions/insights on the best direction to take here?

As a general rule, tooltips should be applied to actionable items. So if the entire Item is the action, the tooltip should be general: "Link color red; hover color blue" or something.

That makes sense. In this case, then, we should definitely think about the best way for ItemGroup to support tooltips for each Item.

We should probably also add tooltip support for the future ColorSwatch component — although this tooltip won't be used when the ColorSwatch is used inside of an ItemGroup (we're going to use the Item's tooltip instead)

mtias commented 3 years ago

It seems to me ItemGroup with a title prop, a heading sibling, or a heading child should be sufficient? Not sure I see why it'd need an extra layer of componetry since the group is already defined.

ciampo commented 3 years ago

It seems to me ItemGroup with a title prop, a heading sibling, or a heading child should be sufficient? Not sure I see why it'd need an extra layer of componetry since the group is already defined.

This makes sense — we don't have to necessarily group ItemGroup components the same way they were grouped in the early prototype. I've updated this issue's description with what's been discussed and agreed upon in the last exchange.