Bug 1841295 - Update PocketSuggestions for the final suggestions schema and implement...
commit5714ea5aad29943f2e4b58b2e733fc48877d8e09
authorDrew Willcoxon <adw@mozilla.com>
Tue, 4 Jul 2023 02:28:21 +0000 (4 02:28 +0000)
committerDrew Willcoxon <adw@mozilla.com>
Tue, 4 Jul 2023 02:28:21 +0000 (4 02:28 +0000)
tree938bbc31b0fdca982317eaa9b3b1a81bc5c5f6c2
parent2372fb1f687d4d057b3e8a323ffcd45bc1dab8dc
Bug 1841295 - Update PocketSuggestions for the final suggestions schema and implement the desired matching behavior. r=daisuke

Each suggestion has "low" and "high confidence" keywords. When a high confidence
keyword is matched, the suggestion should be shown as a top pick, and otherwise
it should be shown as a normal Suggest result. High confidence keywords must be
matched in full, but low confidence keywords can be matched with prefixes
starting at the first word.

The low confidence matching behavior is the same as addon suggestions, so I
factored out that function into a new helper defined on `SuggestionsMap`.

I added a `full_keyword` property to the suggestions. It's not used yet but
we'll use it when we implement the final UI, which needs to show the full
keyword.

Differential Revision: https://phabricator.services.mozilla.com/D182580
browser/components/urlbar/UrlbarUtils.sys.mjs
browser/components/urlbar/private/AddonSuggestions.sys.mjs
browser/components/urlbar/private/PocketSuggestions.sys.mjs
browser/components/urlbar/private/QuickSuggestRemoteSettings.sys.mjs
browser/components/urlbar/tests/quicksuggest/browser/browser_quicksuggest_pocket.js
browser/components/urlbar/tests/quicksuggest/unit/test_quicksuggest_pocket.js
browser/components/urlbar/tests/quicksuggest/unit/test_suggestionsMap.js