Description
Problem
Sometimes users want to quickly filter some info on a View (find cart by name, filter by account segment, etc). There are cases when users get confused with Search icon in View header, thinking that it is related to the View, but find that it is actually a global search.
Additionally, it seems that this icon was rarely used for actual search. Nav menu search or keyboard shortcut (cmd+K) was used much more often. But also the search icon was used to open it in a new panel either to the left, or to the right. We won't have this behavior on hover, but we can keep the keyboard shortcuts to do the same thing.
Solution
After we implement Update headers in Views the Search icon will be transformed into a Search this View input, which will work as a quick filter of entities inside a particular View:
I suggest to show it in such expanded way (Search icon + Search this View text) for the first release, so users won't be confused that this is the old global search icon which was just moved to the left. Later, when users get familiar about Search in View, we may collapse it to a single Icon.
On small layouts it will be collapsed to an icon anyway.
Technical details
Search in View works on already filtered data (via Filters) only (and not all entities of DBs, added to the View)
Search in Views looks for query matches in Entity Name, OR other visible fields, such as Location , Email, Number , etc. Please sync with Search in basic text/email/phone Fields on technical part
Typed text in Search input is stored only locally, and is reset after refresh or tab close. It is kept while panel is collapsed, though
Minimal characters from which search starts — 1 (similar to how Filters work)
Should we have a specific keyboard shortcut for Search in View — (I suggest intercept Cmd + F for Views, Notion does it. Make sure it does not work on Entity or Doc for embedded view, here we can have many views and text and we should not intercept here.)
Search Results:
Since Search in View works similar to AND filter, it hides Entities which do not match the search query, therefore, search result screen is the actual View (with everything preserved) without items that don't match the query
Order is also inherited from View settings
If no results appear, we just show empty View (without any Entities)
Permissions: if user has access to view Entity, he can access Search in View
For search in field values, please align with developer of Search in basic text/email/phone Fields
🚫 Search in Whiteboard is out of scope
Design details
Search input will have a fixed width of 140px. If it's collapsed to an icon, it will expand to 140px on click.
Search input will have a hover state where cursor changes to ][ to indicate that user can type in
We are going to highlight parts of the Entity Name which matches the search query with body-regular-medium-500 font style
For no results, we are going to show empty View (similar to case when Filtered to no results)
Search in Views will work only in Views now (not Relation or Embedded Views). We may add Search there in future too → 🦄 Search in Embedded & Relation Views
Figma
https://www.figma.com/design/JRmd7B9p7MPXFojD2fZuD1/PA---Views?node-id=612-20448&t=NwR1yd112PbeHKSl-1