Add interactive search mode
Created by: attfarhan
This PR adds the first parts of interactive search mode as described in RFC 15, behind a feature flag.
This PR only includes the repo and file filters, the two most-used filters. I will follow-up with another PR to add the remaining filter types.
The new InteractiveModeInput
consists of:
-
AddFilterRow
-- a new row that displays buttons to add a new filter to your query -
SelectedFilterRow
-- a new row that displays the filters already added to your query, and filters in the process of being added. -
FilterInput
-- a filter chip that is either editable or non-editable. When editable, it is a text input field that takes in the value for a particular filter, and will also provide relevant suggestions. When non-editable, it's simply a chip displaying the value of the filter. Clicking on the filter will toggle the mode from non-editable to editable. -
QueryInput
- the main query input, but without suggestions. We don't want this QueryInput to interpret/parse filters at all, however it's hard to do currently without a query parser on the frontend. However, we simply don't provide any suggestions or indication of filters, so we don't encourage it in this mode. Will need to follow up to build this properly in the future.
The URL query parameters are also different in interactive mode. Instead of using only the q=
parameter for the entire query, each filter has its own query parameter. So, adding a repo filter adds a repo=
query param in the URL, etc.. This is parsed properly such that the relevant filter chips appear on the search results page when navigating to a URL with these query params.
Tests: added e2e tests, and unit tests for the URL query builder and parser.