Commit Graph

220 Commits

Author SHA1 Message Date
Drew Willcoxon
bf950118ff Bug 1966811 - Enable Suggest in the UK and disable most suggestion types outside the US. r=daisuke,nanj
Differential Revision: https://phabricator.services.mozilla.com/D249706
2025-05-19 19:43:24 +00:00
dadaa
9e7131f6df Bug 1965396: Add prefix indicating the service to the title r=adw,fluent-reviewers,bolsson
Differential Revision: https://phabricator.services.mozilla.com/D248571
2025-05-19 04:26:37 +00:00
agoloman
335eb13e70 Revert "Bug 1965396: Add prefix indicating the service to the title r=adw,fluent-reviewers,bolsson" for causing xpc failures @test_quicksuggest_yelp.js.
This reverts commit 9dfb2bdc64.
2025-05-16 04:48:49 +00:00
dadaa
9dfb2bdc64 Bug 1965396: Add prefix indicating the service to the title r=adw,fluent-reviewers,bolsson
Differential Revision: https://phabricator.services.mozilla.com/D248571
2025-05-16 04:05:14 +00:00
Drew Willcoxon
cf604f88fb Bug 1958988 - Tweak weather suggestions result menu and prepare UI strings for l10n. r=daisuke,fluent-reviewers,bolsson
Differential Revision: https://phabricator.services.mozilla.com/D244806
2025-04-09 00:14:44 +00:00
Francesco Lodolo (:flod)
0f4b702c89 Bug 1955004 - Avoid generating Fluent IDs at run-time in address bar, r=urlbar-reviewers,adw
Also removed unused string in browser.ftl

Differential Revision: https://phabricator.services.mozilla.com/D242192
2025-03-19 18:21:15 +00:00
Daisuke Akatsuka
f760504e7c Bug 1953927: Close urlbar view explicitly when opening Unified Search Engine popup r=desktop-theme-reviewers,daleharvey,dao
Differential Revision: https://phabricator.services.mozilla.com/D241542
2025-03-18 05:13:24 +00:00
Norisz Fay
17d578c8b5 Backed out 2 changesets (bug 1953920, bug 1953927) for causing searchModeSwitcher related failures CLOSED TREE
Backed out changeset 8b74e1a3e693 (bug 1953920)
Backed out changeset 4dfd7b14198d (bug 1953927)
2025-03-18 01:38:16 +02:00
Daisuke Akatsuka
854adc1c31 Bug 1953927: Close urlbar view explicitly when opening Unified Search Engine popup r=desktop-theme-reviewers,daleharvey,dao
Differential Revision: https://phabricator.services.mozilla.com/D241542
2025-03-17 20:11:02 +00:00
Florian Quèze
5e08a22d9f Bug 1938938 - remove the FX_URLBAR_ZERO_PREFIX_DWELL_TIME_MS histogram, r=adw,urlbar-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D241242
2025-03-17 16:14:04 +00:00
Daisuke Akatsuka
e41a928a1f Bug 1952887: Disable top sites context cache upon showing contextual opt-in message r=adw
Differential Revision: https://phabricator.services.mozilla.com/D241121
2025-03-12 02:23:14 +00:00
Daisuke Akatsuka
51d99457b6 Bug 1951649: Remove previously set attributes properly if new result r=adw
Differential Revision: https://phabricator.services.mozilla.com/D240412
2025-03-05 21:48:33 +00:00
Drew Willcoxon
cb701edc4f Bug 1947355 - Prepare Suggest AMP and Wikipedia strings for localization. r=daisuke,fluent-reviewers,urlbar-reviewers,bolsson
This moves l10n strings related to AMP and Wikipedia suggestions out of
`enUS-searchFeatures.ftl` into the appropriate l10n files in preparation for AMP
and Wikipedia in non-U.S. regions. These strings include:

* The result menu item strings, Dismiss and Manage
* Relevant settings UI strings

`urlbar-result-menu-learn-more-about-firefox-suggest` isn't actually used by AMP
and Wikipedia right now, but it was in the past, and there have been recent
discussions about maybe including it again as Suggest expands outside the U.S.
So I moved it too in case we need it with short notice.

There are other Suggest strings that this patch does not move, in particular:

* `-firefox-suggest-brand-name` is already exposed to localizers
* The "Sponsored" label at the bottom of AMP urlbar rows is already exposed to
  localizers as `urlbar-result-action-sponsored`
* Strings for the online toggle switch in the settings UI ("Improve the Firefox
  Suggest experience") aren't needed right now because online Suggest (Merino)
  won't be available outside the U.S. in the near future.

I changed the ID of the Dismiss string so it doesn't include "firefox-suggest".
Several non-Suggest urlbar results use this string too, and it doesn't actually
include the phrase "Firefox Suggest" anyway.

I also made the view default to this string so that dismissable urlbar results
don't need to specify it, similar to how it defaults to strings for "Learn more"
and Manage.

Depends on D238847

Differential Revision: https://phabricator.services.mozilla.com/D239213
2025-02-26 15:49:17 +00:00
Drew Willcoxon
1dfff69006 Bug 1948037 - UrlbarView shouldn't skip over existing rows when processing hidden-exposure results. r=mak,urlbar-reviewers
When the view is updating existing rows and it encounters a hidden-exposure
result, it shouldn't increment `rowIndex` because the row isn't actually updated
in that case. The view should revisit the row in the next iteration.

Differential Revision: https://phabricator.services.mozilla.com/D238147
2025-02-18 18:09:36 +00:00
Drew Willcoxon
d384f73795 Bug 1943795 - Add BlockedSuggestions.blockResult() and don't set originalUrl unnecessarily. r=daisuke
Depends on D235389

Differential Revision: https://phabricator.services.mozilla.com/D235549
2025-01-27 23:24:43 +00:00
Daisuke Akatsuka
f751bdcb33 Bug 1941464: Fix double setting the id of item r=daleharvey
Differential Revision: https://phabricator.services.mozilla.com/D234126
2025-01-14 15:29:50 +00:00
James Teow
1e85ded655 Bug 1901061 - Prevent autofill from immediately triggering on persisted search terms - r=adw,urlbar-reviewers
If the user is modifying their search term, we suspect they don't immediately
want an autofilled url. makeQueryContext always enables autofill if
the allowAutofill is undefined.

Differential Revision: https://phabricator.services.mozilla.com/D233396
2025-01-08 17:43:18 +00:00
Daisuke Akatsuka
216ea392bd Bug 1929515: Assign id to action button when selecting for accessibility r=daleharvey
Differential Revision: https://phabricator.services.mozilla.com/D233336
2025-01-08 00:09:26 +00:00
Drew Willcoxon
d798414004 Bug 1938517 - Implement new "simplest" weather suggestion UI. r=fluent-reviewers,desktop-theme-reviewers,urlbar-reviewers,emilio,bolsson,daisuke
This makes a number of changes to support a new UI treatment for weather
suggestions in addition to the two existing treatments. Unfortunately we need
all three to experiment with, but hopefully after experimentation is done we can
remove the two existing treatments.

This patch refers to the new treatment as the "simplest" UI. The Figma is at [1]
although it doesn't reflect some details Josh and I have discussed. One of the
existing treatments is already called "simple", and this patch changes its name
to "simpler". The patch refers to the other existing treatment as "full". These
names are only informal because the Nimbus variable and fallback pref are
integers.

Because the new UI treatment is so simple, we can pretty much use the standard
rich suggestion UI for it. The existing treatments are dynamic. I say "pretty
much" because I did need to add a capability to rich suggestions,
`result.richSuggestionIconVariation`, which lets results set an `icon-variation`
attribute on their rows. Weather suggestions use it to choose the appropriate
weather icon in the CSS.

I also modified l10n string caching in a few ways to address a couple of
problems:

* I like how dynamic results can cache their strings lazily by setting
  `cacheable` in their l10n objects. Standard results can only cache their
  strings by adding them to `UrlbarView.#cacheL10nStrings()`. That method is
  getting pretty big, and it also doesn't work well with strings that have
  arguments since it's called to pre-cache strings before they're used, when
  there are no arguments. So I extended `cacheable` support to all l10n objects,
  not only those from dynamic results.
* Josh's spec calls for the temperature in the suggestion title to be bolded.
  There's no good way to do that right now. We have highlights, but they aren't
  useable for l10n strings. The simplest thing -- and what I've done before in
  cases like this -- is to include `<strong>` tags in the l10n string itself.
  That works except for when we have a cache hit with the l10n cache. In that
  case, we set the `textContent`, which of course renders the tag literally. So
  I added a `parseMarkup` option to l10n objects that says the cached string
  should be set as `innerHTML` instead. Actually, for security I parse the
  string into a sanitized document fragment. We could just always do this and
  get rid of `parseMarkup`, but it seems wasteful since most l10n strings don't
  need it.
* While addressing the previous two points, it made sense to move
  `setElementL10n()` from the view to `L10nCache`. That way all these
  cache-related functions are together.

Finally, Josh noticed one of the dark-mode colors in the icon SVG didn't have
enough contrast with the standard dark-mode panel background, so I updated that
to a new color he chose (from `#80808F` to `#9393A8`).

[1] https://www.figma.com/design/Hdi0oHB7trRcncyVAKZypO/accuweather-explorations?node-id=3548-15992&t=f4YUShEe5RkP2KEg-1

Differential Revision: https://phabricator.services.mozilla.com/D232703
2024-12-27 18:11:23 +00:00
mcheang
f8ea71ac19 Bug 1933003 - Add support to use restricted search keywords in both en-US and the localized language. r=mak,fluent-reviewers,settings-reviewers,urlbar-reviewers,mossop
This patch adds English restrict keyword strings to the enUS-searchFeature.ftl
file. The restrictKeywords providers return an array of keywords for their
l10nRestrictKeywords property. The first is the localized keyword, and the
second is the English keyword. If the user is in the English locale, the
providers return an array with one element: the English keyword.

Differential Revision: https://phabricator.services.mozilla.com/D230009
2024-12-24 22:40:09 +00:00
Daisuke Akatsuka
89e16c6f33 Bug 1929679: Stop using :has() in urlbarView.css r=urlbar-reviewers,adw
Differential Revision: https://phabricator.services.mozilla.com/D228622
2024-11-12 22:19:55 +00:00
Daisuke Akatsuka
c2f5c3753c Bug 1921731: Keep actions' layout until changing the results r=urlbar-reviewers,daleharvey,adw
Differential Revision: https://phabricator.services.mozilla.com/D226107
2024-11-11 05:44:29 +00:00
Daisuke Akatsuka
176b51d0b0 Bug 1921174: Move focus to Dedicated Search button by Tab key from urlbar r=daleharvey,urlbar-reviewers,adw,dao
Differential Revision: https://phabricator.services.mozilla.com/D225176
2024-11-05 22:20:03 +00:00
Florian Quèze
e704e70b3b Bug 1927093 - Migrate scalars to use Glean APIs for urlbar.*, r=chutten,urlbar-reviewers,mak.
Differential Revision: https://phabricator.services.mozilla.com/D226513
2024-11-05 13:22:58 +00:00
Adi
f8402ccb58 Backed out changeset 4df1b9d10c1f (bug 1921174) for causing bc failures @ browser_searchModeSwitcher_basic.js. CLOSED TREE 2024-10-30 08:41:36 +02:00
Daisuke Akatsuka
a081ba9733 Bug 1921174: Move focus to Dedicated Search button by Tab key from urlbar r=daleharvey,urlbar-reviewers,adw
Differential Revision: https://phabricator.services.mozilla.com/D225176
2024-10-30 03:00:32 +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
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
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
James Teow
d8061ef3e3 Bug 1903376 - Move searchTerms into UrlbarInput internal state - r=adw,urlbar-reviewers
The purpose of this change is to cache persist state into an object so that in future patches, I can add other persisted search related state to it.

Differential Revision: https://phabricator.services.mozilla.com/D224122
2024-10-01 19:33:54 +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
Daisuke Akatsuka
12ba476194 Bug 1913199: Clear userTypedValue when closing the urlbar view if search mode is preview r=daleharvey
Differential Revision: https://phabricator.services.mozilla.com/D221926
2024-09-13 22:45:17 +00:00
Daisuke Akatsuka
68985d48ee Bug 1913205: Display url upon pressing shift/ctrl for switch to tab suggestion r=desktop-theme-reviewers,daleharvey,dao
Differential Revision: https://phabricator.services.mozilla.com/D221759
2024-09-13 22:09:33 +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
Daisuke Akatsuka
51c5b9ed62 Bug 1913204: Apply container color border to secondary action button for tab switch r=desktop-theme-reviewers,urlbar-reviewers,daleharvey,dao
Differential Revision: https://phabricator.services.mozilla.com/D221114
2024-09-09 11:53:09 +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
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
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
Drew Willcoxon
96d5364f6b Bug 1908750 - Force dynamic urlbar providers to specify highlighted text in their view updates. r=daisuke,urlbar-reviewers
There are a few ways to solve this problem and I tried to take a straightforward
approach. This patch makes text highlighting less automagical and surprising. It
forces dynamic-result providers to specify highlighted text content as part of
their view updates just like all other non-highlighted text and other
properties. To trigger highlighting, the view update can include a new
`highlights` property.

Except for Fakespot, there currently aren't any providers that take advantage of
the existing automagical highlighting behavior.

Depends on D216370

Differential Revision: https://phabricator.services.mozilla.com/D217020
2024-07-19 00:18:16 +00:00
Daisuke Akatsuka
d445e80774 Bug 1907468: Use icon provided from Rust for each Fakespot suggestion r=adw
Depends on D216493

Differential Revision: https://phabricator.services.mozilla.com/D216370
2024-07-18 20:31:22 +00:00
Dale Harvey
0eccbb1c7f Bug 1903145 - Hide UrlbarView when SearchModeSwitcher opens. r=desktop-theme-reviewers,urlbar-reviewers,daisuke,dao
Differential Revision: https://phabricator.services.mozilla.com/D215281
2024-07-02 20:23:57 +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
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
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
Daisuke Akatsuka
c6bfe80f01 Bug 1889820: Add isManageable attribute to show 'Manage' result menu item in a suggestion r=adw
Differential Revision: https://phabricator.services.mozilla.com/D206862
2024-04-09 07:41:52 +00:00
Drew Willcoxon
a17188bd2b Bug 1886175 - Properly count urlbar hidden exposures whose hypothetical rows can't immediately be shown. r=mak,wstuckey
The problem has to do with hidden exposures whose hypothetical rows can't
immediately be made visible either because they would overflow the filled-up
view or because a misplaced result was seen.

The relevant part of `#updateResults()` is [here](https://searchfox.org/mozilla-central/rev/6a2a2a52d7e544a2fd5678d04991a7e78b694f22/browser/components/urlbar/UrlbarView.sys.mjs#1289-1291). When `canBeVisible` is false,
we effectively forget about that hidden-exposure result, which is not right. For
normal results, we also have that `canBeVisible` logic (a few lines down from
the part I linked), but the difference is that we create a hidden row for them
and then unhide the row when the query finishes and stale rows are removed.
We're missing an analog to that logic for hidden-exposure results, so we're
undercounting them.

Fortunately it's not too hard to fix. I added a new kind of exposure for
`TelemetryEvent` to track called "tentative" exposures. Tentative exposures are
entirely analogous to this case where a row would be added but hidden, and then
unhidden when stale rows are removed.

While I was modifying the test, I rephrased the comments for existing tasks so
hopefully they're easier to understand.

Differential Revision: https://phabricator.services.mozilla.com/D205155
2024-03-21 16:50:47 +00:00
Marco Bonardo
317e4002ac Bug 1884146 - Cross containers switch-tab artifacts remain on other address bar results. r=jteow
The heuristic result is always kept first when receiving new results, that means
any result could be upgraded to be a heuristic result, including the first Top
Site, as in the zero prefix case there's no heuritic.
Thus it's safer to generate new DOM contents when upgrading between heuristic and
non-heuristic.

Also switch-tab results with container info have complex structure and should
generate new DOM contents, unless they are reused by other switch-tab results.

Unfortunately these changes are mostly visual and not easily testable, as it would
be very time consuming.

In general, for the long term, reusing the DOM of results is fragile and causes
nodes, attributes or classes to be ported over to incompatible results. We do it
to avoid flicker, but we must investigate better ways to do it.

Differential Revision: https://phabricator.services.mozilla.com/D204483
2024-03-15 10:18:25 +00:00