Skip to content

Autocomplete: show price, add a see-all link, debounce requests#172

Open
loevgaard wants to merge 1 commit into
issue-137-markup-polishfrom
issue-136-autocomplete-improvements
Open

Autocomplete: show price, add a see-all link, debounce requests#172
loevgaard wants to merge 1 commit into
issue-137-markup-polishfrom
issue-136-autocomplete-improvements

Conversation

@loevgaard

Copy link
Copy Markdown
Member

What

Three improvements to the autocomplete dropdown:

  1. Show the price. The product index documents are already channel/currency-scoped, so the correct price exists per index. Each suggestion now shows the price, currency-formatted via Intl.NumberFormat, guarded so non-product sources render nothing.
  2. "See all results" footer. Each source now renders a footer link to the full search page for the current query — previously the only path from the dropdown to the results page was knowing to press Enter. The label is translated into all 12 locales and passed through the autocomplete configuration.
  3. Debounce the source (~200 ms). Previously every keystroke fired a Meilisearch query straight from the browser; fast typers generated one request per character. A debouncePromise around the sources coalesces them. Stale-response ordering is already handled by the library, so this is purely a load win.

Testing

  • e2e shows the price and a see-all link in the suggestions: asserts a formatted price and a footer link to search?q=jeans.
  • e2e debounces Meilisearch requests while typing: typing 10 characters quickly issues ≤ 3 multi-search requests.
  • AutocompleteRuntimeTest updated for the new seeAllLabel; node --check and lint:container clean.

Closes #136


Stacked on #171 (#137).

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.19%. Comparing base (97ebda2) to head (837075e).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

- 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
@loevgaard loevgaard force-pushed the issue-136-autocomplete-improvements branch from 2032e63 to 837075e Compare July 10, 2026 18:11
@loevgaard loevgaard force-pushed the issue-137-markup-polish branch from 3391a9a to 97ebda2 Compare July 10, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant