fix: Fixed some issues before release, b=(no-bug), c=common, compact-mode, workspaces

This commit is contained in:
Mr. M 2025-05-02 23:39:14 +02:00
parent 8a72d253aa
commit d800c20905
No known key found for this signature in database
GPG key ID: 6292C4C8F8652B18
6 changed files with 74 additions and 43 deletions

View file

@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
index 6dece2b9d0462d90a28e75350ce983d87816ef73..a285c5cbc23eaeebc8248b950c0275645f8a5cd3 100644
index 6dece2b9d0462d90a28e75350ce983d87816ef73..4cc07f008d99138a76c8e9813c857c352b425006 100644
--- a/browser/components/tabbrowser/content/tabbrowser.js
+++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -415,11 +415,58 @@
@ -543,14 +543,14 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a285c5cbc23eaeebc8248b950c027564
if (unloadBlocked) {
return;
}
@@ -5247,6 +5409,7 @@
aExcludeTabs.push(FirefoxViewHandler.tab);
@@ -5248,6 +5410,7 @@
}
+ aExcludeTabs.push(...ZenWorkspaces.getTabsToExclude(aTab));
let excludeTabs = new Set(aExcludeTabs);
+ ZenWorkspaces.getTabsToExclude(aTab).forEach(tab => excludeTabs.add(tab));
// If this tab has a successor, it should be selectable, since
// hiding or closing a tab removes that tab as a successor.
@@ -5260,13 +5423,13 @@
!excludeTabs.has(aTab.owner) &&
Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose")

View file

