Commit graph

71 commits

Author SHA1 Message Date
Dale Harvey
66849540fe Bug 1822326 - Add ability to configure maximum trending suggestions. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D172766
2023-03-17 11:41:28 +00:00
Drew Willcoxon
34b853d0d1 Bug 1819797 - Update telemetry for navigational suggestions and dynamic Wikipedia and add subtypes to quick suggest results. r=daleharvey
This adds a bunch of scalars to record navigational suggestions telemetry as
discussed with data science and described in the spec. These scalars are
different from the other Suggest ones because we want to record how nav
suggestions interact with the heuristic result. Unlike the existing scalars, the
keys of these new scalars are the types of heuristics that were shown when a nav
suggestion was or wasn't shown. One of the scalars is updated every time a nav
suggestion is *not* shown, and of course for most users that will be the vast
majority of the time or all the time, so I put all these scalars behind a Nimbus
variable. We'll set the variable to true in the control and treatment branches
of the nav suggestions experiment.

This patch also makes sure nav suggestions are recorded properly in Glean, as
`navigational`. I noticed that dynamic Wikipedia results are currently recorded
as `suggest_non_sponsor`, so I also added a new `dynamic_wikipedia` Glean type
for them. They're also recorded as `urlbar.picked.quicksuggest` in the legacy
telemetry, so I also changed it so they're recorded as
`urlbar.picked.dynamic_wikipedia`.

Currently for dynamic Wikipedia, the non-sponsored scalars are also incremented,
and I discussed with data science whether they and the sponsored scalars should
be incremented for all the new Suggest suggestion types we now have. We agreed
that they should be reserved for the usual partner sponsored and expanded
Wikipedia suggestions, and they should not be used for these new Suggest types,
so this patch also makes that change, and it does not update the non-sponsored
scalars for nav suggestions either.

The other major change this makes is to add a new `subtype` property to quick
suggest result payloads. I think we need a clear, simple way to distinguish
between all these various Suggest suggestion types that doesn't depend on
examining different payload properties depending on the type.

Differential Revision: https://phabricator.services.mozilla.com/D171525
2023-03-08 01:11:02 +00:00
Drew Willcoxon
ee3004c674 Bug 1817038 - Move weather suggestion keywords to Nimbus. r=daisuke
This reverts the changes from D168757 bug 1814795 related to remote settings. It
moves the weather keywords from the config in remote settings to a new Nimbus
variable called `weatherKeywords`. Bug 1817038 has more context.

It also adds another variable called `weatherKeywordsMinimumLength` that lets
the user type prefixes of the keywords instead of the full strings. This is
similar to how sponsored and Wikipedia suggestion keywords contain prefixes,
except here Firefox is computing the prefixes from the full keywords instead of
assuming that the prefixes are in the keyword data.

It also removes the `weather.zeroPrefix` pref added in D168757. Instead, the
weather suggestion is triggered on zero prefix if a Nimbus experiment isn't
active or if the experiment doesn't define `weatherKeywords`.

Finally, it makes one unrelated change: The user's search string can now contain
trailing spaces and still match a weather keyword. I don't think it makes sense
for the weather suggestion to be shown when you type "weather" but then it goes
away after you type a space.

Differential Revision: https://phabricator.services.mozilla.com/D169977
2023-03-03 23:51:54 +00:00
Daisuke Akatsuka
4874944c05 Bug 1817196: Record preference value that affects the number of results showing in the urlbar r=mak
Differential Revision: https://phabricator.services.mozilla.com/D170317
2023-02-28 21:02:35 +00:00
Stanca Serban
9e0ba81905 Backed out changeset e7a8fb56745e (bug 1817196) as requested by dev for missing data-review. CLOSED TREE 2023-02-28 11:40:18 +02:00
Daisuke Akatsuka
1441fa602e Bug 1817196: Record preference value that affects the number of results showing in the urlbar r=mak
Differential Revision: https://phabricator.services.mozilla.com/D170317
2023-02-28 00:51:46 +00:00
Dale Harvey
31edb5e98c Bug 1811931 - Add support for trending suggestions. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D167618
2023-02-23 10:07:08 +00:00
Dão Gottwald
075527b581 Bug 1813517 - Add hidden pref for allowing Tab to skip over the menu button. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D170267
2023-02-22 11:16:44 +00:00
Rob Wu
e52e35b970 Bug 1784662 - Reduce time spent in browser_ext_omnibox.js test r=willdurand,adw
This is a test-only change. It introduces a new Urlbar pref to make the
existing 3000 ms timeout configurable.

That timeout is currently reached 8 times in the test. That means that
the test will take at least 3 x 8 = 24 seconds to run while basically
doing nothing, and makes the test prone to reach the deadline by which
the test is declared timed-out.

To avoid "Test timed out" errors, the test now reduces the fixed 3000 ms
timeout to 500 ms, so now we wait for 8x500 = 4 seconds instead of 24.

Differential Revision: https://phabricator.services.mozilla.com/D169846
2023-02-17 18:20:01 +00:00
Gregory Pappas
4ebe5099a5 Bug 1814980 - Remove MAX_OMNIBOX_RESULT_COUNT r=adw
MAX_OMNIBOX_RESULT_COUNT was introduced	in bug 1267810 to increase compatibility with Chromium.	It no longer serves this purpose as Chromium has since removed its limit of 6 extension-supplied results.

Differential Revision: https://phabricator.services.mozilla.com/D168891
2023-02-07 20:07:45 +00:00
Noemi Erli
5d094b5e62 Backed out changeset d4b852d0732c (bug 1814980) for causing xpc failures in test_providerOmnibox.js 2023-02-07 17:52:58 +02:00
Gregory Pappas
0341329363 Bug 1814980 - Remove MAX_OMNIBOX_RESULT_COUNT r=adw
MAX_OMNIBOX_RESULT_COUNT was introduced	in bug 1267810 to increase compatibility with Chromium.	It no longer serves this purpose as Chromium has since removed its limit of 6 extension-supplied results.

Differential Revision: https://phabricator.services.mozilla.com/D168891
2023-02-07 14:30:31 +00:00
Drew Willcoxon
347a2b16c4 Bug 1814795 - Support keyword-based weather suggestions in addition to zero-prefix. r=daisuke
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:

