Automattic / bugomattic

Bugomattic is a tool that guides bug reporters to the right actions within large, complex organizations
GNU General Public License v2.0
6 stars 0 forks source link

Fix search handling #83

Closed dpasque closed 1 year ago

dpasque commented 1 year ago

What Does This PR Add/Change?

This adds three main fixes to our debounced search handling:

  1. If a search term is the exact same as the last emitted search term, we won't debounce it. However, if users still hit enter or the search button, we will emit it. Think of typing "abc", then after the debounce, quickly deleting and re-adding the "c".
  2. We remove the forced searching on input blur (lose focus). That was way too eager lol.
  3. If the user clears the search term on the duplicate search page we show the placeholder.

You can basically think of our searching rules as: If the user ever hits enter or the search button, always respond to the behavior. In the case of debouncing, we add optimizations, etc.

One note re: a11y -- we don't trigger any screen reader alerts when the user clears their search. That is intentional! Nothing is actually changing meaningfully in the results (no search is actually firing), so we should avoid spamming the user with alerts.

Testing Instructions

Feel free to play around with the duplicate search bar and the feature selector! 👍

Issues

Related to #
Closes #