WordPress / gutenberg

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

Improve state of Tag Cloud block with no tags #63684

Open richtabor opened 1 month ago

richtabor commented 1 month ago

In the spirit of making placeholders more 1:1 to front-end expectations, the Tags Cloud should not have a "There's no content to show here yet" message, especially on the front-end of the site.

Yes, its a bit of an edge case, as it requires you to not have published with any tags—but when setting up a blog for the first time, it can be disorienting to have what should be a representation of the actual block within the editor, and nothing on the front-end (as there are no tags).

Current

As seen here in the editor, but also on the front-end:

CleanShot 2024-07-17 at 16 39 24

Proposed

Include sample tags within the editor, if there are no tags available; they would be styled however the theme depicts them. Perhaps something simple like "Tag-1" and "Tag-2".

CleanShot 2024-07-17 at 16 41 15

afercia commented 1 month ago

It's an interesting edge case. I'm not sure the editor and front end should represent with placeholders a state that is actually an _empty_state. Yes, the editor should provide a preview of what the content will be on the front end. But, when the content is actually empty it should let users preview it's empty.

At this point, shall an empty paragraph have some placeholder text? Not sure that would be ideal. It makes sense to show that it is empty. I'd argue the same should happen for all blocks.

On top of that, a visual preview that shows a few non-existing tags like in the screenshot below:

CleanShot 2024-07-17 at 16 41 15

would not communicate the block is 'empty' in an accessible way. From an usability perspective, users could be confused and attempt to click the tags.

Rather, I'd consider to improve consistency of block when they are 'empty'. For example:

This behavior is inconsistent and, in my personal opinion, the front end shouldn't show anything.

That text should likely be used only as a placeholder in the editor. The wording could be improved a bit, e.g.: There are no terms to show in the Tag cloud yet.

Lastly, a quick reminder that the Tag cloud can be used for any taxonomy, also for custom taxonomies so that isn't just about 'tags'. In the screenshot below, the UI with a plugin that adds Books and Movies categories and genres:

Screenshot 2024-07-18 at 12 12 21

richtabor commented 1 month ago

I'm not sure the editor and front end should represent with placeholders a state that is actually an _empty_state.

For clarification, the front-end should display nothing—similar to how an empty button would not render on the front end.

richtabor commented 1 month ago

a visual preview that shows a few non-existing tags like in the screenshot below

It's not unlike an empty button, or the post content empty state in a template, etc.

I think the label of "no tags" is more confusing than showing what tags would look like if there were any. Now you're confused about what you need to do next.

Lastly, a quick reminder that the Tag cloud can be used for any taxonomy, also for custom taxonomies so that isn't just about 'tags'. In the screenshot below, the UI with a plugin that adds Books and Movies categories and genres:

They all look the same, and it is a tag cloud.

CleanShot 2024-07-18 at 09 21 05

akasunil commented 1 month ago

That text should likely be used only as a placeholder in the editor. The wording could be improved a bit, e.g.: There are no terms to show in the Tag cloud yet.

Agreed

richtabor commented 1 month ago

We show an image placeholder when no image is added. What if we just show "ghost" tags? The style of a tag, with no tag text?

afercia commented 1 month ago

It's not unlike an empty button, or the post content empty state in a template, etc.

It's a little different, in my opinion. Same for the image placeholder. Those are placeholders to show users they have to edit or add something. Instead, the tags don't require editing other than the settings. The Tag clao is more similar to blocks like the 'Latest posts' one. When there are no posts, we don't show fake posts in the placeholder:

Screenshot 2024-07-22 at 09 44 05

I'd rather improve the wording as There's no content to show here yet doesn't explain why.

Taxonoomy terms will appear in the tag cloud once they are created and assigned to at least one post.

akasunil commented 1 month ago

Somewhat related https://github.com/WordPress/gutenberg/issues/37030