WordPress / gutenberg

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

Adapt group block placeholder controls to render when selected #56086

Open richtabor opened 10 months ago

richtabor commented 10 months ago

There's an inconsistency between empty states of columns and group blocks. Related: https://github.com/WordPress/gutenberg/pull/53761

Group

The resting state of a group block renders an inserter and a placeholder (when used as a row or stack), which does always renders, regardless of selection.

In the visual below, the group block is not selected, but the placeholder is still rendered.

CleanShot 2023-11-13 at 11 03 57

Column

The resting state of an empty columns block does not render visually in the editor, much like the resting state of a spacer block. This results in a more 1:1 experience with what your site looks like on the front-end.

In the visual below, the columns block is not selected, and no placeholder is rendered (expected).

CleanShot 2023-11-13 at 11 04 57

Proposal

I propose that the group block matches the current spec of the columns block, where the inserter is rendered when selected, but not otherwise. When selected, the controls are all available as they are today.

This is consistent with how spacer blocks are rendered, and will promote a better one to one experience when viewing a site within the editor.

richtabor commented 10 months ago

This would help clean up experiences like this:

CleanShot 2023-11-13 at 11 09 28

Mamaduka commented 10 months ago

The Columns' behavior change was reported as regression #55982.

richtabor commented 10 months ago

The Columns' behavior change was reported as regression https://github.com/WordPress/gutenberg/issues/55982.

It was actually an intentional change. I suggested a middle-ground to improve, but still think these should not be visible placeholders when you're not interacting with them.

Mamaduka commented 10 months ago

Thanks for replying there.

While I understand the intention here, it would make selecting blocks a bit harder on canvas without List View open.

richtabor commented 10 months ago

While I understand the intention here, it would make selecting blocks a bit harder on canvas without List View open.

I don't think the issue is with block selection though. If there's an empty area, you can click on it to manipulate it (like any other visible block).