Commit Graph

3439 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
mcheang
91e694d9a4 Bug 1925426 - Test autofill by typing a full or partial restrict keyword to trigger search mode. r=mak,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D226090
2024-10-23 22:56:46 +00:00
Nan Jiang
7b2fd8965f Bug 1926315 - Add telemetry for relevance ranking of Firefox Suggest r=adw,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D226672
2024-10-23 22:18:31 +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
Yazan Al Macki
76d48f287d Bug 1906541 - Ensure Searchmode Switcher works when Search Services fails. r=daleharvey,urlbar-reviewers,fluent-reviewers,mak
Differential Revision: https://phabricator.services.mozilla.com/D224522
2024-10-23 19:32:38 +00:00
Drew Willcoxon
b78d8f3b9a Bug 1921126 - Add desktop support for city-based weather suggestions. r=daisuke
This adds support for city-based weather suggestions from Rust, i.e., queries
that contain city and region names.

When Rust detects a weather query with a city, it sets three suggestion
properties: `city`, `region`, and `country`. All three properties will be set
because the Rust component knows which cities are in which regions and
countries, and it will only set the properties if it detects a city name. If a
name matches multiple cities and the query doesn't contain a region, Rust will
return multiple suggestions, one suggestion per city-region, and the suggestions
will be ordered by population size, largest to smallest.

Rust uses data from GeoNames to detect locations. We store GeoNames data in
remote settings and ingest it into the Rust DB, just like we do for suggestions
and keywords. This patch uses some mock GeoNames data in the test.

More info on the Rust part of this in the PR:
https://github.com/mozilla/application-services/pull/6406

For the Merino part, Merino now supports a few extra params for weather
suggestions: city, region, and country. So when the Rust component returns a
weather suggestion with those properties set, we can pass them to Merino to get
a weather suggestion for that location.

This patch adds a new `BaseFeature` method called `filterSuggestions()`. The
important thing about this method is that it's passed all the feature's
suggestions that were matched in the query. The feature can use this info to
determine which suggestion(s) to show. Right now, `Weather` uses it to discard
all weather suggestions except the first one, which means it will show the
suggestion with the largest city population (if the first suggestion has a
city). In the future, I'd like to explore better options like picking the
suggestion whose city name best matches the user's location.

Depends on D226215

Differential Revision: https://phabricator.services.mozilla.com/D226584
2024-10-23 06:54:44 +00:00
Drew Willcoxon
29390b9c75 Bug 1925735 - Update weather suggestions tests. r=daisuke
This replaces `MerinoTestUtils.WEATHER_RS_DATA` with
`QuickSuggestTestUtils.weatherRecord()`. Weather records now have an attachment
instead of storing their keywords inline. I also removed
`MerinoTestUtils.WEATHER_KEYWORD` because I think it's fine to use "weather"
directly everywhere, and that's simpler.

Some tests also need to be updated for the slight changes in keyword matching,
and some tasks don't make sense anymore.

Depends on D226214

Differential Revision: https://phabricator.services.mozilla.com/D226215
2024-10-23 02:45:20 +00:00
Dale Harvey
92c4195fd1 Bug 1925643 - Show Firefox chicklet on chrome privileged pages r=urlbar-reviewers,mak
Differential Revision: https://phabricator.services.mozilla.com/D226395
2024-10-22 20:27:24 +00:00
Dale Harvey
383a30e1de Bug 1926239 - Reenable tab-to-search while contextual search disabled. r=mak,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D226452
2024-10-22 15:25:00 +00:00
Drew Willcoxon
6a92258ac9 Bug 1926112 - Vendor application-services a0121f35125bd61ebd10fab969f6cfcc02f94d5a for city-based weather. r=bdk,nanj,supply-chain-reviewers
I had to also bump `uniffi` and `uniffi_bindgen` from 0.28.1 to 0.28.2.

Differential Revision: https://phabricator.services.mozilla.com/D226381
2024-10-22 03:45: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
Emilio Cobos Álvarez
4ea54f6e0f Bug 1921811 - Make URLBar a popover. r=emilio,desktop-theme-reviewers,tabbrowser-reviewers,sidebar-reviewers,urlbar-reviewers,dao,mak,dao?
* Fix various z-index/paint order issues by making the urlbar a popover - which moves the open
 urlbar to the top layer, outside the toolbox

* Adjust the urlbar position when the autohide menubar shows and hides

* Temporarily disable the browser_urlbar_keyed_search.js which needs revisiting to measure reflows under regular, non-test-specific conditions

Combines work from nsharpley and sfoster on top of emilio's original popover patch

Differential Revision: https://phabricator.services.mozilla.com/D224201
2024-10-21 23:39:16 +00:00
Dale Harvey
37dbf730f3 Bug 1922570 - Show global actions on seperate row from heuristic. r=daisuke,desktop-theme-reviewers,urlbar-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D225051
2024-10-21 19:36:57 +00:00
Norisz Fay
224773d44d Backed out changeset d4c4540a5a4a (bug 1921811) for causing bc failures on browser_urlbar_keyed_search.js CLOSED TREE 2024-10-21 15:10:55 +03:00
Emilio Cobos Álvarez
9fa478edc3 Bug 1921811 - Make URLBar a popover. r=emilio,desktop-theme-reviewers,tabbrowser-reviewers,sidebar-reviewers,urlbar-reviewers,dao,mak,dao?
* Fix various z-index/paint order issues by making the urlbar a popover - which moves the open
 urlbar to the top layer, outside the toolbox

* Adjust the urlbar position when the autohide menubar shows and hides

Combines work from nsharpley and sfoster on top of emilio's original popover patch

Differential Revision: https://phabricator.services.mozilla.com/D224201
2024-10-21 10:24:06 +00:00
Dale Harvey
bbef388da7 Bug 1925129 - Disable tab-to-search tips while scotchBonnet enabled. r=daisuke,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D226249
2024-10-20 21:04:41 +00:00
Dale Harvey
41a278d88a Bug 1923212 - Skip tests that fail with ScotchBonnet enabled. r=mak,settings-reviewers,sessionstore-reviewers,urlbar-reviewers,dao,Gijs
Differential Revision: https://phabricator.services.mozilla.com/D224633
2024-10-20 08:35:05 +00:00
Norisz Fay
1840f676be Backed out changeset 88669d7958cf (bug 1906541) for causing bc failure on browser_searchModeSwitcher_basic.js CLOSED TREE 2024-10-19 02:44:11 +03:00
Norisz Fay
9b743ec4a9 Backed out changeset 1de300781d3f (bug 1916499) for causing multiple search related failures CLOSED TREE 2024-10-18 22:17:36 +03:00
Yazan Al Macki
5a1364fee1 Bug 1906541 - Ensure Searchmode Switcher works when Search Services fails. r=daleharvey,urlbar-reviewers,fluent-reviewers,mak
Differential Revision: https://phabricator.services.mozilla.com/D224522
2024-10-18 16:17:06 +00:00
Moritz Beier
eedeed877c Bug 1916499 - Add searchForm support back to OpenSearch engines. r=Standard8,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D225968
2024-10-18 13:46:52 +00:00
Norisz Fay
1917d598d3 Backed out changeset 4ef6f0f9300d (bug 1923212) for causing bc failures on browser_searchModeSwitcher_basic.js CLOSED TREE 2024-10-18 20:41:04 +03:00
Dale Harvey
9ce57913c3 Bug 1923212 - Skip tests that fail with ScotchBonnet enabled. r=mak,settings-reviewers,sessionstore-reviewers,urlbar-reviewers,dao,Gijs
Differential Revision: https://phabricator.services.mozilla.com/D224633
2024-10-18 13:25:17 +00:00
Florian Quèze
6ac3c84fb1 Bug 1925355 - Remove contextual.services.quicksuggest legacy telemetry scalars, r=adw,urlbar-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D226039
2024-10-18 08:57:18 +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
Moritz Beier
6ea5ea04d5 Bug 1924968 - The deduplication of history results that only differ by their ref should take bookmark results into account. r=mak,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D225764
2024-10-17 11:11:13 +00:00
mcheang
fce9027e99 Bug 1924228 - Localize Searchmode Switcher Button strings into other languages. r=daleharvey,fluent-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D225866
2024-10-17 01:08:53 +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
Nan Jiang
74d5157add Bug 1924194 - Provide a mapping table for Interest enum r=adw,bdk,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D225715
2024-10-16 18:40:00 +00: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
Dale Harvey
70b4b3041c Bug 1913193 - Ensure dedicated search button does not get stuck. r=daisuke,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D224471
2024-10-15 09:13:52 +00:00
mcheang
fd3ca17835 Bug 1921072 - Fix impression telemetry warning for restrict keywords and token alias engines results. r=mak,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D224568
2024-10-11 21:40:12 +00:00
Dale Harvey
4a96f5ee84 Bug 1920032 - Hide the SearchModeSwitcher in readonly urlbars. r=dao,desktop-theme-reviewers,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D224477
2024-10-11 20:10:59 +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
Nan Jiang
ed574ceeb5 Bug 1923187: part 2 - Add experimental ranking for Merino suggestions r=adw,bdk
Differential Revision: https://phabricator.services.mozilla.com/D225141
2024-10-11 02:33:02 +00:00
Chris H-C
724b00c304 Bug 1920562 - Remove JS uses of Services.telemetry.setEventRecordingEnabled r=florian,extension-reviewers,settings-reviewers,pip-reviewers,credential-management-reviewers,search-reviewers,devtools-reviewers,sync-reviewers,sessionstore-reviewers,omc-reviewers,migration-reviewers,firefox-desktop-core-reviewers ,urlbar-reviewers,sfoster,nchevobbe,valentin,Gijs,dimi,lina,mconley,pdahiya,willdurand
Differential Revision: https://phabricator.services.mozilla.com/D223833
2024-10-08 20:14:42 +00:00
James Teow
bb83581355 Bug 1923374 - Check state.persist is defined in SearchModeSwitcher - r=daleharvey
Differential Revision: https://phabricator.services.mozilla.com/D224960
2024-10-08 15:52:46 +00:00
mcheang
6a815ad8e0 Bug 1919180 - Update scalar keys for urlbar.searchmode.typed and urlbar.searchmode.keywordoffer. r=mak,urlbar-reviewers
- `urlbar.searchmode.typed`: suffixed with "keyword" for restrict keyword entries and "symbol" for symbol entries.
- `urlbar.searchmode.keywordoffer`: suffixed with "keyword" for restrict keyword entries via keywordoffer.
- Example: History search mode scalar key is `history_keyword` for restrict keyword and `history_symbol` for symbol.

