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

Block theme: Allowing users to clear the search form and submit. #673

Open
StevenDufresne opened this issue Apr 16, 2024 · 8 comments
Open
Labels
[Component] Theme The frontend of the pattern directory, pattern lists UI [Status] Needs Design Feedback [Type] Discussion Proposed idea, needs input from others before actionable

Comments

@StevenDufresne
Copy link
Collaborator

Describe the bug
We currently submit the page to apply filters and/or reset states. However, the search bar currently includes the required attribute which makes it impossible to clear the search term directly. I think we should remove that attribute which gives users the ability to clear their search term.

I did this for the wp.org/plugins theme and think we should do it here.

Problem
Screen Capture on 2024-04-17 at 08-24-36 (1)

@ryelle
Copy link
Contributor

ryelle commented Apr 16, 2024

I've added the "All" link which clears the search by bringing you back out to the archives page, in #669.

It doesn't make sense to me to search for an empty string to get back to the full archives, so I think what we've got on Patterns now makes more sense.

@StevenDufresne
Copy link
Collaborator Author

StevenDufresne commented Apr 17, 2024

I'm not sure it's clear that in order to clear my search while on the "All" category, I need to click on "All" again. Thinking about this use case:

  1. User arrives on wp.org/patterns
  2. User search for something in the search bar

How would this user know that they need to click "all" to remove their keyword?

EDIT: I recognize they can move back through the breadcrumbs.

@ndiego
Copy link
Member

ndiego commented Apr 18, 2024

Just noting that we have this issue everywhere we use the Core Search block: Developer Resources, Developer Blog, Showcase, etc. 😅

That said, I think it feels more awkward here due to the categories.

@ryelle
Copy link
Contributor

ryelle commented Apr 18, 2024

Considering this is a core block, and we would probably want the same behavior everywhere, this should either be addressed in core or in wporg-mu-plugins.

However, it seems to be very intentional that the search form does not submit when empty.

Also, empty-search results don't really work by default (for example, this still uses the search result template). So I don't think this would gain any traction in core.

If we decide the wporg case is different, then this should be moved over to wporg-mu-plugins so it applies across the site.

@ndiego
Copy link
Member

ndiego commented Apr 18, 2024

However, it seems to be very intentional that the search form does not submit when empty.

Yeah, I understand the situation where you have already searched for something and now want to clear your search. The current setup makes this a bit difficult. On the current Plugins site, searching for an empty string takes you back to the homepage, which I don't think would work (or be intuitive) in all search bar implementations across WordPress.org.

plugin-search

Also if you have not already searched, I don't feel like you should be able to search for an empty string.

@ryelle
Copy link
Contributor

ryelle commented Apr 18, 2024

Yeah, I think we need to rethink applying & clearing filter combos in general (including these other issues #674 & #678).

@ndiego
Copy link
Member

ndiego commented Apr 18, 2024

Yeah, I think we need to rethink applying & clearing filter combos in general (including these other issues #674 & #678).

💯 A more holistic solution for the whole site and the various use cases for filtering and search would be ideal. cc @fcoveram

@ryelle ryelle added [Type] Discussion Proposed idea, needs input from others before actionable [Component] Theme The frontend of the pattern directory, pattern lists UI [Status] Needs Design Feedback labels Apr 18, 2024
@fcoveram
Copy link

One of the main reasons of why the flow looks broken is that we have not defined the initial stage/screen for where users start from.

In other repository services, like YouTube and Pinterest, the homepage works as an index page of curated content, and when you search for something, you land on a similar page that allows you to filter. In both cases, clicking on either the logo or “home” takes you back to the initial stage. Pinterest also does it by clearing the search input, whereas YouTube only clears the text typed.

Initial stage Search results page
Pinterest Screenshot of Pinterest homepage Screenshot of Pinterest search results page
YouTube Screenshot of YouTube homepage Screenshot of YouTube search results page

It seems that we need to define that initial stage in Plugins. We could mirror Showcase flow and have two instances, the section name that takes you to the homepage (already implemented), and a new “All plugins” link that takes you to a new view with all patterns displayed (not filtered, and sorted by newest [TBD]). This logic could also work for Patterns, where the “All patterns” link addresses the Curated/Community discussion by showing them all and sorted by newest (TBD).

This idea sounds appealing to me as it reinforces the relationship of Extend group by making the navigation and the IA more consistent, and therefore, not relearning how the section works.

Developers and Forums, on the other hand, are special case as you can consider multiple initial stages. The latter for instance has one search per forum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] Theme The frontend of the pattern directory, pattern lists UI [Status] Needs Design Feedback [Type] Discussion Proposed idea, needs input from others before actionable
Projects
None yet
Development

No branches or pull requests

4 participants