-
Notifications
You must be signed in to change notification settings - Fork 35
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
Patterns: Add a curation filter to the UI #584
Conversation
Looks good to me! |
Same. It looks good 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on sandbox and worked as described. Codes-wise look good to me as well 👍
This new change means that the Call to Action menu item defaults to empty (https://wordpress.org/patterns/categories/call-to-action/), but you can see here the empty state also uses the "curated" patterns.
Does it need to make any changes to it accordingly, maybe rephrase the text under No results found
? Any better ways to handle this?
I probably missed this in the original issue, but does this mean I can never actually see "all" the patterns? I have to either subsection them by "community/curated"? What if I don't care about whether they are community or curated and just want them all? |
Good point. I can see where folks would want to see all and we could still prioritize by curated. What do you think @richtabor? This looks good as an initial iteration though. |
The missing "all" is very much intentional, and an attempt to bring a little structure to what is currently an unfortunate kitchen sink. I like to think that as we roll out potential features in the future like author patterns, pattern bundles, clearer guidelines for each category, related patterns etc, we can see what that does to the curation and then revisit. |
Technically, we do have the ability to show |
Core or community should be specifically requested to not break other API responses.
This ensures the `isLoading` check in ContextBar uses the correct (modified) query with the curation value, otherwise it checks the wrong query key and sticks on the "loading" state.
bb20adc
to
6c29983
Compare
This adds a new filter to the UI for "curation", as described in #580— "curated" patterns are those which have been picked to auto-load into core. The new filter is a dropdown with "curated" and "community", which lets the viewer switch between those two views. It defaults to curated on home & category archives, and uses curated for the empty state recommendations.
The author archive, favorites, and my patterns don't have this filter, and default to showing "all" patterns.
Fixes #580
Note, this is based off #583, which adds the parameter to the API endpoint.
Screenshots
I applied this to my sandbox to take screenshots, so this is using production patterns.
Favorites & My Patterns have no changes, but screenshots for reference
On medium-smaller screens, the filters wrap, then at 782px the menu collapses.
This new change means that the Call to Action menu item defaults to empty (https://wordpress.org/patterns/categories/call-to-action/), but you can see here the empty state also uses the "curated" patterns.
How to test the changes in this Pull Request:
core
keyword:/wp-admin/edit.php?wporg-pattern-keyword=core&post_type=wporg-pattern&post_parent=0&post_status=publish
— if not, you should be able to add some via wp-admin