@ -1,5 +1,5 @@
diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs
index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a87a77c58 100644
index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8d1a80e97fa711352d4b725f2d299a073dbae4db 100644
--- a/browser/components/urlbar/UrlbarInput.sys.mjs
+++ b/browser/components/urlbar/UrlbarInput.sys.mjs
@@ -68,6 +68,13 @@ XPCOMUtils.defineLazyPreferenceGetter(
@ -16,19 +16,24 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
const DEFAULT_FORM_HISTORY_NAME = "searchbar-history";
const SEARCH_BUTTON_CLASS = "urlbar-search-button";
@@ -349,7 +356,11 @@ export class UrlbarInput {
@@ -349,7 +356,16 @@ export class UrlbarInput {
// See _on_select(). HTMLInputElement.select() dispatches a "select"
// event but does not set the primary selection.
this._suppressPrimaryAdjustment = true;
+ this.document.getElementById("navigator-toolbox").setAttribute("supress-primary-adjustment", !this.document.getElementById("navigator-toolbox").hasAttribute("zen-has-hover"));
+ const zenToolbox = this.document.getElementById("navigator-toolbox");
+ zenToolbox.setAttribute("supress-primary-adjustment", !(
+ zenToolbox.hasAttribute("zen-has-hover") ||
+ zenToolbox.hasAttribute("zen-has-empty-tab") ||
+ zenToolbox.hasAttribute("zen-user-show")
+ ));
this.inputField.select();
+ this.document.ownerGlobal.setTimeout(() => {
+ this.document.getElementById("navigator-toolbox").removeAttribute("supress-primary-adjustment");
+ zenToolbox.removeAttribute("supress-primary-adjustment");
+ }, 1000);
this._suppressPrimaryAdjustment = false;
}
@@ -425,6 +436,10 @@ export class UrlbarInput {
@@ -425,6 +441,10 @@ export class UrlbarInput {
hideSearchTerms = false,
isSameDocument = false
) {
@ -39,20 +44,25 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
// We only need to update the searchModeUI on tab switch conditionally
// as we only persist searchMode with ScotchBonnet enabled.
if (
@@ -698,8 +713,11 @@ export class UrlbarInput {
@@ -698,8 +718,16 @@ export class UrlbarInput {
return;
}
}
-
+ this.document.getElementById("navigator-toolbox").setAttribute("supress-primary-adjustment", !this.document.getElementById("navigator-toolbox").hasAttribute("zen-has-hover"));
+ const zenToolbox = this.document.getElementById("navigator-toolbox");
+ zenToolbox.setAttribute("supress-primary-adjustment", !(
+ zenToolbox.hasAttribute("zen-has-hover") ||
+ zenToolbox.hasAttribute("zen-has-empty-tab") ||
+ zenToolbox.hasAttribute("zen-user-show")
+ ));
this.handleNavigation({ event });
+ this.document.ownerGlobal.setTimeout(() => {
+ this.document.getElementById("navigator-toolbox").removeAttribute("supress-primary-adjustment");
+ }, 200);
+ zenToolbox.removeAttribute("supress-primary-adjustment");
+ }, 1000);
}
/**
@@ -1093,7 +1111,11 @@ export class UrlbarInput {
@@ -1093,7 +1121,11 @@ export class UrlbarInput {
}
if (!this.#providesSearchMode(result)) {
@ -65,7 +75,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
}
this.controller.recordSelectedResult(event, result);
@@ -2125,6 +2147,10 @@ export class UrlbarInput {
@@ -2125,6 +2157,10 @@ export class UrlbarInput {
await this.#updateLayoutBreakoutDimensions();
}
@ -76,7 +86,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
startLayoutExtend() {
if (!this.#allowBreakout || this.hasAttribute("breakout-extend")) {
// Do not expand if the Urlbar does not support being expanded or it is
@@ -2147,6 +2173,13 @@ export class UrlbarInput {
@@ -2147,6 +2183,13 @@ export class UrlbarInput {
this.setAttribute("breakout-extend", "true");
@ -90,7 +100,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
// Enable the animation only after the first extend call to ensure it
// doesn't run when opening a new window.
if (!this.hasAttribute("breakout-extend-animate")) {
@@ -2166,6 +2199,19 @@ export class UrlbarInput {
@@ -2166,6 +2209,24 @@ export class UrlbarInput {
return;
}
@ -99,18 +109,23 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
+ }
+
+ // Arc like URLbar: Blur the input on exit
+ this.document.getElementById("navigator-toolbox").setAttribute("supress-primary-adjustment", !this.document.getElementById("navigator-toolbox").hasAttribute("zen-has-hover"));
+ const zenToolbox = this.document.getElementById("navigator-toolbox");
+ zenToolbox.setAttribute("supress-primary-adjustment", !(
+ zenToolbox.hasAttribute("zen-has-hover") ||
+ zenToolbox.hasAttribute("zen-has-empty-tab") ||
+ zenToolbox.hasAttribute("zen-user-show")
+ ));
+ this.window.gBrowser.selectedBrowser.focus();
+ this.window.setTimeout(() => {
+ this.document.getElementById("navigator-toolbox").removeAttribute("supress-primary-adjustment");
+ }, 100);
+ this.document.ownerGlobal.setTimeout(() => {
+ zenToolbox.removeAttribute("supress-primary-adjustment");
+ }, 1000);
+
+ this.removeAttribute("zen-floating-urlbar");
+
this.removeAttribute("breakout-extend");
this.#updateTextboxPosition();
}
@@ -2485,7 +2531,7 @@ export class UrlbarInput {
@@ -2485,7 +2546,7 @@ export class UrlbarInput {
this.textbox.parentNode.style.setProperty(
"--urlbar-container-height",
@ -119,7 +134,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
);
this.textbox.style.setProperty(
"--urlbar-height",
@@ -2998,7 +3044,7 @@ export class UrlbarInput {
@@ -2998,7 +3059,7 @@ export class UrlbarInput {
*/
_trimValue(val) {
let trimmedValue = lazy.UrlbarPrefs.get("trimURLs")
@ -128,7 +143,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
: val;
// Only trim value if the directionality doesn't change to RTL and we're not
// showing a strikeout https protocol.
@@ -3368,6 +3414,10 @@ export class UrlbarInput {
@@ -3368,6 +3429,10 @@ export class UrlbarInput {
}
reuseEmpty = true;
}
@ -139,7 +154,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
if (
where == "tab" &&
reuseEmpty &&
@@ -3375,6 +3425,9 @@ export class UrlbarInput {
@@ -3375,6 +3440,9 @@ export class UrlbarInput {
) {
where = "current";
}
@ -149,7 +164,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
return where;
}
@@ -3632,6 +3685,7 @@ export class UrlbarInput {
@@ -3632,6 +3700,7 @@ export class UrlbarInput {
this.setResultForCurrentValue(null);
this.handleCommand();
this.controller.clearLastQueryContextCache();
@ -157,7 +172,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
this._suppressStartQuery = false;
});
@@ -3639,7 +3693,6 @@ export class UrlbarInput {
@@ -3639,7 +3708,6 @@ export class UrlbarInput {
contextMenu.addEventListener("popupshowing", () => {
// Close the results pane when the input field contextual menu is open,
// because paste and go doesn't want a result selection.
@ -165,7 +180,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
let controller =
this.document.commandDispatcher.getControllerForCommand("cmd_paste");
@@ -4053,6 +4106,11 @@ export class UrlbarInput {
@@ -4053,6 +4121,11 @@ export class UrlbarInput {
}
_on_click(event) {
@ -177,7 +192,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
if (
event.target == this.inputField ||
event.target == this._inputContainer ||
@@ -4124,7 +4182,7 @@ export class UrlbarInput {
@@ -4124,7 +4197,7 @@ export class UrlbarInput {
}
}
@ -186,7 +201,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
this.view.autoOpen({ event });
} else {
if (this._untrimOnFocusAfterKeydown) {
@@ -4164,9 +4222,12 @@ export class UrlbarInput {
@@ -4164,9 +4237,12 @@ export class UrlbarInput {
}
_on_mousedown(event) {
@ -200,7 +215,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
if (
event.target != this.inputField &&
@@ -4176,8 +4237,8 @@ export class UrlbarInput {
@@ -4176,8 +4252,8 @@ export class UrlbarInput {
break;
}
@ -211,7 +226,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
// Keep the focus status, since the attribute may be changed
// upon calling this.focus().
@@ -4218,7 +4279,7 @@ export class UrlbarInput {
@@ -4218,7 +4294,7 @@ export class UrlbarInput {
}
// Don't close the view when clicking on a tab; we may want to keep the
// view open on tab switch, and the TabSelect event arrived earlier.

View file

@ -341,6 +341,8 @@ var gZenUIManager = {
}
gURLBar.handleRevert();
} else if (onElementPicked && onSwitch) {
this.clearUrlbarData();
}
if (gURLBar.focused) {

View file

@ -461,6 +461,10 @@ button.popup-notification-dropmarker {
#urlbar-container:has(&) {
border-radius: 10px;
background: var(--toolbarbutton-hover-background);
:root:not([zen-single-toolbar='true']) & {
max-height: 32px !important;
min-height: unset;
}
}
}
@ -526,7 +530,7 @@ button.popup-notification-dropmarker {
margin-right: 0 !important;
}
.urlbarView:not([action-override='true']) .urlbarView-row[type='switchtab'] .urlbarView-no-wrap {
.urlbarView:not([action-override='true']) .urlbarView-row:is([type='switchtab'], [type='clipboard']) .urlbarView-no-wrap {
width: 100%;
}

View file

@ -245,22 +245,31 @@ var gZenCompactModeManager = {
}
)
.then(() => {
if (gZenUIManager._hasSetSingleToolbar) {
gURLBar.textbox.style.visibility = 'visible';
}
this.sidebar.style.transition = 'none';
this.sidebar.style.opacity = 0;
const titlebar = document.getElementById('titlebar');
titlebar.style.visibility = 'hidden';
titlebar.style.transition = 'none';
this.sidebar.removeAttribute('animate');
document.documentElement.removeAttribute('zen-compact-animating');
this.getAndApplySidebarWidth({});
this._ignoreNextResize = true;
setTimeout(() => {
this.sidebar.removeAttribute('animate');
document.documentElement.removeAttribute('zen-compact-animating');
this.getAndApplySidebarWidth({});
this._ignoreNextResize = true;
this.sidebar.style.removeProperty('margin-right');
this.sidebar.style.removeProperty('margin-left');
this.sidebar.style.removeProperty('opacity');
this.sidebar.style.removeProperty('transition');
this.sidebar.style.removeProperty('transform');
titlebar.style.removeProperty('visibility');
titlebar.style.removeProperty('transition');
gURLBar.textbox.style.removeProperty('visibility');
resolve();
}, 0);
});
});
} else if (canHideSidebar && !isCompactMode) {
document.getElementById('browser').style.overflow = 'clip';

View file

@ -2775,7 +2775,8 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
(tab) =>
tab.getAttribute('zen-workspace-id') !== tabWorkspaceId &&
!tab.hasAttribute('zen-essential') &&
!(this.containerSpecificEssentials && tab.getAttribute('container') !== aTab.getAttribute('container'))
!(this.containerSpecificEssentials && tab.getAttribute('container') !== aTab.getAttribute('container')) &&
!tab.hasAttribute('zen-empty-tab')
);
}