Differential Revision: https://phabricator.services.mozilla.com/D223210
2024-10-08 14:10:01 +00:00
James Teow
46c33defd6 Bug 1921092 - Simplify Persisted Search logic and make non-default engines consistent - r=adw,urlbar-reviewers
The main goal is to simplify the logic in setURI, and create a more easier to understand flow of operations.

It involves making Persisted Search more contained, offload some responsibilities to UrlbarSearchTermsPersistence, and store fewer state variables than the patch that was first reviewed. I also simplified code in UrlbarSearchTermsPersistence.

**How Search Terms Persist:**

**Step 1**

When the page first appears, set state for search terms persistence. First load doesn't necessarily mean no tab switch or same page load, as a user could load a browser in the background tab. In that latter case, the first "view" may occur on a tab switch and the state won't exist because `setURI` will never have been called with that browser object being selected.

Once the state has been set, the only property that could be updated is `shouldPersist`. Otherwise, don't update the state object unless a full new page load occurs.

**Step 2**

Call `shouldPersist`. This has all the logic for when search terms should persist and gets called anytime `setURI` is called.

The conditions in which we shouldn't persist:

- There's no reason to show search terms:
  - The persist state is missing.
  - There are no search terms extracted from the URL.
- We need to temporarily hide the search terms, such as by handleRevert
  - `hideSearchTerms` is provided to setURI
- There is an user typed value and it differs from the search terms
- A single page application moved to a secondary page
- After the initial page load, there's the search mode (or lack of search mode) differs from the persist engine.

**Step 3**

Determine if we need to update `this.window.gBrowser.userTypedValue`. If we're going to persist, set `userTypedValue` to the search terms, which will keep the search mode and non-search mode state consistent. This'll also enable the ability to reuse existing logic that determines how to set `value`.

