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

@@ -22,9 +22,6 @@
- name: browser.urlbar.untrimOnUserInteraction.featureGate
value: true
- name: browser.urlbar.maxRichResults
value: 6
# Enable private suggestions
- name: browser.search.suggest.enabled
value: false

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() {

View File

@@ -651,6 +651,14 @@ button.popup-notification-dropmarker {
}
}
#urlbar-results .action-contextualidentity {
display: none;
#urlbar-results {
max-height: 262px;
overflow-y: auto;
scrollbar-width: none;
margin-block: var(--urlbarView-results-padding);
padding-block: 0 !important;
& .action-contextualidentity {
display: none;
}
}

View File

@@ -6,7 +6,7 @@
panel[type='arrow'] {
@media (-moz-platform: macos) and (-moz-panel-animations) {
&[animate='open'] {
animation: zen-jello-animation-macos 0.3s ease-out forwards;
animation: zen-jello-animation-macos 0.2s ease-out forwards;
&[side='bottom'] {
/* Animate from the bottom */
-zen-window-transform-origin: 0 100%;

View File

@@ -96,6 +96,10 @@ export class ZenUrlbarProviderGlobalActions extends UrlbarProvider {
async #getExtensionActions(window) {
const addons = await lazy.AddonManager.getAddonsByTypes(['extension']);
if (window.gBrowser.selectedTab.hasAttribute('zen-empty-tab')) {
// Don't show extension actions on empty tabs, as extensions can't run there.
return [];
}
return addons
.filter(
(addon) =>