Add search to the context switcher
What does this MR do and why?
Adds search capability to the context switcher.
This is the first iteration for adding search to the new sidebar. Given that this is all behind a feature flag, we'll be fine-tuning the experience in subsequent MRs to keep the changes as small as possible.
What this does:
- Tweaks the search box's style to match the designs.
- Enables the triggering of a GraphQL query to search for projects and groups when text is typed in the search box.
- Displays the found items in the corresponding list.
- Shows a no results text in the relevant list when no items could be found.
What this does not do (will be done in upcoming iterations):
- Auto-focus the search box when opening the context switcher.
- Loading states.
- Error states.
- Collapsible results lists.
Screenshots or screen recordings
Context | Preview |
---|---|
Initially, only shows cached items if any | |
On search, shows search results | |
When there are no results, shows empty texts |
How to set up and validate locally
- Enable the new nav:
- In the super sidebar, click on the context title to expand the context switcher.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #378541 (closed)
Edited by Paul Gascou-Vaillancourt