feat: New urlbar UI, b=no-bug, c=common

This commit is contained in:
mr. m
2025-09-15 18:03:31 +02:00
parent 541bafd121
commit d4139f0312
5 changed files with 34 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/urlbar/UrlbarView.sys.mjs b/browser/components/urlbar/UrlbarView.sys.mjs
index fdbab8806fd320f4aacec46a42c8ef953580d00c..9d8db6ecc29709043488d57c213dc2a87c4a994e 100644
index fdbab8806fd320f4aacec46a42c8ef953580d00c..c7fd607cc1e3ec4db2d5300a420c9de5f5ac6c0d 100644
--- a/browser/components/urlbar/UrlbarView.sys.mjs
+++ b/browser/components/urlbar/UrlbarView.sys.mjs
@@ -613,7 +613,7 @@ export class UrlbarView {
@@ -11,10 +11,17 @@ index fdbab8806fd320f4aacec46a42c8ef953580d00c..9d8db6ecc29709043488d57c213dc2a8
// Try to reuse the cached top-sites context. If it's not cached, then
// there will be a gap of time between when the input is focused and
// when the view opens that can be perceived as flicker.
@@ -824,6 +824,15 @@ export class UrlbarView {
@@ -824,6 +824,22 @@ export class UrlbarView {
// still associated with the first result.
this.input.setResultForCurrentValue(firstResult);
}
+ if (queryContext.results[0].payload.zenAction) {
+ this.#selectElement(this.getFirstSelectableElement(), {
+ updateInput: false,
+ setAccessibleFocus:
+ this.controller._userSelectionBehavior == "arrow",
+ });
+ }
+ this.window.setTimeout(() => {
+ if (queryContext.results[0].payload.zenAction) {
+ this.#selectElement(this.getFirstSelectableElement(), {
@@ -27,7 +34,16 @@ index fdbab8806fd320f4aacec46a42c8ef953580d00c..9d8db6ecc29709043488d57c213dc2a8
}
// Announce tab-to-search results to screen readers as the user types.
@@ -3189,7 +3198,7 @@ export class UrlbarView {
@@ -2706,6 +2722,8 @@ export class UrlbarView {
if (row?.hasAttribute("row-selectable")) {
row?.toggleAttribute("selected", true);
}
+ // only scroll if its not already fully visible
+ element.scrollIntoView({ behavior: "smooth", block: "nearest" });
if (element != row) {
row?.toggleAttribute("descendant-selected", true);
}
@@ -3189,7 +3207,7 @@ export class UrlbarView {
}
#enableOrDisableRowWrap() {