unicorn-utterances icon indicating copy to clipboard operation
unicorn-utterances copied to clipboard

Clearing search input resets tag selections too eagerly

Open rjt-rockx opened this issue 1 year ago • 4 comments

Flow: I type a search query I pick a tag to filter by and go through the search results There's a bunch of results, so I try to edit my query and clear the input and type something else

Intent: I want to edit my query but keep the tag and get results within that tag, hoping to narrow down my results

Behavior: The tag state is cleared and searches aren't filtered by that tag, making me have to reselect it each time I want to narrow down my query

rjt-rockx avatar Oct 23 '23 14:10 rjt-rockx

Actually, I'm removing the bug label temporarily because I'm not sure this is bad UX.

This is definitely not ideal, but neither is the scenario where you remove a bunch of text and labels persist when you wouldn't expect.

I think this is an open-ended UX question about what's better behavior.

@fennifith @MateuszWasik what do y'all think?

crutchcorn avatar Mar 06 '24 17:03 crutchcorn

I totally agree with that @crutchcorn.

IMO it works well. I'm not confused by how it behaves, but of course there is always room for improvement.

MateuszWasik avatar Mar 06 '24 18:03 MateuszWasik

Outlining some of the reasoning I think is behind this:

  • Filters are currently tied to the active search results; only filters that are included in the current search results are displayed in the list.

  • If the current search is changed, a new search might not include the same filters. This might lead to confusion when the selected filters are no longer available in the results.

  • If a filter is selected, but not available in the results, it is not displayed in the filter sidebar. This can lead to a state where the page has selected filters, but there are no checked filters in the list.

  • If a user clears the current search and starts a new search, they might expect to use new filters with it, and not keep the filters from their current search.

However, the current behavior does not clear the filters in all cases where the user makes a new search.

  • The filters are only cleared if the search input is cleared in the process of typing a new search.
  • It is entirely possible to type a new search into the input (by immediately replacing the search input with a new search) without clearing the filters.
    • This distinction might not be clear to a user.
  • As @rjt-rockx has pointed out, clearing the search input is not inherently connected to starting a new search query - users might still want to refine their current query when typing a new search input.

Some changes that I think could address this:

  • Once the user has made a search on the search page, the selected filters are always visible and are not cleared without an intentional interaction.
  • A selected filter should always be shown in the filter list, even if it is not included in the current query.
    • These filters are shown in the filter sidebar, even if they have "0" results for the query.
    • TBD: When unchecked, are they immediately removed from the filter sidebar? Or do they stay in the sidebar until the search input is changed?
  • On the "No results found" empty state, if the user has filters selected, include a button / call-to-action to clear the filters to see more results.
    • i.e. "There are no results with the selected filters. [Show All Results]"

Thoughts?

fennifith avatar Mar 17 '24 17:03 fennifith

good points, agreed

rjt-rockx avatar Mar 17 '24 17:03 rjt-rockx