Commit Graph

192 Commits

Author SHA1 Message Date
Drew Willcoxon
aa56c40785 Bug 1926381 - Integrate MLSuggest with UrlbarProviderQuickSuggest and implement Yelp ML suggestions. r=daisuke
This adds a new Suggest backend for ML-based suggestions called
`SuggestBackendMl`. Before, with the JS and Rust backends, only one backend was
enabled at a time, but both the ML and Rust backends can be enabled at the same
time since we will want to serve suggestions from both for the foreseeable
future. Features can support ML suggestions by implementing the new
`BaseFeature.mlIntent` getter and handling ML suggestions in `makeResult()`.
Each feature can decide whether it supports ML suggestions and whether they
should be preferred over Rust suggestions.

I've updated the Yelp feature to hook into this, since Yelp suggestions are
supported by the ML model that Chidam is working on. If ML is enabled, then the
feature will only serve ML suggestions. I'm not sure if that's what we want long
term, but for now that will make it clear to people which backend is being used
while we develop this feature.

The `quickSuggestMlEnabled` variable/pref determines whether the ML backend is
enabled. The `yelpMlEnabled` variable/pref determines whether Yelp ML
suggestions are enabled. We can create similar variable/prefs for each feature
that supports ML suggestions so that they can be toggled independently of each
other.

Other changes:

Move the `is_sponsored` logic out of the Rust backend and into the provider.
Otherwise it would need to be duplicated in the ML backend too.

Depends on D224523

Differential Revision: https://phabricator.services.mozilla.com/D226736
2024-10-24 09:52:00 +00:00
Chidam Gopal
3b89ccb50a Bug 1922591 - MLSuggest for yelp, weather intent classification and NER location r=adw DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D224523
2024-10-23 20:40:18 +00:00
Drew Willcoxon
cbbe362eed Bug 1925734 - Remove UrlbarProviderWeather, the weatherKeywords Nimbus variable, and JS-backend support for weather suggestions. r=daisuke
Depends on D225051

Differential Revision: https://phabricator.services.mozilla.com/D226214
2024-10-22 01:59:13 +00:00
Collin Richards
7b80019694 Bug 1086524 - Focus window on Esc in address bar r=dao,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D218893
2024-10-17 11:56:34 +00:00
Cosmin Sabou
73e2568ce9 Backed out changeset c3560df7c73f (bug 1086524) for causing bc failures on browser_searchModeSwitcher_basic. 2024-10-17 00:49:27 +03:00
Collin Richards
4c5cad9017 Bug 1086524 - Focus window on Esc in address bar r=dao,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D218893
2024-10-16 15:55:01 +00:00
Adi
7d671034f6 Backed out changeset c03123359b41 (bug 1086524) for causing browser_persist_searchMode.js failures. CLOSED TREE 2024-10-16 16:54:55 +03:00
Collin Richards
9f857b20cb Bug 1086524 - Focus window on Esc in address bar r=dao,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D218893
2024-10-16 11:47:11 +00:00
Dale Harvey
03e5396a93 Bug 1924661 - Remove contextual search from being enabled with ScotchBonnet. r=daisuke,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D225621
2024-10-16 11:46:55 +00:00
Moritz Beier
1bcaefc14e Bug 1389229 - Deduplicate urlbar history results that only differ by their URL fragment. r=mak,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D222672
2024-10-11 07:18:04 +00:00
Dale Harvey
be347dbe5e Bug 1921323 - Add new pref to handle persistant search mode. r=daisuke,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D224055
2024-10-01 10:25:43 +00:00
Dale Harvey
522658f297 Bug 1918437 - Disable secondary actions based switch to tab. r=daisuke,desktop-theme-reviewers,urlbar-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D223704
2024-09-30 22:10:48 +00:00
Drew Willcoxon
82a6053f4b No bug - SNG-1837 - Stop pre-fetching the urlbar weather suggestion. r=daisuke
This also removes VPN detection. That was only really necessary back when the
weather suggestion was zero-prefix, i.e., when it was shown simply by clicking
in the urlbar without typing anything. I think if you go to the trouble of
typing a weather keyword, we should show you the suggestion even if you're on a
VPN.

Differential Revision: https://phabricator.services.mozilla.com/D223874
2024-09-27 01:59:28 +00:00
Drew Willcoxon
405e2eb591 Bug 1918307 - Allow keyword exposures to be recorded for a subset of exposure results. r=mak
Depends on D221912

