Commit Graph

2303 Commits

Author SHA1 Message Date
Daisuke Akatsuka
d82f055d58 Bug 1800414: Implement the abandonment event. r=mak,Dexter
Differential Revision: https://phabricator.services.mozilla.com/D161977
2022-12-01 23:37:32 +00:00
Cristian Tuns
9796804d31 Backed out changeset b4f24df08c5a (bug 1802564) for causing bc failures on browser_glean_telemetry_engagement_interaction.js CLOSED TREE 2022-12-01 20:24:11 -05:00
James Teow
c0621f6f3d Bug 1802564 - Toggle showSearchTerms to true on Nightly - r=adw
Differential Revision: https://phabricator.services.mozilla.com/D163221
2022-12-01 23:06:14 +00:00
Greg Tatum
44df4b67a8 Bug 1685180 - Remove test case for missing l10n args; r=nordzilla
Differential Revision: https://phabricator.services.mozilla.com/D162597
2022-12-01 21:40:57 +00:00
Daisuke Akatsuka
238cee7905 Bug 1797265: Make user event fired while opening urlbar result by empty string be the target for interaction. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D162184
2022-12-01 12:05:49 +00:00
Daisuke Akatsuka
f12f72c9eb 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
James Teow
32bfb2a7b9 Bug 1801602 - Enable showSearchTerms to check contextmenu purpose - r=adw,Standard8
Differential Revision: https://phabricator.services.mozilla.com/D162730
2022-11-30 17:42:10 +00:00
Mark Banner
319bc25bd8 Bug 1802855 - Convert toolkit/components/satchel JSM modules to ES modules. r=credential-management-reviewers,daleharvey,sgalich
Differential Revision: https://phabricator.services.mozilla.com/D163201
2022-11-29 15:53:20 +00:00
Dale Harvey
b7f4d86bb1 Bug 1800630 - Don't show top pick result if heuristic url matches. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D162100
2022-11-28 11:50:08 +00:00
Barret Rennie
d1a2566d45 Bug 1541508 - Use Services.env in browser/ r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D160136
2022-11-25 19:09:06 +00:00
Hanna Jones
f147294407 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
André Bargull
217323399b Bug 1792775 - Part 11.1: Update expected test results in non-SpiderMonkey files. r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D162707
2022-11-23 17:56:18 +00:00
Noemi Erli
398b046f39 Backed out 16 changesets (bug 1792775) for causing build bustage in TestDateIntervalFormat.cpp CLOSED TREE
Backed out changeset 240681aef215 (bug 1792775)
Backed out changeset e15aea6bb46b (bug 1792775)
Backed out changeset ee9cd4c8d5cd (bug 1792775)
Backed out changeset 0be61a39756f (bug 1792775)
Backed out changeset 7db4fb376f48 (bug 1792775)
Backed out changeset 7009b35a05a0 (bug 1792775)
Backed out changeset 5abc2704004e (bug 1792775)
Backed out changeset 6d76fe50cf35 (bug 1792775)
Backed out changeset d6300cbbf628 (bug 1792775)
Backed out changeset 8f5e0e60d195 (bug 1792775)
Backed out changeset 0b9cf0354dc0 (bug 1792775)
Backed out changeset 7136c85641b7 (bug 1792775)
Backed out changeset 486778427d64 (bug 1792775)
Backed out changeset 7acee89c2699 (bug 1792775)
Backed out changeset 654c5f659fed (bug 1792775)
Backed out changeset a60b1bc33f91 (bug 1792775)
2022-11-23 17:18:45 +02:00
André Bargull
9c9cd8c877 Bug 1792775 - Part 11.1: Update expected test results in non-SpiderMonkey files. r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D162707
2022-11-23 10:42:45 +00:00
Noemi Erli
fd271d3cc2 Backed out 13 changesets (bug 1792775) for causing bustages
Backed out changeset f2c8e2200194 (bug 1792775)
Backed out changeset 3392ce042fb6 (bug 1792775)
Backed out changeset f5461baa7c5a (bug 1792775)
Backed out changeset d810c2b2d0bd (bug 1792775)
Backed out changeset af6164024ade (bug 1792775)
Backed out changeset 8c97026ef2b5 (bug 1792775)
Backed out changeset d396bec29ac2 (bug 1792775)
Backed out changeset a9aaa2387313 (bug 1792775)
Backed out changeset a4461db138b7 (bug 1792775)
Backed out changeset a7b39a5105a9 (bug 1792775)
Backed out changeset 5e746d85926a (bug 1792775)
Backed out changeset 3ea531c10813 (bug 1792775)
Backed out changeset 78811cdadd63 (bug 1792775)
2022-11-23 11:48:28 +02:00
André Bargull
713dee40bc Bug 1792775 - Part 11.1: Update expected test results in non-SpiderMonkey files. r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D162707
2022-11-23 08:43:23 +00:00
Drew Willcoxon
73c6ffb1df 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
Daisuke Akatsuka
610dab81e1 Bug 1800380: Unselect the selected element after pickElement(). r=adw
Differential Revision: https://phabricator.services.mozilla.com/D162354
2022-11-22 00:31:28 +00:00
Drew Willcoxon
781efa50cb Bug 1799582 - Fix intermittent failure in test_merinoClient.js. r=daisuke
The test sometimes receives zero Merino suggestions when it expects some. I
noticed a few potential problems:

