Autocomplete suggestions: do not wait for fechSuggestions() to emit before showing static suggestions
Created by: lguychard
-
Sourcegraph version:
sourcegraph/server:3.10.0-rc.2
Steps to reproduce:
- Type in "repo" in the search bar
Expected behavior:
Filter suggestions are immediately shown. Fuzzy suggestions are shown eventually, once they are fetched.
Actual behavior:
The suggestions dropdown is only shown when fuzzy suggestions have been fetched.
I think the suggestions dropdown would feel a lot more reactive if static suggestions were shown immediately (and then eventually merged with fuzzy suggestions).
This could be easily done with something like this:
merge(
of(staticSuggestions),
fetchSuggestions().pipe(
map(backendSuggestions => [...staticSuggestions, ...backendSuggestions])
)
)