Commit Graph

62 Commits

Author SHA1 Message Date
Marco Bonardo
b99e0f7f7e Bug 1827770 - Remove isPrivate argument from onEngagement() since it can be inferred. r=daleharvey
We can't use context.isPrivate because sometimes context is undefined.
I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1841762 about that.

Differential Revision: https://phabricator.services.mozilla.com/D182772
2023-07-07 10:01:50 +00:00
Marco Bonardo
ff3c4323fc Bug 1827770 - Remove QueryContext.view and pass the controller to onEngagement() instead. r=daleharvey
Differential Revision: https://phabricator.services.mozilla.com/D182771
2023-07-07 10:01:50 +00:00
Dale Harvey
075100a227 Bug 1796805 - Only update quickactions searchmode layout on search. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D182330
2023-07-05 09:23:11 +00:00
Sandor Molnar
a2204a4797 Backed out changeset 85caefe95672 (bug 1796805) for causing xpc failures in browser/components/urlbar/tests/unit/test_quickactions.js CLOSED TREE 2023-06-28 18:27:02 +03:00
Dale Harvey
176968fd70 Bug 1796805 - Only update quickactions searchmode layout on search. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D182330
2023-06-28 13:18:16 +00:00
Stephanie Cunnane
ddcbc18d91 Bug 1589602 - Improve urlbar performance with very long search strings. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D180734
2023-06-27 13:13:11 +00:00
Drew Willcoxon
c26ec9b3d6 Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak
This removes `UrlbarProvider.pickResult()` and `blockResult()` in favor of
handling picks and dismissals through `onEngagement()`. A number of providers
use those two methods, so this revision touches a lot of files.

Handling dismissals through `onEngagement()` means `UrlbarInput.pickResult()`
can no longer tell whether a result is successfully dismissed, so it can't
remove the result anymore. (Maybe `onEngagement()` could return some value
indicating it dismissed the result, but I don't want to go down that road.)
Instead, I split `UrlbarController.handleDeleteEntry()` into two methods: a
public one that removes the result and notifies listeners, and a private one
that handles dismissing the selected result internally in
UrlbarController. Providers that have dismissable results should now implement
`onEngagement()` and call `controller.removeResult()`.

I made some other improvements to engagement handling. There's still room for
more but this patch is big enough already.

Other notable changes:

Include the engaged result in engagement notifications so providers have easy
access to it and can respond to clicks and dismissals more easily. That also
lets us stop passing `selIndex` and `provider` to `engagementEvent.record()`
since now it can compute those from the passed-in result.

Add the concept of `isSessionOngoing` to engagement notifications so providers
can tell whether an engagement ended the search session. Right now, providers
like quick suggest that record a bunch of provider-specific legacy telemetry
assume that `onEngagement()` ends the session, but that's no longer true.

Unify result buttons and result menu commands by setting
`element.dataset.command` on buttons (hopefully we can remove buttons soon, at
least the ones that aren't tip buttons)

Make sure we always notify providers on engagement even on dismissals or
when skipping legacy telemetry

Move dismissal of restyled search suggestions and history results from
`UrlbarController.handleDeleteEntry()` to the Places provider

Move dismissal of form history results from
`UrlbarController.handleDeleteEntry()` to the search suggestions provider

In the Places provider, remove the unused `_addSearchEngineMatch()` method. Also
remove the code in the "searchengine" case that creates a non-search-history
result. This code is unreached because the only time the provider creates a
"searchengine" match it also sets `isSearchHistory` to true.

In `UrlbarTestUtils.promiseAutocompleteResultPopup()`, change the default value
of the `fireInputEvent` param from false to true. This is necessary because
without a starting input event, the start event info in `engagementEvent` will
be null, so when `engagementEvent.record()` is called at the end of the
engagement, it will bail, and providers will not be notified of the engagement.
IMO true is a better default value anyway because input events will typically be
fired when the user performs a search.

Differential Revision: https://phabricator.services.mozilla.com/D174941
2023-04-13 06:03:33 +00:00
Daisuke Akatsuka
2407eb3bf1 Bug 1820081: Correspond to cleared query context when paste-and-go and drop-and-go r=adw
Differential Revision: https://phabricator.services.mozilla.com/D171527
2023-03-05 22:45:29 +00:00
Daisuke Akatsuka
e91bcc50b9 Bug 1790635: Hide QuickActions row if all actions are inactive r=daleharvey
Differential Revision: https://phabricator.services.mozilla.com/D157288
2023-02-28 21:05:07 +00:00
Dale Harvey
94f30f80d4 Bug 1816101 - Ensure we don't log error when no quickactions. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D169459
2023-02-10 22:56:28 +00:00
Dale Harvey
11f59f385e Bug 1806024 - Add telemetry for QuickAction inpressions. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D166611
2023-02-02 10:12:13 +00:00
Dale Harvey
0438990a06 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
Dale Harvey
69a19c1c3f Bug 1805075 - Show QuickActions in actions search mode. r=daisuke
Differential Revision: https://phabricator.services.mozilla.com/D164618
2022-12-14 10:33:21 +00:00
Drew Willcoxon
212d13a054 Bug 1803873 - Support row buttons in all row types and make changes to tip rows. r=dao
This makes a couple of large changes:

(1) "Generic" buttons (the ones added by `UrlbarView.#addRowButton()`) are now
supported in all row types. The help button that's currently included in some
types of rows when `result.payload.helpUrl` is defined is now supported for all
row types, and two additional button types are now supported too: block buttons
and labeled buttons. A row will get a block button if its
`result.payload.isBlockable` is defined. It will get a labeled button if
`result.payload.buttons` is defined and non-empty. A button can include a `url`
property that is then added as an attribute on the button's element, and
`UrlbarInput.pickResult()` will use this attribute to load the URL when the
button is picked.

(2) The reason I added labeled buttons is because it lets us support tip buttons
without much more effort, which then lets us get rid of the special row type
used for tips. With this patch, tips are now standard rows that use generic
buttons.

This approach should be compatible with the result menu, when we switch over to
it, because we can include the help and block commands in the menu when
`helpUrl` and `isBlockable` are defined, instead of creating buttons for them.
Labeled buttons -- the ones used in tips -- would still be created. The result
menu button itself can continue to be a generic button.

It should also be compatible with including the result menu button inside the
row selection. We'll still add buttons to `.urlbarView-row`, separate from
`.urlbarView-row-inner`, so that the buttons can continue to be on the right
side of the row. We can color the background of the row instead of the
row-inner.

As with D163630, my motivation for this change is to support generic buttons in
dynamic result rows so that help and block buttons can be easily added to
weather suggestions. Here too the larger changes of supporting generic labeled
buttons and removing special rows for tips aren't strictly necessary, but I took
the opportunity to rework things.

Finally, this makes a few other changes:

* It includes some of the more minor improvements to selection that I made in
  D163630.

* It removes the help URL code from quick actions since it was decided not to
  show a help button. Currently, the button is hidden in CSS, but now that a
  generic help button is added for dynamic result rows when
  `result.payload.helpUrl` is defined, `helpUrl` needs to be removed from the
  payload to prevent a button from being added.

* I removed the special tip wrapping behavior, where the tip button and help
  button would wrap below the tip's text. Instead, now the text wraps inside
  row-inner and the buttons always remain on the same horizontal as the text. I
  don't think it's worth the extra complication.

Differential Revision: https://phabricator.services.mozilla.com/D163766
2022-12-06 18:43:49 -05:00
Noemi Erli
5ffe6e3698 Backed out changeset e0eac08ef8bc (bug 1803873) fo causing failures in browser_search_telemetry_sources_navigation CLOSED TREE 2022-12-07 01:24:44 +02:00
Drew Willcoxon
f7f081c409 Bug 1803873 - Support row buttons in all row types and make changes to tip rows. r=dao
This makes a couple of large changes:

(1) "Generic" buttons (the ones added by `UrlbarView.#addRowButton()`) are now
supported in all row types. The help button that's currently included in some
types of rows when `result.payload.helpUrl` is defined is now supported for all
row types, and two additional button types are now supported too: block buttons
and labeled buttons. A row will get a block button if its
`result.payload.isBlockable` is defined. It will get a labeled button if
`result.payload.buttons` is defined and non-empty. A button can include a `url`
property that is then added as an attribute on the button's element, and
`UrlbarInput.pickResult()` will use this attribute to load the URL when the
button is picked.

(2) The reason I added labeled buttons is because it lets us support tip buttons
without much more effort, which then lets us get rid of the special row type
used for tips. With this patch, tips are now standard rows that use generic
buttons.

This approach should be compatible with the result menu, when we switch over to
it, because we can include the help and block commands in the menu when
`helpUrl` and `isBlockable` are defined, instead of creating buttons for them.
Labeled buttons -- the ones used in tips -- would still be created. The result
menu button itself can continue to be a generic button.

It should also be compatible with including the result menu button inside the
row selection. We'll still add buttons to `.urlbarView-row`, separate from
`.urlbarView-row-inner`, so that the buttons can continue to be on the right
side of the row. We can color the background of the row instead of the
row-inner.

As with D163630, my motivation for this change is to support generic buttons in
dynamic result rows so that help and block buttons can be easily added to
weather suggestions. Here too the larger changes of supporting generic labeled
buttons and removing special rows for tips aren't strictly necessary, but I took
the opportunity to rework things.

Finally, this makes a few other changes:

* It includes some of the more minor improvements to selection that I made in
  D163630.

* It removes the help URL code from quick actions since it was decided not to
  show a help button. Currently, the button is hidden in CSS, but now that a
  generic help button is added for dynamic result rows when
  `result.payload.helpUrl` is defined, `helpUrl` needs to be removed from the
  payload to prevent a button from being added.

* I removed the special tip wrapping behavior, where the tip button and help
  button would wrap below the tip's text. Instead, now the text wraps inside
  row-inner and the buttons always remain on the same horizontal as the text. I
  don't think it's worth the extra complication.

Differential Revision: https://phabricator.services.mozilla.com/D163766
2022-12-06 22:28:55 +00:00
Cristian Tuns
63266cca48 Backed out changeset 263fffe843be (bug 1803873) for causing mochitest failures on browser_test_focus_urlbar.js CLOSED TREE 2022-12-06 15:10:09 -05:00
Drew Willcoxon
e634925c17 Bug 1803873 - Support row buttons in all row types and make changes to tip rows. r=dao
This makes a couple of large changes:

(1) "Generic" buttons (the ones added by `UrlbarView.#addRowButton()`) are now
supported in all row types. The help button that's currently included in some
types of rows when `result.payload.helpUrl` is defined is now supported for all
row types, and two additional button types are now supported too: block buttons
and labeled buttons. A row will get a block button if its
`result.payload.isBlockable` is defined. It will get a labeled button if
`result.payload.buttons` is defined and non-empty. A button can include a `url`
property that is then added as an attribute on the button's element, and
`UrlbarInput.pickResult()` will use this attribute to load the URL when the
button is picked.

(2) The reason I added labeled buttons is because it lets us support tip buttons
without much more effort, which then lets us get rid of the special row type
used for tips. With this patch, tips are now standard rows that use generic
buttons.

This approach should be compatible with the result menu, when we switch over to
it, because we can include the help and block commands in the menu when
`helpUrl` and `isBlockable` are defined, instead of creating buttons for them.
Labeled buttons -- the ones used in tips -- would still be created. The result
menu button itself can continue to be a generic button.

It should also be compatible with including the result menu button inside the
row selection. We'll still add buttons to `.urlbarView-row`, separate from
`.urlbarView-row-inner`, so that the buttons can continue to be on the right
side of the row. We can color the background of the row instead of the
row-inner.

As with D163630, my motivation for this change is to support generic buttons in
dynamic result rows so that help and block buttons can be easily added to
weather suggestions. Here too the larger changes of supporting generic labeled
buttons and removing special rows for tips aren't strictly necessary, but I took
the opportunity to rework things.

Finally, this makes a few other changes:

* It includes some of the more minor improvements to selection that I made in
  D163630.

* It removes the help URL code from quick actions since it was decided not to
  show a help button. Currently, the button is hidden in CSS, but now that a
  generic help button is added for dynamic result rows when
  `result.payload.helpUrl` is defined, `helpUrl` needs to be removed from the
  payload to prevent a button from being added.

* I removed the special tip wrapping behavior, where the tip button and help
  button would wrap below the tip's text. Instead, now the text wraps inside
  row-inner and the buttons always remain on the same horizontal as the text. I
  don't think it's worth the extra complication.

Differential Revision: https://phabricator.services.mozilla.com/D163766
2022-12-06 16:35:31 +00:00
Daisuke Akatsuka
e06da14970 Bug 1796017: Hide help button for QuickActions. r=daleharvey
Differential Revision: https://phabricator.services.mozilla.com/D159651
2022-10-27 02:04:03 +00:00
trickypr
4b9c23b007 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
f28fa5aa80 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
Daisuke Akatsuka
22b7b8178c Bug 1792195: Apply ellipsis style to label. r=daleharvey
Differential Revision: https://phabricator.services.mozilla.com/D158113
2022-09-27 20:38:36 +00:00
Mark Banner
79b9557a71 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
b7f6194b8d 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
5dcae1ed44 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
95ae6b7d0f 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
ff212fab8b 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
14ba76c156 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
Dale Harvey
d3477e331b Bug 1783762 - Dont wrap QuickActions unless in search mode. r=daisuke
Differential Revision: https://phabricator.services.mozilla.com/D157258
2022-09-14 10:20:02 +00:00
Daisuke Akatsuka
84d29dce54 Bug 1789631: Add title attribute to help button for QuickActions. r=daleharvey,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D157060
2022-09-13 20:02:49 +00:00
Daisuke Akatsuka
f5865ea133 Bug 1789593: Avoid showing all quick actions when inputing whitespace. r=daleharvey
Depends on D156769

Differential Revision: https://phabricator.services.mozilla.com/D156770
2022-09-13 20:01:11 +00:00
Daisuke Akatsuka
035f1275c3 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
Dale Harvey
f474d83ef8 Bug 1783155 - Add Scalar to inform which QuickActions are picked. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D155800
2022-09-11 22:22:24 +00:00
Daisuke Akatsuka
cc368efee6 Bug 1786976: Hide Inspect action button if DevTools is fully disabled. r=daleharvey
Differential Revision: https://phabricator.services.mozilla.com/D156247
2022-09-04 22:41:13 +00:00
Daisuke Akatsuka
b1c1e016b9 Bug 1784455: UrlbarProviderQuickActions.removeAction() removes from prefixes as well. r=daleharvey
Even if we called UrlbarProviderQuickActions.removeAction(), it did not remove
corresponding prefix from #prefixies. In this revision, make it work.

Differential Revision: https://phabricator.services.mozilla.com/D156047
2022-09-01 09:06:45 +00:00
Sandor Molnar
9c9afad24f Backed out changeset f1ccb5f067e4 (bug 1784455) for causing browser-chrome failures in browser/components/urlbar/tests/browser/browser_restoreEmptyInput.js CLOSED TREE 2022-09-01 10:25:35 +03:00
Daisuke Akatsuka
eea079ace2 Bug 1784455: UrlbarProviderQuickActions.removeAction() removes from prefixes as well. r=daleharvey
Even if we called UrlbarProviderQuickActions.removeAction(), it did not remove
corresponding prefix from #prefixies. In this revision, make it work.

Differential Revision: https://phabricator.services.mozilla.com/D156047
2022-09-01 06:26:50 +00:00
Marian-Vasile Laza
394e9a4eaf Backed out changeset 654379382e64 (bug 1783154) for causing bc failures on browser_restoreEmptyInput.js. CLOSED TREE 2022-08-30 18:59:43 +03:00
Dale Harvey
61a27ea08e Bug 1783154 - Add QuickAction to urlbar.picked Scalar. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D155514
2022-08-30 14:36:54 +00:00
Dale Harvey
93cc2e883c Bug 1784465 - Dont show duplicate QuickActions. r=daisuke
Differential Revision: https://phabricator.services.mozilla.com/D155261
2022-08-23 12:30:42 +00:00
Dale Harvey
5b3b730caa Bug 1779219 - Add onboarding link to QuickActions. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D154676
2022-08-18 12:53:56 +00:00
Dale Harvey
a599b2e8c6 Bug 1783452 - Add section in preferences to enable/disable QuickActions. r=adw,fluent-reviewers,preferences-reviewers,flod,mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D154795
2022-08-17 22:47:54 +00:00
Marian-Vasile Laza
90505c45a8 Backed out changeset 629fc32c6f5e (bug 1779219) for causing xpcshell failures on test_quickactions.js. CLOSED TREE 2022-08-18 01:47:00 +03:00
Dale Harvey
9d202554f0 Bug 1779219 - Add onboarding link to QuickActions. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D154676
2022-08-17 21:03:59 +00:00
Csoregi Natalia
2492031a14 Backed out changeset 8043340f122d (bug 1779219) for causing failures on browser_quickactions.js. CLOSED TREE 2022-08-17 00:29:04 +03:00
Dale Harvey
e0534980fc Bug 1779219 - Add onboarding link to QuickActions. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D154676
2022-08-16 20:43:52 +00:00
Dale Harvey
f5542c62ae Bug 1783644 - Dont show QuickActions in other search modes. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D154702
2022-08-16 09:01:37 +00:00
Dale Harvey
ca56d8b0fc Bug 1778132 - Rename quickactions pref and fix tests. r=Standard8,extension-reviewers,willdurand
Differential Revision: https://phabricator.services.mozilla.com/D153281
2022-08-03 00:26:29 +00:00
Dale Harvey
796458a4bb Bug 1781049 - Focus on content once QuickAction has been selected. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D152705
2022-08-01 22:16:59 +00:00
Dale Harvey
c7a5819bd5 Bug 1781112 - Enable matching full quickaction anywhere in user input. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D152678
2022-07-28 22:43:42 +00:00