feat(frontend): add debounced typeahead suggestions to search input#1237
Open
KiaraGrouwstra wants to merge 1 commit intomainfrom
Open
feat(frontend): add debounced typeahead suggestions to search input#1237KiaraGrouwstra wants to merge 1 commit intomainfrom
KiaraGrouwstra wants to merge 1 commit intomainfrom
Conversation
Contributor
Adds a per-keystroke dropdown that fires a small ES query (`size: 8`)
against the existing `*.edge` ngram subfields with a 150 ms debounce
and stale-token drop. Suggestions are anchor links; clicking
navigates to the package or option detail. The Flakes page leaves
the dropdown disabled (its index is not channel-shaped).
Honors `navigator.connection.saveData` and `effectiveType in
{slow-2g, 2g}` via a new flag — when set, the typeahead is disabled
and behavior matches the pre-change submit-on-enter UX.
Closes the dropdown on submit, Escape, and blur (with a 200 ms grace
period so a click on a suggestion still navigates). Re-focusing the
input re-shows cached suggestions.
HTML tags in description fields are stripped before display.
5e52528 to
24c3ce2
Compare
Member
|
there seems to be an extra bulleted list under the search box that pops in and out of view? |
Member
|
While I think this is neat, I'm a bit concerned that this will seriously increate the load on our ES instance, which already seems to be struggling sometimes. What could we do to monitor/compensate for that? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Search.Typeaheadmodule: 150 ms debounced, stale-token drop, hits the existing*.edgengram subfields withsize: 8. Suggestions render as anchor links that navigate straight to the package/option detail.navigator.connection.saveData(andeffectiveType in {slow-2g, 2g}) - the dropdown stays disabled on metered/slow connections and the page falls back to the original submit-on-enter UX.No backend or mapping changes - reuses existing edge subfields. If ranking quality turns out to be poor we can follow up with a
search_as_you_typefield; that would require an index version bump.Disclaimer: i used a coding agent in the creation of this patch.
Test plan
npm run prodbuilds clean.