Update the matching behavior of addon suggestions
Categories
(Firefox :: Address Bar, task, P1)
Tracking
()
People
(Reporter: adw, Assigned: adw)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
48 bytes,
text/x-phabricator-request
|
dmeehan
:
approval-mozilla-beta+
|
Details | Review |
There are a couple issues with matching addon suggestions in remote settings right now. The keywords in remote settings are full keywords. We do have addons.minKeywordLength
and the related Nimbus variable, but the keywords added to the suggestions map don't take it into account. This means a suggestion from RS can only be matched by typing a full keyword.
I confirmed with Nive what the expected matching behavior should be, and it's now documented in the spec. In summary, an addon suggestion can be triggered by typing the first word in one of its full keywords. After the user clicks "Show less frequently", they must type the first word plus a number of characters equal to the number of times they clicked it.
Assignee | ||
Comment 1•11 months ago
|
||
This implements the new required matching behavior, which isn't based on min
keyword length anymore. This is how it works:
- Use the full keywords in remote settings to generate keywords that contain the
first word plus each possible substring after the first word. For example if a
full keyword is "video download", then generate these keywords: "video",
"video ", "video d", "video do", etc. If a full keyword is only one word, then
use it as is. The keywords never change even when the user clicks "Show less
frequently". This is implemented inonRemoteSettingsSync()
, and I modified
SuggestionsMap.add()
to make it easy to generate new keywords from the
strings insuggestion.keywords
. - Keep track of the number of times the user clicked "Show less frequently" in
showLessFrequentlyCount
. - When a suggestion is fetched from the suggestions map, filter it out if the
search string isn't long enough given theshowLessFrequentlyCount
. This is
done inmakeResult()
.
Other changes:
- I made some of the private properties in
AddonSuggestions
public so that the
xpcshell test can easily use them. I think it's OK for them to be public. - Added
show_less_frequently_cap
to the RS config object so that we can
specify a cap in RS as well as Nimbus. - mv'ed test_quicksuggest_addResults.js to test_suggestionsMap.js, since I
modified this file. I should have done that back when I replacedaddResults()
withSuggestionsMap
. - Fixed a bug in
SuggestionsMap.add()
where the same suggestion could be added
multiple times to the array stored in the map, if it had duplicate keywords.
Assignee | ||
Updated•11 months ago
|
Pushed by smolnar@mozilla.com: https://hg.mozilla.org/mozilla-central/rev/062b1716cd90 Update the matching behavior of addon suggestions. r=daisuke
Comment 3•11 months ago
|
||
bugherder |
Assignee | ||
Comment 4•11 months ago
|
||
STR for QA
- Set these prefs:
browser.urlbar.addons.featureGate = true browser.urlbar.bestMatch.enabled = true browser.urlbar.quicksuggest.dataCollection.enabled = false
- Type "image". Verify the addon suggestion "Search by Image" appears when you finish typing "image" but not before. i.e., it should appear when you finish typing the first word.
- Continue typing "image search". Verify the suggestion still appears as you type it.
There are some other keywords that should trigger addon suggestions using similar STR but don't currently because they also trigger adM/Wikipedia suggestions, which are shown instead. That's a separate problem due to the suggestions having the same score. I'll fix that on remote settings.
Assignee | ||
Comment 5•11 months ago
|
||
Comment on attachment 9337309 [details]
Bug 1836582 - Update the matching behavior of addon suggestions.
Beta/Release Uplift Approval Request
- User impact if declined: This is necessary for the Firefox Suggest addons feature we intend to ship in 115.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: Please see comment 4
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Small patch that only affects addon suggestions, which are disabled by default. Has tests.
- String changes made/needed:
- Is Android affected?: No
Updated•11 months ago
|
Comment 6•11 months ago
|
||
Comment on attachment 9337309 [details]
Bug 1836582 - Update the matching behavior of addon suggestions.
Approved for 115.0b3.
Comment 7•11 months ago
|
||
bugherder uplift |
Comment 8•11 months ago
|
||
The issue is verified fixed using the latest Fx 116.0a1 and Fx 115.0b3 on Windows 10 and Ubuntu 20. Add-on suggestions are only displayed if after a full keyword is typed in.
Description
•