Make one class per realtime suggestion type that serves both opt-in and online suggestions
Categories
(Firefox :: Address Bar, task, P1)
Tracking
()
People
(Reporter: adw, Assigned: adw)
References
Details
(Whiteboard: [sng])
Attachments
(2 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
The current realtime opt-in implementation in DynamicSuggestions makes it hard to selectively enable certain realtime types. There's a single realtime_opt_in dynamic Rust suggestion type, so its RS records would need to include all realtime types: stocks, sports, etc. In order to selectively choose to enable the stocks opt-in but not the sports opt-in, we'd need to add another pref/Nimbus variable that told Firefox which opt-ins to enable.
It would be nice if we could tell Firefox to enable stocks suggestions, period, and then if the user hasn't opted in yet, Firefox would show the stocks opt in, and then after the user opts in, it would show the online stocks suggestions. We could do that if we had one SuggestProvider per realtime type. Then we'd have all the usual foo.featureGate and suggest.foo prefs too.
Updated•8 months ago
|
| Assignee | ||
Comment 1•8 months ago
|
||
This adds a new RealtimeSuggestProvider that is a base class for handling both
opt-in and online suggestions for a given realtime type. The idea is that each
time we add a new realtime type, we only need to subclass this new class, set
the appropriate realtimeType, and implement the dynamic view update stuff. The
base class automatically handles a bunch of things: the opt-in suggestion,
engagements, whether the feature should be enabled, and creating urlbar results.
Hopefully as we implement more realtime types, we can find opportunities for
doing more of the dynamic view updates in the base class rather than the
subclasses.
Depends on D261320
Comment 3•8 months ago
|
||
| bugherder | ||
| Assignee | ||
Comment 4•8 months ago
|
||
This adds a new RealtimeSuggestProvider that is a base class for handling both
opt-in and online suggestions for a given realtime type. The idea is that each
time we add a new realtime type, we only need to subclass this new class, set
the appropriate realtimeType, and implement the dynamic view update stuff. The
base class automatically handles a bunch of things: the opt-in suggestion,
engagements, whether the feature should be enabled, and creating urlbar results.
Hopefully as we implement more realtime types, we can find opportunities for
doing more of the dynamic view updates in the base class rather than the
subclasses.
Original Revision: https://phabricator.services.mozilla.com/D261321
Updated•8 months ago
|
Comment 5•8 months ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined: This is required for the "carrots" realtime-suggestions Suggest feature in 143.
- Code covered by automated testing: yes
- Fix verified in Nightly: no
- Needs manual QE test: no
- Steps to reproduce for manual QE testing: none
- Risk associated with taking this patch: low
- Explanation of risk level: This is some refactoring that only affects experimental Suggest features.
- String changes made/needed: none
- Is Android affected?: no
Updated•8 months ago
|
Updated•8 months ago
|
Updated•8 months ago
|
Updated•8 months ago
|
Updated•8 months ago
|
| Assignee | ||
Comment 7•8 months ago
|
||
Hi Valentin, FYI this bug changed how market suggestions are enabled, both the opt-in suggestion and online suggestions.
- For both suggestion types, you'll now need to set:
browser.urlbar.market.featureGate = truebrowser.urlbar.suggest.quicksuggest.nonsponsored = true
- For the opt-in suggestion, please don't set
browser.urlbar.quicksuggest.dynamicSuggestionTypesanymore, and reset it if you have a profile where you already set it (and this pref is not required for online suggestions)
We plan to follow this pattern for each new carrots/realtime type (Yelp, sports, etc.). So we'll have a featureGate pref, you don't need to set browser.urlbar.quicksuggest.dynamicSuggestionTypes, and you'll need to set the appropriate nonsponsored or sponsored pref.
In addition, the opt-in suggestion's RS record changed slightly. The suggestion_type should now be market instead of realtime_opt_in. We uploaded a new record to the dev server but I don't believe there's a record on stage or prod yet.
Comment 8•8 months ago
|
||
I can confirm that the Opt-in Section and the market suggestions are correctly enabled and displayed using the configuration mentioned in Comment 7, on the Dev server.
Tested on Latest Firefox Nightly 144.0a1 (Build ID: 20250821091952), on Windows 10 x64, Ubuntu 24.04 LTS and macOS 15.6.
Description
•