Repository navigation
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: 0 B Total Size: 7.95 MB ℹ️ View Unchanged
|
|
Flaky tests detected in 84046f4. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25438547790
|
| layout: {}, | ||
| }; | ||
|
|
||
| function TaxonomiesEmptyState( { |
There was a problem hiding this comment.
@ntsekouras looking at the amount of duplication necessary it would definitely be nice to reuse more components between post types and taxonomies 😉
| [ totalItems, totalPages ] | ||
| ); | ||
| const hasSearch = !! view.search?.trim(); | ||
| const hasFilters = !! view.filters?.length; |
There was a problem hiding this comment.
A filter can have a undefined value if the user opened the filter UI but didn't select a value, no? Also filters can be locked, right? Should we cover those cases explicitly?
There was a problem hiding this comment.
I haven't checked in depth, but I'm wondering if that should become a part of DataViews with a noRecords prop for example similar to the empty, but consumers would need to pass that flag. --cc @oandregal
| </EmptyState.Description> | ||
| { ! hasSearchOrFilters && ( | ||
| <EmptyState.Actions> | ||
| <Link |
There was a problem hiding this comment.
Should we add a button to create a new one? Or is it clear enough where the existing button is?
There was a problem hiding this comment.
It would be great to have design guidance on that and document it alongside the component as "recommended usage";
- I didn't add a button to the empty state since it was already in the header, but it does make sense
- Is using Link in this case ok instead of a Button? If it is, I'll document at the storybook.
cc @jameskoster
There was a problem hiding this comment.
Yep, honestly, I was thinking the same thing. Wasn't sure what to recommend, which is why I was so vague in my question 😉
There was a problem hiding this comment.
I think it's fine to land as is with a Link and revisit.
There was a problem hiding this comment.
Agreed, not a blocker by any means
There was a problem hiding this comment.
I'd be inclined to start without a button/link. The button in the header is already very prominent as noted. It also leaves room for a potential "Clear filters" action when no results are found.
| </EmptyState.Description> | ||
| { ! hasSearchOrFilters && ( | ||
| <EmptyState.Actions> | ||
| <Link |
There was a problem hiding this comment.
Should we add a button to create a new one? Or is it clear enough where the existing button is?
| <PostTypesEmptyState | ||
| hasSearchOrFilters={ hasSearchOrFilters } | ||
| /> |
There was a problem hiding this comment.
This is completely memoizable IMO, no need to be rerendered on every render.
| <TaxonomiesEmptyState | ||
| hasSearchOrFilters={ hasSearchOrFilters } | ||
| /> |
There was a problem hiding this comment.
This is completely memoizable IMO, no need to be rerendered on every render.
|
Thanks for your work! I'm closing though since the experiment was removed here: #81340. |
What?
Part of #77600
Why?
The default empty state in DataViews is pretty bland; this improves UX with more elaborate, friendlier copy.
Also adds links to documentation to answer "what are taxonomies and custom post types?"
How?
Use EmptyState component from DS.
Testing Instructions
See both taxonomy and post type pages without content.
Try searching with text input so that there are no search results.
Try filters so that there are no results.
Testing Instructions for Keyboard
Screenshots or screencast
Before
After
Taxonomies
Post types
Use of AI Tools
yes