WordPress / block-directory

Block library: Timeline and plan: https://make.wordpress.org/design/2019/04/26/block-library-installing-blocks-from-within-gutenberg/
27 stars 4 forks source link

Proposal: Consider guidelines for how blocks are listed in the inserter #18

Open shaunandrews opened 5 years ago

shaunandrews commented 5 years ago

Right now, the way blocks are listed in the inserter is very open — its the Wild West. For example, if I install CoBlocks I get two new sections in the inserter's list of blocks:

image

If I also install the Jetpack, Atomic Blocks, and Ultimate Addons Blocks plugins, I get more groups — some with icons and some without. I've also noticed that some plugins will try to use color to "brand" their blocks:

image

Having a way to brand Blocks is likely going to be more important as we introduce the block directory. Having some guidelines and restrictions here would likely be of help to many developers — and lead to a more consistent UX.

--

Over in the Gutenberg area, there's been some discussion around regrouping the default set of blocks into a more user-friendly list. But I think as we integrate the block directory we'll (hopefully) see more blocks, and more people installing singular, individual blocks — as opposed to installing a collection of blocks, like Kioken or CoBlocks.

This presents an interesting problem. If you install a single block from CoBlocks, will you then get an entire section in the inserter with a single block listed?

This could lead to people having any number of sections in the block inserter with only a single block. Its not hard to imagine a scenario where you'd end up with 15 sections in the block inserter, most containing only a single block. This becomes unwieldy.

Now seems like a great time to reconsider the way blocks are listed within the inserter, and perhaps outline some guidelines to how developers are expected to place their blocks. It might also be worth standardizing the placement and color of icons, and forcing the placement of singular blocks within standard groupings.

karmatosed commented 5 years ago

I love the idea of some guidelines here. For me, this could solve some complicated experiences we are starting to see and will only get worse.

mapk commented 4 years ago

I believe blocks allow a "category" to be defined. For example, my P5.js single block plugin has category: 'formatting', defined in the block.js file.

Screen Shot 2019-09-23 at 1 19 58 PM

Single block plugins should be taking advantage of this to insert their block in a pre-existing category if appropriate. Of course making their own category could seem like bonus advertising, but I'm not sure how to stop that from happening.

shaunandrews commented 4 years ago

@mapk I’m suggesting we help avoid this by offering written guidelines and consider restricting the freedom developers have when it comes to creating groups and sorting blocks.

kwight commented 4 years ago

Of course making their own category could seem like bonus advertising, but I'm not sure how to stop that from happening.

What if we just... never allowed it? Is there any downside, from the community point of view?

mtias commented 4 years ago

Also related: https://github.com/WordPress/gutenberg/issues/16866