```lang=js
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

Differential Revision: https://phabricator.services.mozilla.com/D168757
2023-02-07 02:26:55 +00:00
Dale Harvey
5e2cc8e1ea Bug 1812152 - Add pref to control minimum chars needed to match quickaction. r=daisuke
Differential Revision: https://phabricator.services.mozilla.com/D167713
2023-01-28 23:12:43 +00:00
Daisuke Akatsuka
2fec6541cf Bug 1725045: Remove browser.urlbar.resultGroups pref. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D167889
2023-01-26 23:10:19 +00:00
Daisuke Akatsuka
924d4f7fdf Bug 1791657: Show page title if it is in places. r=adw,mak
Depends on D159243

Differential Revision: https://phabricator.services.mozilla.com/D157891
2023-01-24 22:35:15 +00:00
Mark Banner
a94fe03b9d Bug 1811334 - Automatically replace Cu.reportError with console.error (most of browser/components). r=settings-reviewers,mconley
Differential Revision: https://phabricator.services.mozilla.com/D167297
2023-01-20 17:49:21 +00:00
Mark Banner
8730eec697 Bug 1806359 - Convert telemetry imports to direct ES imports. r=necko-reviewers,application-update-reviewers,pip-reviewers,credential-management-reviewers,janerik,mconley,sgalich,bytesized,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D165002
2022-12-23 12:37:07 +00:00
Daisuke Akatsuka
8785ca1a73 Bug 1804314: Introduce persisted_search_terms_* interaction type. r=mak,jteow
Differential Revision: https://phabricator.services.mozilla.com/D163803
2022-12-19 03:32:17 +00:00
Norisz Fay
bb15619190 Backed out changeset d6454f53dcc0 (bug 1804314) for causing mochitest failures on browser_glean_telemetry CLOSED TREE 2022-12-19 01:40:31 +02:00
Daisuke Akatsuka
67e0f424a6 Bug 1804314: Introduce persisted_search_terms_* interaction type. r=mak,jteow
Differential Revision: https://phabricator.services.mozilla.com/D163803
2022-12-18 22:21:26 +00:00
Daisuke Akatsuka
54dbcd7cc4 Bug 1805112: Make Nimbus experiments allow telemetry recording to be enabled. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D164427
2022-12-13 01:50:51 +00:00
Mark Banner
53ce0faad1 Bug 1804661 - Convert browser/components/BrowserGlue.jsm to an ES module. r=Gijs,settings-reviewers,perftest-reviewers,sparky
Differential Revision: https://phabricator.services.mozilla.com/D164204
2022-12-12 14:59:18 +00:00
Daisuke Akatsuka
bacd5739e1 Bug 1800579: Implement the impression event. r=mak,Dexter
Differential Revision: https://phabricator.services.mozilla.com/D162085
2022-12-07 06:35:50 +00:00
Cristian Tuns
5e33a5679a Backed out 2 changesets (bug 1800579) for causing mochitest failures on browser_glean_telemetry_impression_interaction.js
Backed out changeset 329d79c6403b (bug 1800579)
Backed out changeset 2796c110119d (bug 1800579)
2022-12-06 17:08:20 -05:00
Daisuke Akatsuka
74e3985c9f Bug 1800579: Implement the impression event. r=mak,Dexter
Differential Revision: https://phabricator.services.mozilla.com/D162085
2022-12-06 20:48:39 +00:00
Ryan VanderMeulen
d0bb184374 Backed out changeset af2c13b9fdb7 (bug 1801244) per developer request. 2022-12-05 16:38:55 -05:00
Daisuke Akatsuka
230f26fc24 Bug 1797265: Implement the engagement event. r=mak,adw,Dexter
Differential Revision: https://phabricator.services.mozilla.com/D160193
2022-12-01 12:05:48 +00:00
Hanna Jones
53eab72e81 Bug 1794823 - port site specific search from pine to central r=daleharvey
Some random thoughts:
* This is a minimal implementation - there were plans to expand this with autocomplete support that we never got around to
* I built this just from reading docs + poking around in the urlbar code, so there might be a more desireable way to do all of this
* We've gone back and forth between calling this "contextual search" and "site specific search," we should probably pick a name and stick to it
* There were never any design specs for this so the UI/UX was based off of existing urlbar results as they appeared in Flowstate
* There were some open questions around how we treat installing opensearch engines, since how they are handled here seems to differ from how we use them elsewhere
* I don't remember the reasoning for showing this result last in the urlbar, we may want to move it elsewhere

Differential Revision: https://phabricator.services.mozilla.com/D159052
2022-11-25 15:17:08 +00:00
Drew Willcoxon
72261a2637 Bug 1801244 - Make Merino opt out on Beta. r=daisuke,nanj,RyanVM,chutten
This makes Merino opt out on Beta. There are two different parts:

1. Decide what "Beta" means. After discussing this with RyanVM, I'm using the
   same definition [used by telemetry](https://searchfox.org/mozilla-central/rev/2f47e3dacf0d773e9c7f363cecf10cfbea490679/toolkit/components/telemetry/app/TelemetryControllerBase.jsm#103,112-114): (a) if `MOZ_UPDATE_CHANNEL` is "beta"
   or (b) if it's "release" and `app.update.channel` is "beta". The latter case
   is true for RC builds delivered to the Beta channel. I moved the relevant
   telemetry logic to `AppConstants` so I can easily use it too. Bug 1435753 has
   context on this logic w/r/t telemetry.
2. Change the Merino default so it's enabled on Beta in the offline scenario. I
   kept the online scenario's disabled default since the only point of
   delivering the online scenario to the user now is to prompt them to opt in to
   Merino. This change is in UrlbarPrefs.sys.mjs.

The rest of the patch updates tests.

The effect of this patch will be to use a new default value of true for the
`quicksuggest.dataCollection.enabled` pref on Beta in the offline scenario. If
the user didn't touch the pref at all, then its previous default value was
false, and the new default will now be true.

If the user enabled the pref, it will remain enabled. If the user enabled and
then disabled it, it will remain disabled. That's because the pref is sticky, so
once it has a value on the user branch, it will keep that value. This patch only
changes the value of the pref on the default branch, so it won't override the
user's previous choice since that is set on the user branch.

Differential Revision: https://phabricator.services.mozilla.com/D162353
2022-11-22 06:19:24 +00:00
Dão Gottwald
34298cf8ff Bug 1790019 - Implement placeholder urlbar result menu button and popup. r=mak,fluent-reviewers,flod,jteow
Differential Revision: https://phabricator.services.mozilla.com/D161776
2022-11-18 20:14:46 +00:00
Drew Willcoxon
3e4d34e66f Bug 1799363 - Add weather suggestions to quick suggest. r=daisuke
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](https://mozilla-hub.atlassian.net/browse/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 the following prefs and 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 be able to dismiss the suggestion but not toggle
a checkbox in about:preferences.

* `weatherFeatureGate` - Nimbus variable that controls the whole feature
* `browser.urlbar.weather.featureGate` - Fallback pref for the Nimbus variable
* `browser.urlbar.suggest.weather` - When the feature gate pref is true, this
  determines whether the suggestion should be shown. In a future patch, we'll
  flip this to false when users dismiss the suggestion.

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

Differential Revision: https://phabricator.services.mozilla.com/D161410
2022-11-17 05:04:07 +00:00
Cristian Tuns
507af1ad06 Backed out changeset 053963c15ffe (bug 1799363) for causing xpcshell failures on test_weather.js CLOSED TREE 2022-11-16 14:00:59 -05:00
Drew Willcoxon
1b1cc4ae78 Bug 1799363 - Add weather suggestions to quick suggest. r=daisuke
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](https://mozilla-hub.atlassian.net/browse/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 the following prefs and 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 be able to dismiss the suggestion but not toggle
a checkbox in about:preferences.

* `weatherFeatureGate` - Nimbus variable that controls the whole feature
* `browser.urlbar.weather.featureGate` - Fallback pref for the Nimbus variable
* `browser.urlbar.suggest.weather` - When the feature gate pref is true, this
  determines whether the suggestion should be shown. In a future patch, we'll
  flip this to false when users dismiss the suggestion.

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

Differential Revision: https://phabricator.services.mozilla.com/D161410
2022-11-16 17:59:23 +00:00
James Teow
9ae4091c21 Bug 1798793 - Add search tip message for showSearchTerms feature - r=adw,fluent-reviewers,flod
The showSearchTerms feature has a search tip that should appear
on the users default search engine results page.

The design and copy for the feature are in this Figma file:
https://www.figma.com/file/Ock0cYjzi7I1GmcctqOr9K/Search-settings-updates?node-id=352%3A9183

Differential Revision: https://phabricator.services.mozilla.com/D161186
2022-11-09 18:36:08 +00:00
James Teow
506f3df459 Bug 1779470 - Part 1: Add Nimbus variable, feature gate preference, and rename showSearchTerms prefs - r=adw
Differential Revision: https://phabricator.services.mozilla.com/D159462
2022-11-05 02:13:28 +00:00
Drew Willcoxon
2743a9059e Bug 1798595 - Refactor quick suggest [Part 5]: Move remote settings code into QuickSuggestRemoteSettingsClient and initialization into QuickSuggest. r=daisuke
This does the following:

* Moves quick suggest initialization from UrlbarQuickSuggest to QuickSuggest
* Renames UrlbarQuickSuggest.sys.mjs to QuickSuggestRemoteSettingsClient.sys.mjs, so now this file is focused only on remote settings
* Makes QuickSuggest create an instance of QuickSuggestRemoteSettingsClient and keep it as `QuickSuggest.remoteSettings`
* Moves latency telemetry from UrlbarProviderQuickSuggest into QuickSuggestRemoteSettingsClient
* Changes the ad hoc logger used in QuickSuggestRemoteSettingsClient to a proper urlbar-style logger
* Updates consumers to use `QuickSuggest.remoteSettings` instead of UrlbarQuickSuggest

Please see bug 1798595 for details.

Depends on D160985

Differential Revision: https://phabricator.services.mozilla.com/D160986
2022-11-02 06:50:15 +00:00
James Teow
cffef4a42e Bug 1779471 - Rename pref and add telemetry for persistent search term searches - r=adw,Standard8
Differential Revision: https://phabricator.services.mozilla.com/D156706
2022-10-27 15:53:11 +00:00
trickypr
939b06a162 Bug 1510561 - Part 7: Apply plugin:mozilla/require-jsdoc to browser/components/urlbar. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D159472
2022-10-24 13:32:38 +00:00
trickypr
ae73626d5e Bug 1510561 - Part 6: Apply plugin:mozilla/valid-jsdoc to browser/components/urlbar. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D159471
2022-10-24 13:32:37 +00:00
Drew Willcoxon
dde6d73a30 Bug 1796202 - Make Firefox Suggest wait for TelemetryEnvironment initialization before updating the scenario prefs. r=daisuke,chutten
This reverts the fix to bug 1731373 and instead makes Firefox Suggest wait for
TelemetryEnvironment to finish initializing before it starts to update its
preferences. That's what I should have done in the first place, no need for an
observer notification or for TelemetryEnvironment to have to know any details
about Suggest prefs.

This fixes the bug (bug 1796202) and should also avoid the problem for any other
Suggest prefs we add to TelemetryEnvironment in the future.

Differential Revision: https://phabricator.services.mozilla.com/D159820
2022-10-20 22:22:07 +00:00
Mark Banner
a9ba6e830d Bug 1792398 - Enable ESLint rule 'strict' on mjs files as the directive is not necessary for modules. r=arai,pip-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D158115
2022-09-26 21:47:50 +00:00
Marian-Vasile Laza
130adc5d9a Backed out changeset 0679274d6ed5 (bug 1792398) for causing bc failures on browser_sendQuery.js. CLOSED TREE 2022-09-26 22:53:00 +03:00
Mark Banner
3e99025d45 Bug 1792398 - Enable ESLint rule 'strict' on mjs files as the directive is not necessary for modules. r=arai,pip-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D158115
2022-09-26 18:51:57 +00:00
Narcis Beleuzu
6c2d0d8cea Backed out changeset 849faf753208 (bug 1792398) for bc failures on browser_sendQuery.js . CLOSED TREE 2022-09-26 20:44:40 +03:00
Mark Banner
05dcda5a7f Bug 1792398 - Enable ESLint rule 'strict' on mjs files as the directive is not necessary for modules. r=arai,pip-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D158115
2022-09-26 16:51:10 +00:00
Shane Hughes
cdbf03e2df Bug 1789644 - Add a pref toggle for QuickActions, separate from the pref for suggestions. r=mak,daleharvey
Change the behavior of the QuickActions provider, so that setting the
pref `quickactions.enabled` to false will prevent showing quick action
results in all contexts, while setting `suggest.quickactions` to false
will only prevent showing quick action results in the default search
mode (i.e., quick action results will still appear in the Quick Actions
search mode enabled by typing `> ` in the urlbar).

Differential Revision: https://phabricator.services.mozilla.com/D157702
2022-09-24 00:00:46 +00:00
Jonathan Sudiaman
c27b002b63 Bug 1790758 - Convert Region.jsm and IgnoreLists.jsm JSM modules to ESMs r=Standard8,preferences-reviewers,credential-management-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D157337
2022-09-20 12:21:45 +00:00
Daisuke Akatsuka
1344c36fd5 Bug 1789635: Hide QuickActions by pref when in zero-prefix. r=daleharvey
Differential Revision: https://phabricator.services.mozilla.com/D156769
2022-09-11 22:58:54 +00:00
James Teow
06733cd8cd Bug 1779467 - Don't show search term if search bar is enabled - r=adw
Differential Revision: https://phabricator.services.mozilla.com/D156566
2022-09-06 20:39:12 +00:00