5

Add weather suggestions to quick suggest

 1 year ago
source link: https://bugzilla.mozilla.org/show_bug.cgi?id=1799363
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Details

This adds a weather feature to quick suggest. It periodically fetches a weather
suggestion from Merino. UrlbarProviderQuickSuggest shows the suggestion when the
search string is empty ("zero prefix").

The implementation of the UrlbarResult returned by UrlbarProviderQuickSuggest is
only temporary. Mandy is working on the final UI in
SNT-323. Landing a temporary
implementation allows Mandy to base her patch on it and trigger real weather
suggestions from Merino to test her implementation against. It also lets people
on the team test weather suggestions without having to wait for the final UI to
land.

I added two prefs and one Nimbus variable to control the feature. It will
initially be rolled out in an experiment, so we need a Nimbus variable. In the
initial experiment, users will not be able to turn off the weather suggestion,
but they will be able in the future. So, right now there is no other UI related
to this feature, but in the future there will be.

  • weatherFeatureGate - Nimbus variable that controls the whole feature
  • browser.urlbar.weather.featureGate - Fallback pref for the Nimbus variable
  • browser.urlbar.suggest.weather - This is similar to the other browser.urlbar.suggest prefs. Right now there's no UI to allow the user to toggle this, but there probably will be in the future.

I set the fetch interval to 30 minutes. That seems reasonable considering that
the suggestion contains the current temperature and weather. Merino will set
caching headers appropriately so that Firefox won't actually make a new network
request if the previously fetched suggestion is new enough.

Depends on D161368


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK