Support keyword-based weather suggestions in addition to zero-prefix
Categories
(Firefox :: Address Bar, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox111 | --- | verified |
People
(Reporter: adw, Assigned: adw)
References
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
Per product requirements, we need to support keyword-based weather suggestions, i.e., suggestions that are shown when the user types certain weather-related keywords.
Assignee | ||
Comment 1•2 years ago
|
||
This adds a new pref, browser.urlbar.weather.zeroPrefix
. When true, weather
suggestions are shown on "zero prefix" like they are now, which means they're
shown when the user focuses the urlbar and before they type anything. When the
pref is false, the weather provider will show suggestions only if the search
string matches a keyword in a set of keywords managed by QuickSuggest.weather
.
My plan is to store the keywords in the quick suggest config object in remote
settings. Nan suggested this too. Currently the config does not contain any
keywords, but this patch can be tested by setting the pref to false, running the
following in the browser console, and then typing "weather" in the urlbar:
ChromeUtils.importESModule("resource:///modules/QuickSuggest.sys.mjs")
.QuickSuggest.remoteSettings._test_setConfig({
weather_keywords: ["weather"],
});
Other changes:
- It's possible for a keyword to match both the weather suggestion and a quick
suggest suggestion. Only the weather suggestion should be shown. This patch
modifies to the muxer for that. - This modifies
UrlbarView.#rowLabel()
to show the "Top pick" (a.k.a. best
match) label for keyword-based weather suggestions, in addition to zero-prefix
suggestions like we currently do. - This modifies the remote settings client so it becomes enabled when keyword-
based weather suggestions are enabled, so that the config can be accessed.
Depends on D168738
Comment 3•2 years ago
|
||
bugherder |
Assignee | ||
Comment 4•2 years ago
|
||
STR:
- Enable zero-prefix weather suggestions by setting these prefs:
browser.urlbar.quicksuggest.enabled = true browser.urlbar.weather.featureGate = true
- Click in the urlbar and verify a weather suggestion appears (if it doesn't, give Firefox a few seconds to fetch it and try again)
- Enable keyword-based weather suggestions: Set
browser.urlbar.weather.zeroPrefix
to false, and open the browser console and run the following JS:ChromeUtils.importESModule("resource:///modules/QuickSuggest.sys.mjs") .QuickSuggest.remoteSettings._test_setConfig({ weather_keywords: ["weather"], });
- Click in the urlbar and verify a weather suggestion does not appear (it might appear for a split second right after the panel opens, that's expected, but it should go away and not reappear)
- Type "weather" and verify it does appear
Comment 5•2 years ago
|
||
I have verified this task on the latest Firefox Nightly 111.0a1 (Build ID: 20230209041032) on Windows 10 x64, macOS 12.6.1, and Ubuntu 20.04 x64.
- The Weather result is displayed when clicking inside the Address Bar if the
browser.urlbar.weather.zeroPrefix
pref istrue
. - After setting the
browser.urlbar.weather.zeroPrefix
pref tofalse
, the Weather result is displayed when the snippet from step 3, comment 4 is ran, and theweather
keyword is typed in the Address Bar. The Weather result is no longer triggered with just clicking inside the Address Bar.
Description
•