Closed Bug 1836582 Opened 11 months ago Closed 11 months ago

Update the matching behavior of addon suggestions

Categories

(Firefox :: Address Bar, task, P1)

task

Tracking

()

VERIFIED FIXED
116 Branch
Tracking Status
firefox115 --- verified
firefox116 --- verified

People

(Reporter: adw, Assigned: adw)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

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.

https://mozilla-hub.atlassian.net/browse/SNT-727

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 in onRemoteSettingsSync(), and I modified
    SuggestionsMap.add() to make it easy to generate new keywords from the
    strings in suggestion.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 the showLessFrequentlyCount. This is
    done in makeResult().

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 replaced addResults()
    with SuggestionsMap.
  • 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.
Pushed by smolnar@mozilla.com:
https://hg.mozilla.org/mozilla-central/rev/062b1716cd90
Update the matching behavior of addon suggestions. r=daisuke
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 116 Branch

STR for QA

  1. Set these prefs:
    browser.urlbar.addons.featureGate = true
    browser.urlbar.bestMatch.enabled = true
    browser.urlbar.quicksuggest.dataCollection.enabled = false
    
  2. 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.
  3. 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.

Flags: qe-verify+
Flags: in-testsuite+

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
Attachment #9337309 - Flags: approval-mozilla-beta?
QA Whiteboard: [qa-triaged]

Comment on attachment 9337309 [details]
Bug 1836582 - Update the matching behavior of addon suggestions.

Approved for 115.0b3.

Attachment #9337309 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

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.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: