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

Add 'No saved blocks' message to Inserter #4182

Merged
merged 1 commit into from
Dec 27, 2017

Conversation

noisysocks
Copy link
Member

Fixes #3994.

Previously, a brand new user would encounter a completely blank tab when selecting the Saved tab in the inserter.

I've fixed this by adding a simple message that indicates that there are no saved blocks:

Before After
screen shot 2017-12-27 at 14 35 46 screen shot 2017-12-27 at 14 24 54

I also removed the category headers from the Embed and Saved tabs, which I think looks cleaner:

Before After
screen shot 2017-12-27 at 14 35 32 screen shot 2017-12-27 at 14 32 30

I assume that this was the intended design based on the presence of an if ( 'embed' === tab ) check that was never executing (because of a typo: it should be embeds).

How to test

  1. Ensure you have no reusable blocks. You could do this by testing on a new site, running wp site empty, or executing a DELETE FROM wp_posts WHERE post_type = 'wp_block'.
  2. Open the inserter and click on Saved — you should see the message.
  3. Check that other parts of the inserter work correctly.

When there are no Reusable Blocks available to add, and the user selects
'Saved' in the Inserter, display a message instead of a completely blank
tab.
@noisysocks noisysocks added Needs Design Feedback Needs general design feedback. [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) labels Dec 27, 2017
@noisysocks
Copy link
Member Author

cc. @jasmussen @karmatosed @youknowriad

@jasmussen
Copy link
Contributor

Looks good visually! 👍

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@noisysocks noisysocks merged commit 40adaff into master Dec 27, 2017
@noisysocks noisysocks deleted the add/no-saved-blocks-message branch December 27, 2017 22:22
@aduth
Copy link
Member

aduth commented Jan 3, 2018

There's redundancy / inconsistency between this and #4040. Do we really need a custom message to explain that there's no saved blocks, or could we simplify to a standard "No blocks found" for all of the following cases:

  • There are truly no blocks registered
  • There are no results for a given search
  • There are no saved blocks

@noisysocks
Copy link
Member Author

I think specific copy provides a nicer user experience, but agree that those messages should all use the same component and appear visually similar.

@jasmussen
Copy link
Contributor

Though I agree a customized message is a nicer user experience, I would agree with aduth that it would be nice to simplify as much as we can, and if we can simplify the code by reusing an existing message, I think we should do that.

@karmatosed
Copy link
Member

I would +1 for simplifying. If we have time adding in customized messages in a lot of places would be amazing, but for now lets go with simple implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) Needs Design Feedback Needs general design feedback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing empty state when inserting a Reusable Block
5 participants