WordPress / gutenberg

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

Block setup states: Include both inspector and toolbar options for setting and resetting #66563

Open jasmussen opened 3 days ago

jasmussen commented 3 days ago

Consider the Site Logo block in its setup state:

Image

This selected Site Logo block shows:

When a media file is added, both of those are updated:

Image

In this case, the selected Site Logo block shows:

Beyond the basic usability, this also has benefits as far as scaling down to tiny sizes in complex patterns. See #64288.

The pattern from Site Logo would be good to make consistent across all similar blocks. In most cases, this would mean adding a panel to the inspector, "Media".

Image

Image

Missing "Media" section.

Media & Text

Image

Missing "Media" section, and block toolbar option.

Cover

Image

Missing "Media" section initially, it's there when an image has already been set. Also, it should be "Add media", not "Add Media".

Query Loop

Image

Directly related to enhancements outlined in #64288, it's missing the toolbar option, as well as a section in the inspector. Since this is about swapping out patterns, rather than adding media, the pattern could potentially be the collapsed "Design" section, that's similar for when you choose page-level patterns in the document status inspector.

jasmussen commented 23 hours ago

Curious your thoughts, @annezazu!

annezazu commented 18 hours ago

Absolutely love this and think this would help immensely for consistency, especially when we think about "write" mode. For example, I think having a 'design' section for the query loop would be a great thing to display in a contentOnly representation https://github.com/WordPress/gutenberg/issues/66614.