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

Add block group variations to the block toolbar #49524

Open
richtabor opened this issue Apr 1, 2023 · 9 comments
Open

Add block group variations to the block toolbar #49524

richtabor opened this issue Apr 1, 2023 · 9 comments
Labels
[Block] Group Affects the Group Block Needs Design Feedback Needs general design feedback. [Type] Enhancement A suggestion for improvement.

Comments

@richtabor
Copy link
Member

richtabor commented Apr 1, 2023

What problem does this address?

There's not a quick way to set blocks as a row, stack, (eventually the grid variation perhaps) when using the "Group" control from a block toolbar's options menu. Currently you have to invoke the Block Inspector to locate the variation icon shortcuts.

We already have the group variation icons that render with multi-select. I think it'd be nice if those variation icons were also available within the Group block's toolbar — instead of requiring the use of the Block Inspector. The Group block's toolbar only has block alignment, so there's plenty of room.

What is your proposed solution?

Add the block's variation icons to the block toolbar, allowing for quicker access to the Row/Stack/Grid icons. It is a bit odd having both the block icon and the "Group" variation, but we could probably use a "reset" type functionality.

One idea is having "Group" selected initially; I'm not 100% sure about this:

CleanShot 2023-03-31 at 20 59 17

Another is to only show the "Group" control if one of the variations is selected. Don't love how clicking the "Group" icon then removes it:

CleanShot.2023-03-31.at.20.55.02.mp4

References:

  1. Grouping blocks via the options menu:

CleanShot 2023-03-31 at 20 38 09

  1. You are then required to use the Block Inspector variation icons, to set a row, stack, or grid variation:

CleanShot 2023-03-31 at 20 38 45

  1. The existing multi-select BlockGroupToolbar controls. I'm proposing we have these row, stack, and now grid, variation controls on the core/group block:

CleanShot 2023-03-31 at 20 11 05

@richtabor richtabor added [Type] Enhancement A suggestion for improvement. [Block] Group Affects the Group Block labels Apr 1, 2023
@richtabor
Copy link
Member Author

Thoughts? Have other ideas on how to better surface the block variation controls @WordPress/gutenberg-design?

@richtabor
Copy link
Member Author

Here's another idea, though I'm not sure about it (same duplicate group icon issue):

CleanShot.2023-03-31.at.21.07.14.mp4

@richtabor richtabor added the Needs Design Feedback Needs general design feedback. label Apr 1, 2023
@paaljoachim
Copy link
Contributor

paaljoachim commented Apr 1, 2023

Actually I think the last one with the drop down works best. It becomes somewhat similar to the Align icon next to it.
The only thing missing to the align icon is to have a small arrow in the bottom right. Giving the user a hint that there are additional options which one can find by clicking the align or Group variations if it ends up using the same method as align.

Example from Affinity Photo. (Photoshop has similar icons to give a hint that there are additional options available.)
Screenshot 2023-04-01 at 09 15 06

@jameskoster
Copy link
Contributor

I agree the last one is the best of the bunch, but I also wonder whether these should be part of the transform menu?

Screenshot 2023-04-03 at 13 21 41

@richtabor
Copy link
Member Author

I they're handy enough to be top-level toolbar controls.

We really wouldn't need the Group block's placeholder state as-is even, re (#49525). You would have the toolbar controls in a familiar place, with the existing/familiar iconography.

@jameskoster
Copy link
Contributor

I they're handy enough to be top-level toolbar controls.

I agree, but the transform menu is already a top-level toolbar control? I'm just a little anxious about duplicating an action that already exists in very close proximity. It's not a strong opinion though, the Group toolbar is relatively sparse so the additional control(s) wouldn't add much noise.

We should probably update the transform options as well :)

We really wouldn't need the Group block's placeholder state as-is even

It would be nice to get rid of that 'select a layout' step 👍

@jasmussen
Copy link
Contributor

Good thoughts all around.

High level we're spanning a bit broadly for the group, with transforms in the inspector, in the ellipsis menu, and in the transforms dialog. There's even an "Unwrap" item now. I think we can consolidate that quite a bit, and have as little as group and ungroup in the ellipsis menu, removing the unwrap (ungroup could unwrap a column if need be).

I tend to also lean towards the transforms menu being the interface to leverage for this, rather than the block toolbar itself. But that's more of a holistic thought about all transforms, rather than a particular note on this design itself. E.g. if #46195 becomes a thing more broadly, it's generally good to think of generic interfaces rather than group-specific features.

Finally, the transforms dropdown has been in need of love for a long time. I like to think of it as potentially being the "block control center", so I'd love to see us elevating what's there in that dropdown, and how visual it is. I think it can be an important transformation and previewing interface, holding not just block transforms, but pattern transforms as well. It would need a design pass.

That said, I'm also not strongly opposed to adding these transforms to the toolbar, there's certainly room. I'm just mainly waffling over whether the additional and group-only options are actually helpful or not.

We really wouldn't need the Group block's placeholder state as-is even, re (#49525). You would have the toolbar controls in a familiar place, with the existing/familiar iconography.

I actually think it's useful to keep the group block's placeholder state. You'll very rarely see it, due to how grouping can become a thing that happens to other content, or something you get through patterns. But when you do insert a group fresh on its own, it can be a useful layouting starting point. As I see it, it doesn't have to be about the group only, it could be a shortcut to multiple layouts, even complex multi-block wireframe patterns.

@richtabor
Copy link
Member Author

Ran into this a good bit while building more patterns. It does seem a bit inconsistent that we'd have the transform controls available during multi-select, but not an empty group state. Maybe the existing transform dropdown would be fine, but idk.

CleanShot 2023-04-19 at 17 48 40

@hanneslsm
Copy link

I also don't feel like the toolbar is the correct place.
Via the toolbar, we can already

I like that the toolbar is primary for alignments, text styles (bold, italic…), and quick actions (like "Replace" for images)

Also, when building patterns I have the block inspector always open and find transforming groups there quite fast and intuitive:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Group Affects the Group Block Needs Design Feedback Needs general design feedback. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

5 participants