WordPress / pattern-directory

The WordPress Block Pattern Directory
https://wordpress.org/patterns/
GNU General Public License v2.0
119 stars 31 forks source link

Block theme: Keep search term when changing categories. #674

Open StevenDufresne opened 4 months ago

StevenDufresne commented 4 months ago

Describe the bug We don't persist the search term when you change categories. Adding a keyword is a deliberate action that should persist until the user makes the deliberate action to remove it (which I logged an issue for here https://github.com/WordPress/pattern-directory/issues/673).

Reproduce Steps to reproduce the behavior:

  1. Go to wp.org/patterns/
  2. Click on "Footers"
  3. Search for "copyright"
  4. Click "All"
  5. Notice the search keyword is no longer applied.

Expected After clicking "All", I should still be filtering based on the search term.

ryelle commented 4 months ago

That's the expected behavior, because you navigate top-down, the filters apply in that order— so you can search within a category or filter within a category or search, but clicking a different category goes back to the "top of the funnel". This pattern was established with Showcase.

StevenDufresne commented 4 months ago

Thinking back, I may have brought this up then as well. 😄

I feel like this needs hands-on user testing. I'll try to find some users to test the showcase and report back.

alexstine commented 4 months ago

I agree, the flow makes sense. Search context is a search results page.

StevenDufresne commented 4 months ago

If we don't think this is a legitimate concern, should we at least update the breadcrumb to reflect that context?

Currently when I search it goes from:

All Patterns \ Text

to

All Patterns \ Search Results 

Suggestion

All Patterns \ Text

to

All Patterns \ Text \ Search Results