On same page loads, when switching from persist to non-persist, and search term equals the userTypedValue, then `null` the userTypedValue so that the URL shows.

**Step 4**

In the area of setURI which has logic for search mode, if we persist, ensure the search mode (or lack of search mode) is consistent with the engine. If it is, do nothing. If it isn't, either nullify the search mode or enter search mode.

Differential Revision: https://phabricator.services.mozilla.com/D224520
2024-10-08 04:12:29 +00:00
Sandor Molnar
92076e16a7 Backed out 5 changesets (bug 1920562) for causing xpc assertion failures. CLOSED TREE
Backed out changeset 8f085ab589a8 (bug 1920562)
Backed out changeset 4405387ae770 (bug 1920562)
Backed out changeset a68fd13a33ae (bug 1920562)
Backed out changeset cd3672fc08ed (bug 1920562)
Backed out changeset 62ab18879eea (bug 1920562)
2024-10-08 00:16:13 +03:00
Chris H-C
e944bfe7a2 Bug 1920562 - Remove JS uses of Services.telemetry.setEventRecordingEnabled r=florian,settings-reviewers,pip-reviewers,credential-management-reviewers,search-reviewers,devtools-reviewers,sync-reviewers,sessionstore-reviewers,omc-reviewers,migration-reviewers,firefox-desktop-core-reviewers ,urlbar-reviewers,sfoster,nchevobbe,valentin,Gijs,dimi,lina,mconley,pdahiya
Differential Revision: https://phabricator.services.mozilla.com/D223833
2024-10-07 17:29:57 +00:00
Tamas Szentpeteri
217012b8ec Backed out changeset 737f799b6c6c (bug 1919180) for causing mochitest fails on browser_secondaryActions.js. CLOSED TREE 2024-10-04 04:40:15 +03:00
mcheang
8bf9314776 Bug 1919180 - Update scalar keys for urlbar.searchmode.typed and urlbar.searchmode.keywordoffer. r=mak,urlbar-reviewers
- `urlbar.searchmode.typed`: suffixed with "keyword" for restrict keyword entries and "symbol" for symbol entries.
- `urlbar.searchmode.keywordoffer`: suffixed with "keyword" for restrict keyword entries via keywordoffer.
- Example: History search mode scalar key is `history_keyword` for restrict keyword and `history_symbol` for symbol.

Differential Revision: https://phabricator.services.mozilla.com/D223210
2024-10-03 23:18:05 +00:00
Ben Dean-Kawamura
b37f9a1085 Bug 1911639 - Record Suggest metrics, r=adw
Differential Revision: https://phabricator.services.mozilla.com/D224162
2024-10-03 15:35:10 +00:00
Sandor Molnar
232317ebfc Backed out changeset 2fa695c28d67 (bug 1919180) for causing bc failures @ browser_searchMode_switchTabs.js CLOSED TREE 2024-10-03 01:47:33 +03:00
mcheang
d66595dcf8 Bug 1919180 - Update scalar keys for urlbar.searchmode.typed and urlbar.searchmode.keywordoffer. r=mak,urlbar-reviewers
- `urlbar.searchmode.typed`: suffixed with "keyword" for restrict keyword entries and "symbol" for symbol entries.
- `urlbar.searchmode.keywordoffer`: suffixed with "keyword" for restrict keyword entries via keywordoffer.
- Example: History search mode scalar key is `history_keyword` for restrict keyword and `history_symbol` for symbol.

Differential Revision: https://phabricator.services.mozilla.com/D223210
2024-10-02 19:01:01 +00:00
mcheang
ce3fcffe0e Bug 1921549 - List the keywords in the results panel when a user types @. r=mak,fluent-reviewers,urlbar-reviewers
This patch adds the keywords to the result title for TokenAliasEngine and
RestrictKeyword results. The TokenAliasEngine results may have more than one
keyword if the user has set a custom keyword for that engine. This can help
remind the user what keywords are available as they are typing or if they
have forgotten a keyword, they can type `@` to quickly see the list of keywords
to search with.

The result title looks like this:

For Engines:
 @[keywords] - Search with [Engine]
For Restrict Keywords:
@[keyword] - Search [Restrict]

Differential Revision: https://phabricator.services.mozilla.com/D224017
2024-10-02 18:42:29 +00:00