Autocomplete: show price, add a see-all link, debounce requests#172
Open
loevgaard wants to merge 1 commit into
Open
Autocomplete: show price, add a see-all link, debounce requests#172loevgaard wants to merge 1 commit into
loevgaard wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## issue-137-markup-polish #172 +/- ##
=============================================================
+ Coverage 49.17% 49.19% +0.01%
Complexity 797 797
=============================================================
Files 140 140
Lines 2546 2547 +1
=============================================================
+ Hits 1252 1253 +1
Misses 1294 1294 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
5282a21 to
89f3a1a
Compare
6cd05a1 to
3391a9a
Compare
89f3a1a to
2032e63
Compare
- Show the (channel/currency-scoped) product price in each suggestion, currency-formatted via Intl.NumberFormat; guarded so non-product sources render nothing. - Add a "See all results" footer link per source pointing at the full search page for the current query (label translated into all 12 locales, passed through the autocomplete configuration). - Debounce the source (~200ms) so a fast typer no longer fires one Meilisearch request per character; stale-response ordering is already handled by the library, so this is purely a load win. Closes #136
2032e63 to
837075e
Compare
3391a9a to
97ebda2
Compare
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.
What
Three improvements to the autocomplete dropdown:
Intl.NumberFormat, guarded so non-product sources render nothing.debouncePromisearound the sources coalesces them. Stale-response ordering is already handled by the library, so this is purely a load win.Testing
shows the price and a see-all link in the suggestions: asserts a formatted price and a footer link tosearch?q=jeans.debounces Meilisearch requests while typing: typing 10 characters quickly issues ≤ 3 multi-search requests.AutocompleteRuntimeTestupdated for the newseeAllLabel;node --checkandlint:containerclean.Closes #136
Stacked on #171 (#137).