1. The `merino.timeoutMs` pref keeps its default value of 200ms throughout most
   of the test. That's low enough that it might cause the client to time out
   waiting for Merino, especially on slow machines in verify mode. To fix that,
   I set the timeout pref to a large value at the start of the test.
2. The Merino test server should probably cancel its delayed-response timers
   when `reset()` is called on it. Otherwise the server will still send
   responses once the timers elapse, which might interfere with later tasks.
3. I'm not sure about this, but the test server's `#handleRequest()` method
   probably shouldn't be async. Right now it's async to handle sending delayed
   responses. This patch makes it sync and it just handles that using a `then()`
   instead.

[Retriggers on try](https://treeherder.mozilla.org/jobs?repo=try&revision=e8ba8f1d05d2a701498bd9fe6a69fd88ba74eb37) are green.

Differential Revision: https://phabricator.services.mozilla.com/D162480
2022-11-21 21:31:08 +00:00
scott
35e4f02b0f Bug 1798956 - Pocket newtab ensure we clear spocs in cases where sponsored topsites applies to Pocket data. r=nanj
Differential Revision: https://phabricator.services.mozilla.com/D162028
2022-11-21 20:24:29 +00:00
Drew Willcoxon
eae5f42eb4 Bug 1781913 - Fix intermittent failure in browser_quicksuggest_telemetry.js. r=dao
This task was added in D161866 and it fails because sometimes this happens in
the view:

1. The row count is 19 and the last row is not the quick suggest
2. Then the quick suggest row gets added, so the row count is 20

That makes the mutation promise hang because it expects the row count to be 19
when the quick suggest row is added last.

This patch makes the mutation listener wait for the quick suggest row to simply
be added instead of assuming it's the last row during a certain row count. It
also removes some checks that aren't necessary to test the thing this task is
testing and that are also susceptible to races.

[Retriggers on try](https://treeherder.mozilla.org/jobs?repo=try&revision=15b1943e76a08174e4fad28675348e9d12428483) are green.

Differential Revision: https://phabricator.services.mozilla.com/D162479
2022-11-21 17:59:19 +00:00
Dão Gottwald
f745f36b17 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
Dan Robertson
a2f5784df5 Bug 1796690 - Update urlbar text overflow direction calculation. r=mak
Update the urlbar text overflow direction calculation after recent scrollend
changes do not result in scrollend events fired for scrolls that do not change
the scroll position.

Depends on D160156

Differential Revision: https://phabricator.services.mozilla.com/D161846
2022-11-18 15:12:10 +00:00
Mark Banner
11b4005c4f Bug 1791974 - Use setAsDefault* parameters where appropriate for consumers of SearchTestUtils.installSearchExtension. r=mcheang
Differential Revision: https://phabricator.services.mozilla.com/D161045
2022-11-18 14:30:27 +00:00
Mark Banner
3478c2cc33 Bug 1791974 - Add set as default (private) search engine options to SearchTestUtils.installSearchExtension. r=mcheang
and convert existing would-be-broken consumers to use the new format arguments

Differential Revision: https://phabricator.services.mozilla.com/D161044
2022-11-18 14:30:27 +00:00
Mark Banner
9181f205be Bug 1791974 - Add set as default (private) search engine options to SearchTestUtils.promiseNewSearchEngine. r=mcheang
Differential Revision: https://phabricator.services.mozilla.com/D161043
2022-11-18 14:30:26 +00:00
Mark Banner
5d1820b074 Bug 1799314 - Convert consumers of testing modules to import ES modules direct (browser/). r=Gijs,settings-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D161914
2022-11-17 12:00:30 +00:00
Drew Willcoxon
26a76fee34 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
8339eb2abf Backed out 3 changesets (bug 1796690) for causing mochitest failures on browser_primaryUI.js CLOSED TREE
Backed out changeset 28f9e04d3500 (bug 1796690)
Backed out changeset 70903d77e4f0 (bug 1796690)
Backed out changeset 66ddf8488393 (bug 1796690)
2022-11-16 18:22:14 -05:00
Drew Willcoxon
05db5ab826 Bug 1800810 - Always record visible quick suggest results in engagement telemetry. r=dao
This is a follow up to D161866 and effectively reverts and replaces it with a
different approach. Please see bug 1800810 for background. In short, engagement
telemetry should be based on the result that's visible in the view, not on the
result the provider added last.

D161866 fixed the case where the last-added result is in the view but hidden.
There's another case we need to handle, when the last-added result is not in the
view at all. That can happen when you type something and hit enter really
quickly, before the view can update. I was able to trigger it several times.
When that happens, there are two possibilities:

* No quick suggest result is visible in the view. `result.rowIndex` is its
  initial value of -1, so we record an engagement for a result that is not
  visible and that doesn't have a valid index.

* A quick suggest result from a previous query is visible in the view. Here
  again, `result.rowIndex` is -1 so we record an engagement for a result that is
  not visible and that doesn't have a valid index, and we miss recording an
  engagement for the result that's actually visible.

Right now it's not easy to fix this inside the provider because providers don't
know anything about the view(s). I could record this telemetry in the view but
that's not its role. I think it makes sense to include the view in the query
context, so that's what this does. I added `view.visibleResults` to make getting
the visible results easy.

Daisuke's new Glean telemetry in D160193 uses `context.results`, which has this
same problem of not being based on actually visible results. We'll need to use
`context.view.visibleResults` there too, and there may be other existing cases
as well.

Depends on D161866

Differential Revision: https://phabricator.services.mozilla.com/D162182
2022-11-16 21:47:55 +00:00
Cristian Tuns
0fdc1821ce 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
48330effac 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
Dan Robertson
36a5c7cc40 Bug 1796690 - Update urlbar text overflow direction calculation. r=mak
Update the urlbar text overflow direction calculation after recent scrollend
changes do not result in scrollend events fired for scrolls that do not change
the scroll position.

Depends on D160156

Differential Revision: https://phabricator.services.mozilla.com/D161846
2022-11-16 16:52:24 +00:00
Drew Willcoxon
843f50bea3 Bug 1800184 - Don't record quick suggest impression telemetry when the result is hidden. r=dao
This adds `result.isVisible`. Like `rowIndex`, it's updated by the view.
UrlbarProviderQuickSuggest will skip impression telemetry updates (and
impression stats updates too) when it's false.

Please see bug 1800184 for background.

Differential Revision: https://phabricator.services.mozilla.com/D161866
2022-11-15 17:05:22 +00:00
James Teow
360cac2f50 Bug 1799981 - Prevent persist search tip from being shown on non-SERP tabs - r=adw
Differential Revision: https://phabricator.services.mozilla.com/D161754
2022-11-11 17:02:16 +00:00
Dão Gottwald
5a55b1899a Bug 1799847 - Make UrlbarView.removeStaleRowsTimeout a static property. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D161671
2022-11-10 11:27:04 +00:00
Rob Lemley
fb892b5667 Bug 1797888 - Relocate AppUpdater.jsm to toolkit/mozapps/update. r=nalexander,application-update-reviewers,bytesized
Thunderbird now has an identical copy of AppUpdater.jsm in its repository. Moving it into
toolkit will make ongoing maintenance easier.

Differential Revision: https://phabricator.services.mozilla.com/D161718
2022-11-09 23:01:00 +00:00
James Teow
d6dddd38a9 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
Mark Banner
56d933d059 Bug 1702180 - Remove obsolete search SERP telemetry probes. r=scunnane
Differential Revision: https://phabricator.services.mozilla.com/D161563
2022-11-09 08:06:45 +00:00
James Teow
8d6edc1636 Bug 1799650 - Modify getSearchTermIfDefaultSerpUri to allow string input and not throw when passed about protocols - r=adw
Differential Revision: https://phabricator.services.mozilla.com/D161612
2022-11-08 21:43:56 +00:00
Ben Hearsum
27a4fed094 Bug 1797010: default private window feature to UrlbarInput.isPrivate r=adw
Differential Revision: https://phabricator.services.mozilla.com/D160103
2022-11-08 21:31:12 +00:00
Dão Gottwald
2a5b80b660 Bug 1798917 - Convert pseudo-private UrlbarView properties and methods to be truly private. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D161143
2022-11-08 16:57:20 +00:00
Dão Gottwald
94b7b01783 Bug 1798880 - Mark UrlbarView::getClosestSelectableElement as private. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D161121
2022-11-08 16:37:54 +00:00
Dale Harvey
f3224cf163 Bug 1797328 - Handle 'is_top_pick' being defined in merino results. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D160240
2022-11-08 11:03:42 +00:00
Drew Willcoxon
3a896d5ba4 Bug 1799264 - Refactor QuickSuggest features [Part 3]: Port the remote settings client to BaseFeature. r=daisuke
This ports the remote settings client to `BaseFeature`.

The remote settings client is different from the other two features I ported in
this patch stack because it depends on preferences, not Nimbus variables:
`suggest.quicksuggest.sponsored` and `suggest.quicksuggest.nonsponsored`. To
support that, I modified `BaseFeature` so it can list the prefs it depends
on. When QuickSuggest observes a pref change, it checks whether it's a pref for
a feature, and if so, it updates it.

Please see bug 1799264 for details.

Depends on D161367

Differential Revision: https://phabricator.services.mozilla.com/D161368
2022-11-08 05:42:10 +00:00
Drew Willcoxon
9c36ab2fc3 Bug 1799264 - Refactor QuickSuggest features [Part 2]: Port blocked suggestions to BaseFeature. r=daisuke
This ports blocked suggestions to `BaseFeature`.

Please see bug 1799264 for details.

Depends on D161366

Differential Revision: https://phabricator.services.mozilla.com/D161367
2022-11-08 05:42:09 +00:00
Drew Willcoxon
3871ea4423 Bug 1799264 - Refactor QuickSuggest features [Part 1]: Add BaseFeature and port impression caps to it. r=daisuke
This adds a new `BaseFeature` class that quick suggest features can extend.
`BaseFeature` encapsulates the logic for deciding whether a feature should be
enabled. Subclasses override a few methods and getters to describe their own
logic and to do initialization and uninitialization.

Any time a Nimbus variable (or a variable fallback pref) changes, QuickSuggest
iterates over each feature and enables or disables it appropriately.

As a first step, I ported impression caps to `BaseFeature`. Later patches in
this stack will port other features.

Please see bug 1799264 for details.

Differential Revision: https://phabricator.services.mozilla.com/D161366
2022-11-08 05:42:09 +00:00
Drew Willcoxon
21a047b345 Bug 1799265 - Add a name, configurable timeout, and more logging to MerinoClient. r=daisuke
This adds a new `name` property to MerinoClient that's included in log
messages. That makes it easier to understand logs when there's more than one
client, as there will be since the new weather feature will use its own. This
also adds more logging.

It also adds a timeout param to `fetch()`. The param overrides the timeout pref.
The weather MerinoClient will use a custom timeout.

Differential Revision: https://phabricator.services.mozilla.com/D161369
2022-11-08 02:13:00 +00:00
James Teow
374baa5f1d Bug 1798938 - Move getSearchTermIfDefaultSerp helper into a common place - r=adw
Differential Revision: https://phabricator.services.mozilla.com/D161458
2022-11-07 22:00:22 +00:00
James Teow
12cf092287 Bug 1798912 - Add showSearchTerms.enabled to TelemetryEnvironment - r=adw
Differential Revision: https://phabricator.services.mozilla.com/D161373
2022-11-07 21:53:44 +00:00