Differential Revision: https://phabricator.services.mozilla.com/D221916
2024-09-12 23:45:42 +00:00
Drew Willcoxon
333d2a9ac1 Bug 1915766 - Add a Nimbus variable that hides the Suggest UI. r=daisuke,settings-reviewers,mossop
This makes `browser_search_firefoxSuggest.js` more realistic by installing a
Nimbus experiment to change the Suggest scenario instead of manually setting the
scenario via the helper function. (The "scenario" just means whether Suggest is
enabled or not, basically. "history" means it's not enabled; "offline" and
"online" mean it's enabled. The difference between the latter two is that in
"online" the user has opted in to the Merino server, and that only means one of
the Suggest prefs is true instead of false.)

I noticed `browser_privacy_firefoxSuggest.js` does not check the visibility of
its Suggest section at all, so I added similar tasks to it and factored out the
common helpers into `head.js`.

Depends on D221097

Differential Revision: https://phabricator.services.mozilla.com/D221099
2024-09-11 19:40:01 +00:00
Drew Willcoxon
8c6acb1e3d Bug 1916873 - Allow Suggest to be safely enabled in non-Suggest locales. r=daisuke,settings-reviewers,mossop
In addition to addressing the bug, this also adds some exposure tests to make
sure that they can be triggered in non-Suggest locales and that non-exposure
suggestions are not triggered.

Depends on D220501

Differential Revision: https://phabricator.services.mozilla.com/D221097
2024-09-11 19:39:59 +00:00
Drew Willcoxon
34a4542ebe Bug 1915507 - Replace potential exposures with keyword exposures. r=mak
This replaces the current potential exposures implementation with "keyword
exposures." The current implementation is based on a keyword list defined in
Nimbus. Keyword exposures improve on the following drawbacks to that approach:

* Potential exposures can't be recorded for existing result types without
  duplicating their keywords in the Nimbus list. The ability to record potential
  exposures for existing types is an idea from DS (Dave).
* They're unrelated to `exposure` telemetry, so we don't get an `exposure` event
  for them in the main ping, making it hard to correlate them with engagements
  and abandonments. This is another drawback pointed out by DS (Dave). (By
  design, we don't want to correlate individual keywords with
  engagements/abandonments for privacy reasons, but we do want to know whether a
  potential exposure was triggered during an engagement/abandonment without
  knowing the matching keywords.)
* Storing the keywords in Nimbus means the Nimbus recipe is at least as large as
  the keyword list. It's probably not a great idea to put thousands of keywords
  in the recipe JSON.
* The keyword-matching strategy is simplistic exact matching. It can't do more
  sophisticated strategies used for real results, like how we recently started
  using FTS in Suggest.

Keyword exposures as implemented by this revision improve on all that. Summary:

* Keyword exposures are implemented on top of existing `exposure` telemetry.
  They can be enabled for any result type, and they are always "in addition to"
  `exposure` telemetry.
* They're enabled with a new bool Nimbus variable. When true, they're recorded
  for all results that trigger `exposure` telemetry.
* They work with the new `Exposure` Rust suggestions (bug 1915317, bug 1893086,
  result type "rust_exposure"). In combination, `Exposure` suggestions and
  keyword exposures are the new way to do "potential exposures," i.e., exposure
  telemetry for hypothetical suggestions that includes matching keywords. Like
  every other Rust suggestion type, `Exposure` suggestions take their keywords
  from remote settings and can do sophisticated matching.

Other changes in this revision:

* Keyword exposures are recorded on each instance of a matched result. With the
  current approach, potential exposures are recorded per unique matched keyword.
  That gives us more info. I cleared this idea with Dave.
* Properly detect `terminal` cases by comparing the final query context with the
  context at the time of the exposure. The current detection is wrong because
  it's only based on search strings, which doesn't work because the final search
  string could also have been typed earlier in the session.
