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

Group: Add setup state to allow picking a variant (default/row/stack) #43433

Closed
jasmussen opened this issue Aug 19, 2022 · 4 comments · Fixed by #43496
Closed

Group: Add setup state to allow picking a variant (default/row/stack) #43433

jasmussen opened this issue Aug 19, 2022 · 4 comments · Fixed by #43496
Assignees
Labels
[Block] Group Affects the Group Block Needs Dev Ready for, and needs developer efforts Needs Figma Update Needs an update to Figma for design purposes [Type] Enhancement A suggestion for improvement.

Comments

@jasmussen
Copy link
Contributor

jasmussen commented Aug 19, 2022

The Row and Stack blocks are variants of the group block. The group is for standard flow based content, Row flexes horizontally, Stack flexes vertically. You can transform between the variants in the inspector, and transform into one of these variations when selecting multiple blocks:

block toolbar

In most flows, you will arguably encounter the trio of container blocks having entered your content from from a pattern, or by selecting a few blocks and clicking the group toolbar button. In that light, when you explicitly choose to insert an empty group block from the inserter, it can be considered an intent to "build layouts". We can build on that intent and offer them in a basic Group block setup state:

Group setup state

Picking one would lead to the setup state we have today:

Row

There's also an opportunity here to offer additional layout wireframes as shortcuts, such as a column-layout based on Stack blocks inside a Row. But this is someting to explore separately, and for the initial version, Group, Row and Stack variations would be sufficient.

SVG graphics for the shortcuts

No need to add the following illustrations to the icon library, these can exist just for the Group, for example in a variations.js file.

Stack:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 32" style="enable-background:new 0 0 44 32" xml:space="preserve"><path d="M42 0H2C.9 0 0 .9 0 2v12.5c0 .6.4 1 1 1h42c.6 0 1-.4 1-1V2c0-1.1-.9-2-2-2zm1 16.5H1c-.6 0-1 .4-1 1V30c0 1.1.9 2 2 2h40c1.1 0 2-.9 2-2V17.5c0-.6-.4-1-1-1z" style="fill:#ccc"/></svg>

Row:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 32" style="enable-background:new 0 0 44 32" xml:space="preserve"><path d="M42 0H23.5c-.6 0-1 .4-1 1v30c0 .6.4 1 1 1H42c1.1 0 2-.9 2-2V2c0-1.1-.9-2-2-2zM20.5 0H2C.9 0 0 .9 0 2v28c0 1.1.9 2 2 2h18.5c.6 0 1-.4 1-1V1c0-.6-.4-1-1-1z" style="fill:#ccc"/></svg>

Group:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 32" style="enable-background:new 0 0 44 32" xml:space="preserve"><path d="M42 0H2C.9 0 0 .9 0 2v28c0 1.1.9 2 2 2h40c1.1 0 2-.9 2-2V2c0-1.1-.9-2-2-2z" style="fill:#ccc"/></svg>

Figma.


Issue updated Sep. 28.

Initial proposal The Row and Stack blocks are variants of the group block. The group is for standard flow based content, row flexes horizontally, stack flexes vertically. These three blocks come with setup states to subtly indicate their direction:

group row and stack

You can transform between the variants in the inspector:
transform

And you can transform into one of these variations when selecting multiple blocks:

block toolbar

Despite these affordances, it may still not be entirely clear what to do with an empty group, stack, or row. It might make sense to have a first step of that setup state be a basic picker allowing you to choose the layout in a more visual way:

Group setup state

Picking one would lead to the setup state we have today:

Row

Such an initual setup state we should also follow up on with more concrete layouts in the future, like different width of columns once we support that.

@jasmussen jasmussen added [Type] Enhancement A suggestion for improvement. [Block] Group Affects the Group Block labels Aug 19, 2022
@mtias mtias added the Needs Dev Ready for, and needs developer efforts label Sep 11, 2022
@ntsekouras
Copy link
Contributor

The plan here is to show this setup on all variations(group. stack, row) or just expose the Group in the inserter? Also if a user has clicked in one option from the placeholder and doesn't add anything at that moment, what would be the expected output on refresh? Should we show again the setup state?

@jasmussen
Copy link
Contributor Author

This setup should mainly (only probably) show on the Group variation, and only when it's empty. It's a good layout starting point.

Also if a user has clicked in one option from the placeholder and doesn't add anything at that moment, what would be the expected output on refresh? Should we show again the setup state?

If you just click "Group" in the flow illustrated, you should get the group as it exists today, i.e. with the inserter. If you then don't add any blocks inside and deselect, we can revert back to the setup state as shown. Does that make sense?

In most flows, I would expect the group (and row/stack variations) to mainly enter your content from from a pattern, or by selecting a few blocks and clicking the group toolbar button. In that light, when you explicitly choose to insert an empty group block, it can be considere an intent to "build layouts". In that light, I could see us adding additional shortcut buttons to this state, to let you create layout primiteves such as flex based columns and otherwise. These would almost be wireframe pattern shortcuts. But this would be something to explore in the future: just sharing as context for why the empty group is special in this regard.

@javierarce javierarce added the Needs Figma Update Needs an update to Figma for design purposes label Sep 28, 2022
@jasmussen
Copy link
Contributor Author

See also #43496 which is some initial work to address this issue.

@ramonjd
Copy link
Member

ramonjd commented Nov 16, 2022

Resolved by #43496

@ramonjd ramonjd closed this as completed Nov 16, 2022
Repository owner moved this from 💻 Needs development to ✅ Done in Gutenberg Phase 2: Customization Nov 16, 2022
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 Dev Ready for, and needs developer efforts Needs Figma Update Needs an update to Figma for design purposes [Type] Enhancement A suggestion for improvement.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants