Commit Graph

280 Commits

Author SHA1 Message Date
Daisuke Akatsuka
708d0195d5 Bug 1925532: Enter search mode without preview mode by key if there is single result r=daleharvey
Differential Revision: https://phabricator.services.mozilla.com/D226865
2024-11-11 22:19:45 +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
James Teow
935394d9f6 Bug 1927113 - Ensure persisted search doesn't show search mode from another tab - r=adw,urlbar-reviewers
this.searchMode can return null even if a search mode is shown
in the address bar, as the getter uses the current browser as the
context and attempts to use the state data. I try to solve this
by relying on the fact that a tab switch and invalid pageproxystate
results in restoring the search mode state.

Differential Revision: https://phabricator.services.mozilla.com/D228483
2024-11-08 23:04:24 +00:00
Marco Bonardo
f13efc6b93 Bug 1925496. r=jfkthame,adw
Differential Revision: https://phabricator.services.mozilla.com/D228315
2024-11-08 13:50:43 +00:00
Dale Harvey
d6bf7c5a2d Bug 1926241 - Provide tab-to-search results via actions. r=urlbar-reviewers,mak
Differential Revision: https://phabricator.services.mozilla.com/D227236
2024-11-08 13:35:12 +00:00
Alexandru Marc
e2fa59c2ee Backed out changeset 40518e514fc1 (bug 1925496) for causing bc failures @ browser_copying.js . CLOSED TREE 2024-11-08 14:51:02 +02:00
Marco Bonardo
4a15af511c Bug 1925496. r=jfkthame,adw
Differential Revision: https://phabricator.services.mozilla.com/D228315
2024-11-08 10:43:36 +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
Emilio Cobos Álvarez
a1ae05d74e Bug 1928255 - Fix bug 1927111 in a better way. r=urlbar-reviewers,mak
Keep using the static position as we did before. As long as we don't
have anchor positioning this seems better than whack-a-mole-ing every
possible urlbar position change.

In order to make the fullscreen animation work, make our position
computation ignore transforms, which is how anchor positioning would
behave anyways.

Differential Revision: https://phabricator.services.mozilla.com/D227758
2024-11-04 16:11:58 +00:00
Paul Zuehlcke
4922189f11 Bug 1927220 - Remove broken check for insert location in _initStripOnShare in UrlbarInput. r=urlbar-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D227480
2024-11-04 13:58:13 +00:00
Moritz Beier
4983a8b7fa Bug 1916499 - Add searchForm support back to OpenSearch engines. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D225968
2024-11-04 13:53:51 +00:00
Emilio Cobos Álvarez
303a90ea1b Bug 1928550 - Don't breakout on readonly urlbar. r=urlbar-reviewers,dao
This was a pre-existing issue that was only papered by chance.
this._toolbar is set before the early return for readonly urlbars, but
the ResizeObserver is only set up after it.

Be more explicit about when we allow breaking out of the container (and
effectively do it only for non-readonly urlbars).

Differential Revision: https://phabricator.services.mozilla.com/D227760
2024-11-04 10:11:07 +00:00
Alexandru Marc
5a5f7b93df Backed out 2 changesets (bug 1916505, bug 1916499) for causing bc failures @ browser_oneOffContextMenu.js
Backed out changeset dbd2ce7823c2 (bug 1916505)
Backed out changeset 5082d347bbf7 (bug 1916499)
2024-10-31 16:05:29 +02:00
Moritz Beier
36f3384408 Bug 1916499 - Add searchForm support back to OpenSearch engines. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D225968
2024-10-31 13:01:12 +00:00
Emilio Cobos Álvarez
6e6b254c42 Bug 1927111 - Shift urlbar during macOS fullscreen animation. r=Gijs,sfoster,urlbar-reviewers,mak
See comment for sadness.

Differential Revision: https://phabricator.services.mozilla.com/D226933
2024-10-30 13:09:46 +00:00
Emilio Cobos Álvarez
2b95871a34 Bug 1927111 - Don't rely on static position (top: auto) for urlbar position. r=Gijs,sfoster,desktop-theme-reviewers,urlbar-reviewers,mak
The static position of these boxes is not great to depend upon, see:

  https://github.com/w3c/csswg-drafts/issues/9939

Right now, we are relying on the static pos to be properly set which is
going to go away, eventually, and it is bogus, because it doesn't update
if e.g. only transform changes.

Use getBoxQuads to get the content box bounds properly. Also, make
breakout position: absolute explicitly, to prevent confusion.

Differential Revision: https://phabricator.services.mozilla.com/D226932
2024-10-30 13:09:46 +00:00
Butkovits Atila
2271d1135d Backed out changeset 6668994ba84c (bug 1925532) for causing failures at browser_ime_composition.js. CLOSED TREE 2024-10-30 06:45:52 +02:00
Daisuke Akatsuka
2aeaf78698 Bug 1925532: Enter search mode without preview mode by KEY_Tab, VK_RIGHT and VK_DOWN r=daleharvey
Differential Revision: https://phabricator.services.mozilla.com/D226865
2024-10-30 02:58:57 +00:00
Butkovits Atila
f2d9be08fd Backed out 2 changesets (bug 1927111) for causing failures at browser_add_search_engine.js. CLOSED TREE
Backed out changeset b12f12db6d50 (bug 1927111)
Backed out changeset 8afe68ed6509 (bug 1927111)
2024-10-30 02:27:06 +02:00
Emilio Cobos Álvarez
826ab1afd3 Bug 1927111 - Shift urlbar during macOS fullscreen animation. r=Gijs,sfoster,urlbar-reviewers,mak
See comment for sadness.

Differential Revision: https://phabricator.services.mozilla.com/D226933
2024-10-29 22:03:22 +00:00
Emilio Cobos Álvarez
80dcdf14de Bug 1927111 - Don't rely on static position (top: auto) for urlbar position. r=Gijs,sfoster,desktop-theme-reviewers,urlbar-reviewers,mak
The static position of these boxes is not great to depend upon, see:

  https://github.com/w3c/csswg-drafts/issues/9939

Right now, we are relying on the static pos to be properly set which is
going to go away, eventually, and it is bogus, because it doesn't update
if e.g. only transform changes.

Use getBoxQuads to get the content box bounds properly. Also, make
breakout position: absolute explicitly, to prevent confusion.

Differential Revision: https://phabricator.services.mozilla.com/D226932
2024-10-29 22:03:22 +00:00
Marco Bonardo
631e8d05ce Bug 1912416 - Ctrl+Shift+Left in the Address Bar should not unselect all. r=urlbar-reviewers,daisuke
Differential Revision: https://phabricator.services.mozilla.com/D226684
2024-10-29 09:50:07 +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
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
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
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
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
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
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
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
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
James Teow
728cf35f79 Bug 1915273 - Allow revert button to always show until search terms change and fix keyboard focus - r=adw,desktop-theme-reviewers,urlbar-reviewers,dao
The main purpose of this patch is to make the visibility of the revert button consistent to make it more accessible. After talking with Josh, we agreed the revert icon should always show in an `invalid` pageproxystate until `userTypedValue` differs from the search string. Doing so will make the Revert button be more predictable for keyboard users instead of hiding it when the input field is focused and then showing it again when they press tab (or not making it focusable at all).

The Go button (the right arrow button) will show up again once the user has modified the search terms. I didn't think this would be much of an issue since the Go arrow is not focusable by keyboard, it's not visible when the address bar is not focused, and "Enter" is a well known shortcut to doing the same function.

This involved checking when `persistsearchterms` was changed to `false` and removing it to instead remove `persistsearchterms` when the search terms changed. This is reflected in the new expected behavior in the tests.

One issue was adding `focus` to the revert button via CSS caused focus issues. Tabbing from the left elements (reload button) to the input would skip the input altogether and go straight to the revert button and then to the Save to Pocket button. Pressing shift + tab to try and go back from the revert button to the input would get stuck in a loop between the input field and revert button. This was fixed with `<toolbartabstop/>` . I created a hideable container to ensure the tabstop only exists when the `persistsearchterms` state is active. And the new test checks that the tab behaviour is consistent.

Lastly, because keyboard users might press the Revert button, focusing the input seemed like a logical choice, or else when the focus is lost the user would need to tab all the way back to the input to do more actions. There is also an initiative to move inline Javascript out from markup.

Differential Revision: https://phabricator.services.mozilla.com/D223423
2024-09-25 22:07:11 +00:00
James Teow
2423c61e3e Bug 1920493 - Clear search mode in Persisted Search when loading a default SERP - r=adw,urlbar-reviewers
In the patch where I ensure the correct `searchMode` is added, I didn't consider the possibility a user could return to a default SERP. Thus, if there was a search mode chiclet, it should be cleared.

Differential Revision: https://phabricator.services.mozilla.com/D223141
2024-09-24 03:32:02 +00:00
abhishekmadan30
9605ca52bd Bug 1895334 - Grey out Copy without Site Tracking option when nothing can be stripped. r=pbz,urlbar-reviewers,anti-tracking-reviewers,dao
Co-authored-by: Manuel Bucher <manuel@mozilla.com>

Differential Revision: https://phabricator.services.mozilla.com/D215815
2024-09-23 22:11:50 +00:00
mcheang
38e8fa20a9 Bug 1917992 - Add scalar telemetry for picked restrict keyword result and glean telemetry for abandonment and engagement. r=mak,urlbar-reviewers
This patch adds telemetry for when the user sees or interacts with restrict keyword results.
Following is an overview of the interactions that will trigger the telemetry to be recorded:

When the user types `@` and selects one of the restrict results, the scalar telemetry will be recorded:

  - `urlbar.picked.restrict_keyword_tabs`
  - `urlbar.picked.restrict_keyword_bookmarks`
  - `urlbar.picked.restrict_keyword_history`
  - `urlbar.picked.restrict_keyword_actions`

For example, we can select the tabs result in multiple ways for the telemetry to be recorded:
  - type`@` and click on tabs result
  - type`@` and arrow down to tabs result and press enter
  - type partial keyword `@t` and press enter to autofill
  - type partial keyword `@t` and press tab and then enter


When the user types `@` and **does not** select one of the restrict results, the glean abandonment will be recorded:
```
    groups:
      "general,general,general,general,general,general,restrict_keyword,restrict_keyword,restrict_keyword,restrict_keyword",
    results:
      "search_engine,search_engine,search_engine,search_engine,search_engine,search_engine,restrict_keyword_bookmarks,restrict_keyword_tabs,restrict_keyword_history,restrict_keyword_actions",
```

When the user types `@` and **does** select one of the restrict results, the glean engagement will be recorded:
```
    groups:
      "general,general,general,general,general,general,restrict_keyword,restrict_keyword,restrict_keyword,restrict_keyword",
    results:
       "search_engine,search_engine,search_engine,search_engine,search_engine,search_engine,restrict_keyword_bookmarks,restrict_keyword_tabs,restrict_keyword_history,restrict_keyword_actions",
    selected_result: `restrict_keyword_${category}`,
```

For the `selected_result` in engagement telemetry, the `category` variable will be `tabs, bookmarks, history, or actions`.

Differential Revision: https://phabricator.services.mozilla.com/D222355
2024-09-23 18:21:41 +00:00
James Teow
9f2653fd25 Bug 1913312 - Enable Persisted Search for non-default app provided search engines - r=adw,urlbar-reviewers
There's two main changes:

- Change `getSearchTermIfDefaultSerpUri` to enable it work for any app-provided engine.
- Show the correct Search Chicklet / Unified Search Mode Chicklet when the user loads a non-default SERP. Recall that Persisted Search is enabled in Nightly independent of Scotch Bonnet.

**Issue 1:**

 `this.searchMode` is not always known or consistent with the non-default search page when `setURI` is called.

Some scenarios:

- Clear search mode, switch tab, return to the original. The absence of search mode seems acceptable because the user was potentially in the middle of modifying their search or navigating to a URL.
- Clear search mode and reload a non-default SERP.
- Switch search mode, but reload non-default SERP.
- Go back/forward in tabhistory to return to a non-default SERP.

In the latter three cases, if the search terms were to persist again, I'd expect the most accurate search mode to be present.

**Issue 2:**

`userTypedValue` has been used as an indicator for whether or not search terms should persist. However, entering search mode causes userTypedValue to have a value, so that it can be restored when switching back to the current tab and across sessions. Thus, on blur, I have a slightly more complicated check to ensure the revert button is consistent regardless of whether the engine is default or non-default.

**Issue 3:**

Lastly, it's possible for the revert button to show up when switching from tab to tab while the address bar is focused. I added an additional check in this patch since it's a small addition, but I can move it out if it overcomplicates things.

I'm not 100% confident my solution is ideal since I ended up having to add hacky awaits in `browser_UrlbarInput_searchTerms_searchMode.js` for the search mode to appear...

Differential Revision: https://phabricator.services.mozilla.com/D222846
2024-09-20 19:59:45 +00:00
Marco Bonardo
4af32e7c32 Bug 1898155 - Untrim URL in the address bar immediately when focused by keyboard. r=jteow,urlbar-reviewers
When focusing the urlbar with the mouse we must avoid modifying or
shifting the URL to support operations like double-click or drag to select.
When focusing with the keyboard though we don't have such restrictions
and we can make editing and selection more visually coherent.
This patch is not intercepting commands on mainKeyset, because F6 and
TAB bypass all of that. We instead detect focus following a keydown,
though we must avoid untrimming on TabSelect shortcuts.
Note direct calls to .focus() without a peripheral follow the mouse
behavior, because code (external callers) and tests rely on that.

Differential Revision: https://phabricator.services.mozilla.com/D222138
2024-09-18 14:12:05 +00:00
James Teow
d5710cd89a Bug 1919193 - Simplify Persisted Search UI - r=adw,desktop-theme-reviewers,urlbar-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D222489
2024-09-18 04:44:31 +00:00
Marco Bonardo
c9cadb9fef Bug 1909189 - Don't shift URL in the Address Bar on mouse focus, delay DOM changes to the first input event. r=jteow,daleharvey,desktop-theme-reviewers,urlbar-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D221031
2024-09-16 08:30:48 +00:00
Daisuke Akatsuka
b4f5e812ce Bug 1915250: Open search engine page directly if click/enter with shiftKey r=daleharvey
Differential Revision: https://phabricator.services.mozilla.com/D221003
2024-09-13 22:08:26 +00:00
Dale Harvey
e230b4cd2c Bug 1917186 - Escape searchMode when uses presses Esc. r=daisuke,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D221800
2024-09-13 20:27:31 +00:00
Dale Harvey
b0ce3c14e9 Bug 1893071 - Enter searchMode when using contextual search. r=Standard8,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D220071
2024-09-03 15:11:11 +00:00
Jason Prickett
6d13ee8ae8 Bug 1912351 - Create onSearch trigger and targeting r=mviar,omc-reviewers,urlbar-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D219519
2024-08-27 16:46:02 +00:00