* In the feature manifest, change the branch of the related `setPref` variables
  from `default` to `user`. When an experiment is uninstalled, the Nimbus client
  [does *not* restore previous defaults](https://searchfox.org/mozilla-central/rev/446ff34da077a31d5550359480cb327f729c027b/toolkit/components/normandy/lib/PrefUtils.sys.mjs#119) for prefs set on the default branch. That
  breaks some of the tests and also doesn't seem good for users.

Differential Revision: https://phabricator.services.mozilla.com/D220501
2024-09-11 04:47:52 +00:00
Drew Willcoxon
247ce81e9b Bug 1915317 - Integrate Rust exposure suggestions with desktop. r=daisuke
This integrates Rust exposure suggestions with desktop. Exposure suggestions are
a part of the replacement for the existing potential exposures feature
(bug 1881875). When we want to test potential exposures in the future, we can
add new exposure suggestions to remote settings and tell the Rust component to
ingest them and return them in queries. When the Rust component returns an
exposure suggestion, desktop will record it in exposure telemetry. (The other
part of the replacement is keyword exposure telemetry in bug 1915507 D220501).

More details about the design of exposure suggestions here:

* Bug 1893086
* https://github.com/mozilla/application-services/pull/6343

The way desktop tells the Rust component about different types of exposure
suggestions is through the new "provider constraints" feature. `ingest()` and
`query()` can take a `SuggestionProviderConstraints` object that changes what's
ingested and queried. Therefore, we need to re-ingest exposure suggestions when
the provider constraints change. Right now, exposure suggestions are the only
kind of suggestions that use provider constraints.

Depends on D220359

Differential Revision: https://phabricator.services.mozilla.com/D220359
2024-09-06 04:30:20 +00:00
Drew Willcoxon
26cdd4f115 Bug 1914542 - Replace UrlbarResult.exposureResultType and exposureResultHidden with a single simple value. r=mak
This replaces `UrlbarResult.exposureResultType` and `exposureResultHidden` with
a single simple value called `exposureTelemetry`. Please see the bug for the
rationale.

Other changes:

* For convenience, make `UrlbarPrefs.get("exposureResults")` return a `Set` so
  consumers don't have to parse the string value.
* Simplify handling of result properties in `check_results()` (xpcshell tests)
* Add more tasks/checks to test_exposure.js

Depends on D219939

Differential Revision: https://phabricator.services.mozilla.com/D219942
2024-08-27 20:12:55 +00:00
Dale Harvey
9addf821be Bug 1907147 - Restore Actions search mode. r=desktop-theme-reviewers,urlbar-reviewers,fluent-reviewers,daisuke,dao,settings-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D216518
2024-08-22 16:18:57 +00:00
Drew Willcoxon
eeabfdc62a Bug 1913507 - Add capability to show AMP suggestions as top picks based on keyword character counts. r=daisuke,fluent-reviewers,flod
Depends on D219369

Differential Revision: https://phabricator.services.mozilla.com/D219370
2024-08-20 05:57:40 +00:00
mcheang
f9e8516afa Bug 1912045 - Autofill for intuitive search keywords. r=daleharvey,urlbar-reviewers,mak
**Description**
- Add autofill functionality to UrlbarProvider Restrict Keywords.

**Acceptance Criteria**
- There are 3 restrict keywords `@history`, `@bookmarks`, and `@tabs`
- When the user types @ followed by the beginning of the search keyword: `@h`, `@hi`, `@his`, `@hist` etc. the user should be able to autofill the rest of the search by pressing tab
- The autofill should highlight the typed letters from the user, and show the entire keyword following what the user typed. For example:
- If the user typed `@hist` , autofill should highlight what the user typed and show the rest of the keyword `@history`:

**Example steps to test `@history` :**
- set `browser.urlbar.searchRestrictKeywords.featureGate` to true
- type out the full keyword and space `@history` , address bar should show results panel with history results
- type `@h` and press right arrow, shows results panel with history results
- type `@h` and press enter, shows results panel with history results
- type `@h` and press tab, does not show panel but selects the history restrict result. When the user starts typing, it will search their history and show results panel with history results

Differential Revision: https://phabricator.services.mozilla.com/D218742
2024-08-18 17:51:37 +00:00
Iulian Moraru
4371796885 Backed out changeset c052f2639595 (bug 1086524) for causing multiple browser failures related to urlbar. CLOSED TREE 2024-08-13 12:44:56 +03:00
Collin Richards
ba7657463c Bug 1086524 - Focus window on Esc in address bar r=dao,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D218893
2024-08-13 08:36:51 +00:00
Drew Willcoxon
b93325ad71 Bug 1909565 - Move Fakespot suggestions to the bottom of the Firefox Suggest section, r=daisuke
This also adds a Nimbus variable so we can easily change the index for
experiments.

Depends on D217510

Differential Revision: https://phabricator.services.mozilla.com/D217524
2024-07-24 00:18:11 +00:00
Drew Willcoxon
b665eba613 Bug 1909563 - Set the default Fakespot min keyword length threshold to 4. r=daisuke
Differential Revision: https://phabricator.services.mozilla.com/D217510
2024-07-24 00:18:10 +00:00
Moritz Beier
650113020b Bug 1863530 - Remove browser.search.widget.inNavBar pref. r=dao,settings-reviewers,search-reviewers,omc-reviewers,urlbar-reviewers,Gijs,aminomancer
Differential Revision: https://phabricator.services.mozilla.com/D215607
2024-07-23 17:29:00 +00:00
mcheang
934e5f7581 Bug 1902537 - Create UrlbarProviderRestrictKeywords to show localized bookmarks, history, and tabs restrict keywords results. r=mak,settings-reviewers,urlbar-reviewers
This patch includes:
- A new UrlbarProviderRestrictKeywords class
- Showing localized Search with Bookmarks, Search with History, Search with Tabs results after the user types @
- Add search restrict keywords to preferences UI Search Shortcuts table
- Hiding search restrict keyword behind browser.urlbar.searchRestrictKeywords.featureGate pref

Differential Revision: https://phabricator.services.mozilla.com/D213697
2024-07-19 23:45:58 +00:00
Daisuke Akatsuka
178597f16b Bug 1907878: Put Pocket suggestions at bottom as default r=adw
Differential Revision: https://phabricator.services.mozilla.com/D216627
2024-07-16 03:32:14 +00:00
Drew Willcoxon
717228253c Bug 1905464 - Implement Fakespot suggestions result menu. r=daisuke,fluent-reviewers,flod
This builds on the UI patch in D212647 and implements the Fakespot result menu.
We may need to tweak the min-keyword-length logic once Ben's Rust work is done
and vendored.

Depends on D212647

Differential Revision: https://phabricator.services.mozilla.com/D215273
2024-07-11 04:34:26 +00:00
Daisuke Akatsuka
f175efc393 Bug 1900497: Implement Fakespot Suggestion UI r=desktop-theme-reviewers,fluent-reviewers,flod,dao,urlbar-reviewers,adw
Differential Revision: https://phabricator.services.mozilla.com/D212647
2024-07-10 16:42:49 +00:00
Drew Willcoxon
6d0d1ba5c9 Bug 1906185 - Enable Yelp suggestions by default in the Firefox Suggest section for the Suggest population. r=daisuke,urlbar-reviewers
This is the relevant branch config (non-top-pick) from [the final Yelp v3 experiment](https://experimenter.services.mozilla.com/nimbus/yelp-suggestions-pilot-v3/summary)
that we should now make the default:

```json
{
  "yelpFeatureGate": true,
  "yelpSuggestPriority": false,
  "yelpShowLessFrequentlyCap": 3,
  "yelpMinKeywordLength": 4,
  "exposureResults": "rust_yelp",
  "showExposureResults": true
}
```

Ideally we might define `minKeywordLength` as part of the Yelp data in remote
settings and then modify the Rust component to ingest it as Yelp config data,
similar to weather suggestions. But that would require modifying the Rust
component, and Product wants Yelp for 129, so that means we would need to uplift
a vendoring of application-services to Beta, which I think we should avoid.

So instead I just set the default value of the `minKeywordLength` pref to 4. I
kept the Nimbus variable and it will override the pref if the pref still has its
default value. That way we can still use Nimbus to set it if there's some
emergency.

I also kept the `yelpSuggestNonPriorityIndex` and `yelpSuggestPriority`
variables, in case we need those too. Eventually we should clean up all the
variables and prefs we're not using anymore.

Differential Revision: https://phabricator.services.mozilla.com/D215709
2024-07-04 01:51:24 +00:00
James Teow
fa3b3d1fea Bug 1905100 - Remove Persisted Search Tip - r=adw,urlbar-reviewers
The onboarding will be handled by OMC who will help with the
messaging for all the scotch bonnet features.

Differential Revision: https://phabricator.services.mozilla.com/D215234
2024-07-01 23:45:47 +00:00
Dale Harvey
8f27c5fa6e Bug 1903146 - Remove experiment.searchButton pref. r=urlbar-reviewers,dao,desktop-theme-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D214671
2024-06-27 10:26:09 +00:00
Daisuke Akatsuka
4daafc7c27 Bug 1903160: Introduce pocketSuggestionIndex Nimbus variable r=adw
Differential Revision: https://phabricator.services.mozilla.com/D214068
2024-06-20 23:25:58 +00:00
Dale Harvey
bea695c636 Bug 1900900 - Enable trending suggestions and recent searches for release. r=daisuke
Differential Revision: https://phabricator.services.mozilla.com/D212750
2024-06-06 11:27:28 +00:00
Marco Bonardo
8fd2c31a86 Bug 1862404 - Scheme not properly shown on overflow by RTL domains. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D210687
2024-05-30 11:29:49 +00:00
Dale Harvey
7cf2ed740f Bug 1893069 - Add 'browser.urlbar.scotchBonnet.enableOverride' pref. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D210374
2024-05-27 21:56:56 +00:00
Marco Bonardo
d2f59c66ad Bug 1626741 - Roll-up other panels when the Address Bar results panel opens. r=NeilDeakin,jteow
Differential Revision: https://phabricator.services.mozilla.com/D210711
2024-05-27 12:24:54 +00:00
Iulian Moraru
8f36d4dc3d Backed out changeset 4a2ec4353ec1 (bug 1626741) for causing bc failures on browser_fullscreen_context_menu.js. CLOSED TREE 2024-05-25 11:32:43 +03:00
Marco Bonardo
577dcbacdc Bug 1626741 - Roll-up other panels when the Address Bar results panel opens. r=NeilDeakin,jteow
Differential Revision: https://phabricator.services.mozilla.com/D210711
2024-05-23 16:05:26 +00:00
Yazan Al Macki
88ee6a2c27 Bug 1885897 - Remove browser.urlbar.update2.emptySearchBehavior pref, and test cases where it is set to non-default value. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D210081
2024-05-17 14:36:43 +00:00
Karandeep
29ec420075 Bug 1894614 - Disable the clipboard suggestions in the address bar due to performance concerns. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D209257
2024-05-03 12:15:05 +00:00
Marco Bonardo
6e1c1d304a Bug 1848715 - Untrim address bar value on user interaction. r=dao,tabbrowser-reviewers
Untrim the address bar value when the user starts manipulating it.
This doesn't untrim on focus, because that would break double-click to select
word, and drag-select. In the future we'll evaluate untrim on focus, but we'll
need additional platform support to replicate that functionality.
The behavior is currently controlled by the feature-gate preference
`browser.urlbar.untrimOnUserInteraction.featureGate`.

Original patch by Marc Seibert.

Differential Revision: https://phabricator.services.mozilla.com/D206135
2024-04-24 17:01:48 +00:00
Dale Harvey
5f9ad2e51c Bug 1871206 - Implement secondary actions for the urlbar. r=mak,settings-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D203381
2024-04-23 11:33:33 +00:00
Drew Willcoxon
3256a9b33b Bug 1890079 - Make the yelpMinKeywordLength Nimbus variable more useful. r=daisuke
Differential Revision: https://phabricator.services.mozilla.com/D206834
2024-04-08 04:40:01 +00:00
Drew Willcoxon
0c993cb63d Bug 1881875 - Add telemetry for potential suggestion impressions in the urlbar. r=mak
This includes some unrelated changes that lint either made or complained about.

Depends on D206110

Differential Revision: https://phabricator.services.mozilla.com/D206173
2024-04-03 22:02:07 +00:00
Marco Bonardo
c81d07de87 Bug 1882815 - Enable cross-container Tab Search for Release. r=jteow
Differential Revision: https://phabricator.services.mozilla.com/D203731
2024-03-09 12:05:45 +00:00
Dave Townsend
98ed146e46 Bug 1864896: Autofix unused function arguments (browser/components/urlbar). r=mak
Differential Revision: https://phabricator.services.mozilla.com/D202954
2024-03-03 09:09:09 +00:00
Daisuke Akatsuka
a66db50e7d Bug 1882220: Support simple UI weather suggestion r=adw
Differential Revision: https://phabricator.services.mozilla.com/D202786
2024-02-28 22:36:29 +00:00