From d21e127bd7c05d8ed89b8776260b1d01ce84dca3 Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Mon, 20 Oct 2025 12:35:49 +0200 Subject: [PATCH 01/52] feat: Make the top buttons smaller in height, b=no-bug, c=tabs --- .../components/customizableui/CustomizableUI-sys-mjs.patch | 4 ++-- src/zen/tabs/zen-tabs/vertical-tabs.css | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/browser/components/customizableui/CustomizableUI-sys-mjs.patch b/src/browser/components/customizableui/CustomizableUI-sys-mjs.patch index be5a545f9..e3a48d688 100644 --- a/src/browser/components/customizableui/CustomizableUI-sys-mjs.patch +++ b/src/browser/components/customizableui/CustomizableUI-sys-mjs.patch @@ -1,5 +1,5 @@ diff --git a/browser/components/customizableui/CustomizableUI.sys.mjs b/browser/components/customizableui/CustomizableUI.sys.mjs -index d9a059f608779fea7cd8c595a432f6fe95183e0c..09a7c4045afd0b96027d0bbbad22e02e52fd7b22 100644 +index d9a059f608779fea7cd8c595a432f6fe95183e0c..31c43bc3d5b05713299c1b822b9774909445e862 100644 --- a/browser/components/customizableui/CustomizableUI.sys.mjs +++ b/browser/components/customizableui/CustomizableUI.sys.mjs @@ -14,6 +14,7 @@ ChromeUtils.defineESModuleGetters(lazy, { @@ -158,7 +158,7 @@ index d9a059f608779fea7cd8c595a432f6fe95183e0c..09a7c4045afd0b96027d0bbbad22e02e continue; } - sum += parseFloat(style.marginLeft) + parseFloat(style.marginRight); -+ sum += parseFloat(style.marginLeft) + Math.max(0, parseFloat(style.marginRight)); ++ sum += parseFloat(style.marginLeft) + (win.gZenVerticalTabsManager._hasSetSingleToolbar ? Math.max(0, parseFloat(style.marginRight)) : parseFloat(style.marginRight)); if (child != aExceptChild) { sum += getInlineSize(child); } diff --git a/src/zen/tabs/zen-tabs/vertical-tabs.css b/src/zen/tabs/zen-tabs/vertical-tabs.css index 9d26c940f..7b97ab7ac 100644 --- a/src/zen/tabs/zen-tabs/vertical-tabs.css +++ b/src/zen/tabs/zen-tabs/vertical-tabs.css @@ -963,7 +963,7 @@ :root[zen-single-toolbar='true'] & { --zen-toolbar-height: 36px; @media (-moz-platform: macos) { - --zen-toolbar-height: 42px; + --zen-toolbar-height: 38px; } & #PanelUI-button { From a53b4f9c94110f00838b06194db099862eb23f78 Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com> Date: Mon, 20 Oct 2025 17:12:41 +0200 Subject: [PATCH 02/52] chore: New translations zen-general.ftl (German), p=#10882 --- locales/de/browser/browser/zen-general.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/de/browser/browser/zen-general.ftl b/locales/de/browser/browser/zen-general.ftl index ac70d5555..d62119a31 100644 --- a/locales/de/browser/browser/zen-general.ftl +++ b/locales/de/browser/browser/zen-general.ftl @@ -38,7 +38,7 @@ zen-library-sidebar-workspaces = zen-library-sidebar-mods = .label = Mods zen-toggle-compact-mode-button = - .label = Compact Mode + .label = Kompakter Modus .tooltiptext = Compact Mode umschalten # note: Do not translate the "
" tags in the following string From c883572de8484f6c2713aa71ba2eb975e67d9ad0 Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com> Date: Mon, 20 Oct 2025 17:17:59 +0200 Subject: [PATCH 03/52] feat: Make use of the has polyfill for toolbar compact mode, p=#10883, c=compact-mode, tabs, workspaces --- src/zen/common/ZenHasPolyfill.mjs | 4 +-- src/zen/compact-mode/ZenCompactMode.mjs | 21 +++++++++++--- src/zen/compact-mode/toolbar.inc.css | 12 ++++---- .../zen-tabs/vertical-tabs-topbar.inc.css | 4 +-- src/zen/workspaces/ZenGradientGenerator.mjs | 28 +++++++------------ 5 files changed, 35 insertions(+), 34 deletions(-) diff --git a/src/zen/common/ZenHasPolyfill.mjs b/src/zen/common/ZenHasPolyfill.mjs index 1f50dc4f2..4513033e9 100644 --- a/src/zen/common/ZenHasPolyfill.mjs +++ b/src/zen/common/ZenHasPolyfill.mjs @@ -24,11 +24,11 @@ const { exists: shouldExist = true } = descendantSelectors; if (exists === shouldExist) { if (!element.hasAttribute(stateAttribute)) { - element.setAttribute(stateAttribute, 'true'); + gZenCompactModeManager._setElementExpandAttribute(element, true, stateAttribute); } } else { if (element.hasAttribute(stateAttribute)) { - element.removeAttribute(stateAttribute); + gZenCompactModeManager._setElementExpandAttribute(element, false, stateAttribute); } } }; diff --git a/src/zen/compact-mode/ZenCompactMode.mjs b/src/zen/compact-mode/ZenCompactMode.mjs index 6e691f507..685607190 100644 --- a/src/zen/compact-mode/ZenCompactMode.mjs +++ b/src/zen/compact-mode/ZenCompactMode.mjs @@ -143,6 +143,7 @@ var gZenCompactModeManager = { }, addHasPolyfillObserver() { + const attributes = ['panelopen', 'open', 'breakout-extend', 'zen-floating-urlbar']; this.sidebarObserverId = ZenHasPolyfill.observeSelectorExistence( this.sidebar, [ @@ -152,8 +153,21 @@ var gZenCompactModeManager = { }, ], 'zen-compact-mode-active', - ['panelopen', 'open', 'breakout-extend', 'zen-floating-urlbar'] + attributes ); + this.toolbarObserverId = ZenHasPolyfill.observeSelectorExistence( + document.getElementById('zen-appcontent-navbar-wrapper'), + [ + { + selector: + ":is([panelopen='true'], [open='true'], #urlbar:focus-within, [breakout-extend='true']):not(.zen-compact-mode-ignore)", + }, + ], + 'zen-compact-mode-active', + attributes + ); + // Always connect this observer, we need it even if compact mode is disabled + ZenHasPolyfill.connectObserver(this.toolbarObserverId); }, flashSidebarIfNecessary(aInstant = false) { @@ -601,7 +615,7 @@ var gZenCompactModeManager = { }, _setElementExpandAttribute(element, value, attr = 'zen-has-hover') { - const kVerifiedAttributes = ['zen-has-hover', 'has-popup-menu']; + const kVerifiedAttributes = ['zen-has-hover', 'has-popup-menu', 'zen-compact-mode-active']; const isToolbar = element.id === 'zen-appcontent-navbar-wrapper'; if (value) { element.setAttribute(attr, 'true'); @@ -612,8 +626,7 @@ var gZenCompactModeManager = { document.documentElement.hasAttribute('zen-has-bookmarks'))) || (this.preference && Services.prefs.getBoolPref('zen.view.compact.hide-toolbar') && - !gZenVerticalTabsManager._hasSetSingleToolbar && - !gURLBar.hasAttribute('breakout-extend'))) + !gZenVerticalTabsManager._hasSetSingleToolbar)) ) { gBrowser.tabpanels.setAttribute('has-toolbar-hovered', 'true'); } diff --git a/src/zen/compact-mode/toolbar.inc.css b/src/zen/compact-mode/toolbar.inc.css index 44554528c..db1a81a00 100644 --- a/src/zen/compact-mode/toolbar.inc.css +++ b/src/zen/compact-mode/toolbar.inc.css @@ -48,13 +48,11 @@ } } - & #zen-appcontent-navbar-wrapper[zen-has-hover], - & #zen-appcontent-navbar-wrapper[has-popup-menu], - & - #zen-appcontent-navbar-wrapper:has( - *:is([panelopen='true'], [open='true'], #urlbar:focus-within, [breakout-extend='true']):not(.zen-compact-mode-ignore) - ) { - + & #zen-appcontent-navbar-wrapper:is( + [zen-has-hover], + [has-popup-menu], + [zen-compact-mode-active] + ) { height: var(--zen-toolbar-height-with-bookmarks); overflow: inherit; diff --git a/src/zen/tabs/zen-tabs/vertical-tabs-topbar.inc.css b/src/zen/tabs/zen-tabs/vertical-tabs-topbar.inc.css index 791d52044..1ceac456b 100644 --- a/src/zen/tabs/zen-tabs/vertical-tabs-topbar.inc.css +++ b/src/zen/tabs/zen-tabs/vertical-tabs-topbar.inc.css @@ -22,9 +22,7 @@ z-index: 1; %include ../../compact-mode/windows-captions-fix-active.inc.css - &:not([zen-has-hover='true']):not([has-popup-menu]):not(:focus-within):not( - :has(*:is([panelopen='true'], [open='true'])) - ) { + &:not([zen-has-hover='true']):not([has-popup-menu]):not([zen-compact-mode-active]) { height: var(--zen-element-separation); opacity: 0; & #zen-appcontent-navbar-container { diff --git a/src/zen/workspaces/ZenGradientGenerator.mjs b/src/zen/workspaces/ZenGradientGenerator.mjs index 557e769ba..28f79ce52 100644 --- a/src/zen/workspaces/ZenGradientGenerator.mjs +++ b/src/zen/workspaces/ZenGradientGenerator.mjs @@ -1305,12 +1305,13 @@ // Do not rebuild if the workspace is not the same as the current one const windowWorkspace = await browser.gZenWorkspaces.getActiveWorkspace(); - if (windowWorkspace.uuid !== uuid && theme !== null) { + if (windowWorkspace.uuid !== uuid) { return; } // get the theme from the window workspaceTheme = this.fixTheme(theme || windowWorkspace.theme); + const docElement = browser.document.documentElement; if (!skipUpdate) { for (const dot of browser.gZenThemePicker.panel.querySelectorAll( @@ -1328,17 +1329,15 @@ } if (!skipUpdate) { - browser.document.documentElement.style.setProperty( + docElement.style.setProperty( '--zen-main-browser-background-old', - browser.document.documentElement.style.getPropertyValue('--zen-main-browser-background') + docElement.style.getPropertyValue('--zen-main-browser-background') ); - browser.document.documentElement.style.setProperty( + docElement.style.setProperty( '--zen-main-browser-background-toolbar-old', - browser.document.documentElement.style.getPropertyValue( - '--zen-main-browser-background-toolbar' - ) + docElement.style.getPropertyValue('--zen-main-browser-background-toolbar') ); - browser.document.documentElement.style.setProperty( + docElement.style.setProperty( '--zen-background-opacity', browser.gZenThemePicker.previousBackgroundOpacity ?? 1 ); @@ -1461,16 +1460,9 @@ } } - browser.document.documentElement.style.setProperty( - '--zen-main-browser-background-toolbar', - gradientToolbar - ); - browser.document.documentElement.style.setProperty( - '--zen-main-browser-background', - gradient - ); + docElement.style.setProperty('--zen-main-browser-background-toolbar', gradientToolbar); + docElement.style.setProperty('--zen-main-browser-background', gradient); const isDarkModeWindow = browser.gZenThemePicker.isDarkMode; - const docElement = browser.document.documentElement; if (isDefaultTheme) { docElement.setAttribute('zen-default-theme', 'true'); } else { @@ -1499,7 +1491,7 @@ } // Set `--toolbox-textcolor` to have a contrast with the primary color const textColor = this.getToolbarColor(isDarkMode); - document.documentElement.style.setProperty( + docElement.style.setProperty( '--toolbox-textcolor', `rgba(${textColor[0]}, ${textColor[1]}, ${textColor[2]}, ${textColor[3]})` ); From 34424a8f95f93ce91312e43523534829578c2ee8 Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com> Date: Mon, 20 Oct 2025 17:35:49 +0200 Subject: [PATCH 04/52] fix: Fixed the urlbar not always hiding on compact mode, p=#10884, c=compact-mode --- src/zen/compact-mode/toolbar.inc.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/zen/compact-mode/toolbar.inc.css b/src/zen/compact-mode/toolbar.inc.css index db1a81a00..96f7d478a 100644 --- a/src/zen/compact-mode/toolbar.inc.css +++ b/src/zen/compact-mode/toolbar.inc.css @@ -35,7 +35,8 @@ overflow: clip; & #urlbar:not([breakout-extend='true']) { - opacity: 0; + /* Sometimes, "opacity: 1" is forced elsewhere */ + opacity: 0 !important; pointer-events: none; transition: opacity var(--zen-hidden-toolbar-transition); } @@ -59,7 +60,7 @@ %include windows-captions-fix-active.inc.css & #urlbar { - opacity: 1; + opacity: 1 !important; pointer-events: auto; } From f8375a11559e4f22be4a45984df7ea569678831c Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Mon, 20 Oct 2025 18:44:25 +0200 Subject: [PATCH 05/52] feat: Dont wait for the next frame to animate, b=no-bug, c=glance --- src/zen/glance/ZenGlanceManager.mjs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/zen/glance/ZenGlanceManager.mjs b/src/zen/glance/ZenGlanceManager.mjs index fae7e233d..e682d05b0 100644 --- a/src/zen/glance/ZenGlanceManager.mjs +++ b/src/zen/glance/ZenGlanceManager.mjs @@ -328,9 +328,7 @@ data.elementData = await this.#getElementPreviewData(data); } this.#glances.get(this.#currentGlanceID).elementData = data.elementData; - window.requestAnimationFrame(() => { - this.#executeGlanceAnimation(data, browserElement, resolve); - }); + this.#executeGlanceAnimation(data, browserElement, resolve); }); } From b63cefa98b3075cb46ac7f46114b02b5424beca6 Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com> Date: Mon, 20 Oct 2025 20:35:12 +0200 Subject: [PATCH 06/52] feat: Glance preview should not take the full height of the container, p=#10886, c=glance --- src/zen/glance/ZenGlanceManager.mjs | 2 +- src/zen/glance/zen-glance.css | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/zen/glance/ZenGlanceManager.mjs b/src/zen/glance/ZenGlanceManager.mjs index e682d05b0..92f5a4ee1 100644 --- a/src/zen/glance/ZenGlanceManager.mjs +++ b/src/zen/glance/ZenGlanceManager.mjs @@ -988,7 +988,7 @@ if (!onTabClose) { this.quickCloseGlance({ clearID: false }); } - this.browserWrapper.style.display = 'none'; + this.overlay.style.display = 'none'; this.overlay.removeAttribute('fade-out'); this.browserWrapper.removeAttribute('animate'); diff --git a/src/zen/glance/zen-glance.css b/src/zen/glance/zen-glance.css index b35e16758..92ac15c9e 100644 --- a/src/zen/glance/zen-glance.css +++ b/src/zen/glance/zen-glance.css @@ -171,10 +171,10 @@ position: absolute; pointer-events: none; width: 100%; - height: 100%; z-index: 0; border-radius: var(--zen-native-inner-radius); - inset: 50%; - translate: -50% -50%; + top: 0%; + left: 50%; + translate: -50% 0%; will-change: transform, opacity; } From 5038bd5cf7a1fcaae8901ed313000e5d33612dec Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com> Date: Mon, 20 Oct 2025 23:06:57 +0200 Subject: [PATCH 07/52] feat: Only disable toolbar compact instead of hiding it, p=#10887, c=compact-mode --- src/zen/compact-mode/ZenCompactMode.mjs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/zen/compact-mode/ZenCompactMode.mjs b/src/zen/compact-mode/ZenCompactMode.mjs index 685607190..514bc9aea 100644 --- a/src/zen/compact-mode/ZenCompactMode.mjs +++ b/src/zen/compact-mode/ZenCompactMode.mjs @@ -216,7 +216,7 @@ var gZenCompactModeManager = { }, updateCompactModeContext(isSingleToolbar) { - isSingleToolbar ||= this.checkIfIllegalState(); + const isIllegalState = this.checkIfIllegalState(); const menuitem = document.getElementById('zen-context-menu-compact-mode-toggle'); const menu = document.getElementById('zen-context-menu-compact-mode'); if (isSingleToolbar) { @@ -226,6 +226,14 @@ var gZenCompactModeManager = { menu.removeAttribute('hidden'); menu.querySelector('menupopup').prepend(menuitem); } + const hideToolbarMenuItem = document.getElementById( + 'zen-context-menu-compact-mode-hide-toolbar' + ); + if (isIllegalState) { + hideToolbarMenuItem.setAttribute('disabled', 'true'); + } else { + hideToolbarMenuItem.removeAttribute('disabled'); + } }, hideSidebar() { From 346ef9c1583e5d29b3761d29a0a655a7f6b946f0 Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Tue, 21 Oct 2025 00:03:43 +0200 Subject: [PATCH 08/52] feat: Dont hide browsers with pending paints and align autmatic glance to the tabs panel, b=no-bug, c=glance --- .../themes/shared/tabbrowser/content-area-css.patch | 12 ++++++++++-- src/zen/glance/ZenGlanceManager.mjs | 6 +++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/browser/themes/shared/tabbrowser/content-area-css.patch b/src/browser/themes/shared/tabbrowser/content-area-css.patch index dd1164699..d7f0e2ec5 100644 --- a/src/browser/themes/shared/tabbrowser/content-area-css.patch +++ b/src/browser/themes/shared/tabbrowser/content-area-css.patch @@ -1,8 +1,16 @@ diff --git a/browser/themes/shared/tabbrowser/content-area.css b/browser/themes/shared/tabbrowser/content-area.css -index e06addf1602dc26ff4e75a8db6251231690f3f80..86e2cd0194bb37fa140a2f93eccfdd61419a9aec 100644 +index e06addf1602dc26ff4e75a8db6251231690f3f80..ffac005d5040852eda8f574f65f2eadf5ecbd642 100644 --- a/browser/themes/shared/tabbrowser/content-area.css +++ b/browser/themes/shared/tabbrowser/content-area.css -@@ -276,7 +276,7 @@ +@@ -134,7 +134,6 @@ + } + + browser:is([blank], [pendingpaint]) { +- opacity: 0; + } + + browser[type="content"] { +@@ -276,7 +275,7 @@ .dialogStack { z-index: var(--browser-stack-z-index-dialog-stack); diff --git a/src/zen/glance/ZenGlanceManager.mjs b/src/zen/glance/ZenGlanceManager.mjs index 92f5a4ee1..f2016ac31 100644 --- a/src/zen/glance/ZenGlanceManager.mjs +++ b/src/zen/glance/ZenGlanceManager.mjs @@ -1355,12 +1355,16 @@ * @param {Tab} tab - The tab to open glance for */ #openGlanceForTab(tab) { - const browserRect = window.windowUtils.getBoundsWithoutFlushing(gBrowser.tabbox); + const browserRect = window.windowUtils.getBoundsWithoutFlushing(gBrowser.tabpanels); const clickPosition = gZenUIManager._lastClickPosition || { clientX: browserRect.width / 2, clientY: browserRect.height / 2, }; + // Make it relative to the tabpanels + clickPosition.clientX -= browserRect.left; + clickPosition.clientY -= browserRect.top; + this.openGlance( { url: undefined, From fbad844a0834404072d98f41945750142466b99b Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com> Date: Tue, 21 Oct 2025 12:16:32 +0200 Subject: [PATCH 09/52] feat: Animate glances comming from unknown sources, p=#10894, c=glance * feat: Animate glances comming from unknown sources, b=no-bug, c=glance * chore: Fixed linter, b=no-bug, c=glance --- src/zen/glance/ZenGlanceManager.mjs | 52 +++++++++++++------ src/zen/glance/actors/ZenGlanceChild.sys.mjs | 34 +++++++++--- src/zen/glance/actors/ZenGlanceParent.sys.mjs | 4 ++ 3 files changed, 66 insertions(+), 24 deletions(-) diff --git a/src/zen/glance/ZenGlanceManager.mjs b/src/zen/glance/ZenGlanceManager.mjs index f2016ac31..954b03f6c 100644 --- a/src/zen/glance/ZenGlanceManager.mjs +++ b/src/zen/glance/ZenGlanceManager.mjs @@ -24,6 +24,9 @@ #duringOpening = false; #ignoreClose = false; + // Click handling + #lastLinkClickData = { clientX: 0, clientY: 0, height: 0, width: 0 }; + // Arc animation configuration #ARC_CONFIG = Object.freeze({ ARC_STEPS: 70, // Increased for smoother bounce @@ -268,10 +271,31 @@ data.height ); return await this.#imageBitmapToBase64( - await window.browsingContext.currentWindowGlobal.drawSnapshot(rect, 1, 'transparent', true) + await window.browsingContext.currentWindowGlobal.drawSnapshot( + rect, + 1, + 'transparent', + undefined + ) ); } + /** + * Set the last link click data + * @param {Object} data - The link click data + */ + set lastLinkClickData(data) { + this.#lastLinkClickData = data; + } + + /** + * Get the last link click data + * @returns {Object} The last link click data + */ + get lastLinkClickData() { + return this.#lastLinkClickData; + } + /** * Open a glance overlay with the specified data * @param {Object} data - Glance data including URL, position, and dimensions @@ -289,6 +313,13 @@ return; } + if (!data.height || !data.width) { + data = { + ...data, + ...this.lastLinkClickData, + }; + } + this.#setAnimationState(true); const currentTab = ownerTab ?? gBrowser.selectedTab; const browserElement = this.#createBrowserElement(data.url, currentTab, existingTab); @@ -325,6 +356,9 @@ gZenViewSplitter.onLocationChange(browserElement); this.#prepareGlanceAnimation(data, browserElement); if (data.width && data.height) { + // It is guaranteed that we will animate this opacity later on + // when we start animating the glance. + this.contentWrapper.style.opacity = 0; data.elementData = await this.#getElementPreviewData(data); } this.#glances.get(this.#currentGlanceID).elementData = data.elementData; @@ -342,7 +376,6 @@ const newButtons = this.#createNewOverlayButtons(); this.browserWrapper.appendChild(newButtons); - this.#animateParentBackground(); this.#setupGlancePositioning(data); this.#configureBrowserElement(browserElement); } @@ -486,7 +519,6 @@ // nice fade-in effect to the content. But if it doesn't exist, // we just fall back to always showing the browser directly. if (data.elementData) { - this.contentWrapper.style.opacity = 0; gZenUIManager.motion .animate( this.contentWrapper, @@ -501,6 +533,7 @@ }); } + this.#animateParentBackground(); gZenUIManager.motion .animate(this.browserWrapper, arcSequence, { duration: gZenUIManager.testingEnabled ? 0 : 0.4, @@ -1355,22 +1388,9 @@ * @param {Tab} tab - The tab to open glance for */ #openGlanceForTab(tab) { - const browserRect = window.windowUtils.getBoundsWithoutFlushing(gBrowser.tabpanels); - const clickPosition = gZenUIManager._lastClickPosition || { - clientX: browserRect.width / 2, - clientY: browserRect.height / 2, - }; - - // Make it relative to the tabpanels - clickPosition.clientX -= browserRect.left; - clickPosition.clientY -= browserRect.top; - this.openGlance( { url: undefined, - ...clickPosition, - width: 0, - height: 0, }, tab, tab.owner diff --git a/src/zen/glance/actors/ZenGlanceChild.sys.mjs b/src/zen/glance/actors/ZenGlanceChild.sys.mjs index d78805321..51cd6cb17 100644 --- a/src/zen/glance/actors/ZenGlanceChild.sys.mjs +++ b/src/zen/glance/actors/ZenGlanceChild.sys.mjs @@ -35,22 +35,30 @@ export class ZenGlanceChild extends JSWindowActorChild { return !(event.ctrlKey ^ event.altKey ^ event.shiftKey ^ event.metaKey); } - openGlance(target, originalTarget) { + #openGlance(target) { let url = target.href; // Add domain to relative URLs if (!url.match(/^(?:[a-z]+:)?\/\//i)) { url = this.contentWindow.location.origin + url; } + this.sendAsyncMessage('ZenGlance:OpenGlance', { + url, + }); + } + + #sendClickDataToParent(target, element) { + if (!element || !target) { + return; + } // Get the largest element we can get. If the `A` element // is a parent of the original target, use the anchor element, // otherwise use the original target. - let rect = originalTarget.getBoundingClientRect(); + let rect = element.getBoundingClientRect(); const anchorRect = target.getBoundingClientRect(); if (anchorRect.width * anchorRect.height > rect.width * rect.height) { rect = anchorRect; } - this.sendAsyncMessage('ZenGlance:OpenGlance', { - url, + this.sendAsyncMessage('ZenGlance:RecordLinkClickData', { clientX: rect.left, clientY: rect.top, width: rect.width, @@ -59,7 +67,19 @@ export class ZenGlanceChild extends JSWindowActorChild { } handleClick(event) { - if (this.ensureOnlyKeyModifiers(event) || event.button !== 0 || event.defaultPrevented) { + if (event.button !== 0 || event.defaultPrevented) { + return; + } + // get closest A element + const target = event.target.closest('A'); + const elementToRecord = event.originalTarget || event.target; + // We record the link data anyway, even if the glance may be invoked + // or not. We have some cases where glance would open, for example, + // when clicking on a link with a different domain where glance would open. + // The problem is that at that stage we don't know the rect or even what + // element has been clicked, so we send the data here. + this.#sendClickDataToParent(target, elementToRecord); + if (this.ensureOnlyKeyModifiers(event)) { return; } const activationMethod = this.#activationMethod; @@ -72,13 +92,11 @@ export class ZenGlanceChild extends JSWindowActorChild { } else if (activationMethod === 'meta' && !event.metaKey) { return; } - // get closest A element - const target = event.target.closest('A'); if (target) { event.preventDefault(); event.stopPropagation(); - this.openGlance(target, event.originalTarget || event.target); + this.#openGlance(target); } } diff --git a/src/zen/glance/actors/ZenGlanceParent.sys.mjs b/src/zen/glance/actors/ZenGlanceParent.sys.mjs index 2bc025df9..159a5f559 100644 --- a/src/zen/glance/actors/ZenGlanceParent.sys.mjs +++ b/src/zen/glance/actors/ZenGlanceParent.sys.mjs @@ -23,6 +23,10 @@ export class ZenGlanceParent extends JSWindowActorParent { this.browsingContext.topChromeWindow.gZenGlanceManager.closeGlance(params); break; } + case 'ZenGlance:RecordLinkClickData': { + this.browsingContext.topChromeWindow.gZenGlanceManager.lastLinkClickData = message.data; + break; + } default: console.warn(`[glance]: Unknown message: ${message.name}`); } From e449fc6e2e89fa7bdbea89e0fa8e8a914186f24d Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com> Date: Tue, 21 Oct 2025 12:22:55 +0200 Subject: [PATCH 10/52] fix: Titlebar shouldn't clip the background anymore, p=#10895, c=tabs --- src/zen/tabs/zen-tabs/vertical-tabs.css | 1 - 1 file changed, 1 deletion(-) diff --git a/src/zen/tabs/zen-tabs/vertical-tabs.css b/src/zen/tabs/zen-tabs/vertical-tabs.css index 7b97ab7ac..200cd98f8 100644 --- a/src/zen/tabs/zen-tabs/vertical-tabs.css +++ b/src/zen/tabs/zen-tabs/vertical-tabs.css @@ -706,7 +706,6 @@ & #titlebar { display: grid; - overflow: clip; } & #zen-sidebar-top-buttons-customization-target { From c59f7fdbc035792f4559cde63303249b3139cd14 Mon Sep 17 00:00:00 2001 From: Ryosuke <88011751+nrysk@users.noreply.github.com> Date: Tue, 21 Oct 2025 22:57:01 +0900 Subject: [PATCH 11/52] fix: Hide 'Change Name' for Spaces in collapsed toolbar mode, p=#10896, c=workspaces * fix: Hide 'Change Name' for Spaces in collapsed toolbar mode * fix: remove CSS, move comment and run lint:fix --- src/zen/tabs/zen-tabs/vertical-tabs.css | 6 ------ src/zen/workspaces/ZenWorkspaces.mjs | 8 ++++++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/zen/tabs/zen-tabs/vertical-tabs.css b/src/zen/tabs/zen-tabs/vertical-tabs.css index 200cd98f8..79c97db00 100644 --- a/src/zen/tabs/zen-tabs/vertical-tabs.css +++ b/src/zen/tabs/zen-tabs/vertical-tabs.css @@ -618,12 +618,6 @@ --tab-min-width: 48px !important; --zen-toolbox-padding: 6px !important; --zen-toolbox-max-width: calc(var(--tab-min-width) + var(--zen-toolbox-padding) * 2); - - /* We can't show the rename input properly in collapsed state, - so hide the workspace edit input */ - #context_zenEditWorkspace { - display: none; - } } #navigator-toolbox:not([zen-sidebar-expanded='true']) { diff --git a/src/zen/workspaces/ZenWorkspaces.mjs b/src/zen/workspaces/ZenWorkspaces.mjs index 3f8f614e4..7a50b72bb 100644 --- a/src/zen/workspaces/ZenWorkspaces.mjs +++ b/src/zen/workspaces/ZenWorkspaces.mjs @@ -1225,9 +1225,13 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature { }; const workspaceName = document.getElementById('context_zenEditWorkspace'); const themePicker = document.getElementById('context_zenChangeWorkspaceTheme'); + /* We can't show the rename input properly in collapsed state, + so hide the workspace edit input */ + const isCollapsed = !Services.prefs.getBoolPref('zen.view.sidebar-expanded'); workspaceName.hidden = - this.#contextMenuData.workspaceId && - this.#contextMenuData.workspaceId !== this.activeWorkspace; + isCollapsed || + (this.#contextMenuData.workspaceId && + this.#contextMenuData.workspaceId !== this.activeWorkspace); themePicker.hidden = this.#contextMenuData.workspaceId && this.#contextMenuData.workspaceId !== this.activeWorkspace; From eb30fba6d3f4bfa4323615ef53e881021fd49abd Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Tue, 21 Oct 2025 17:10:51 +0200 Subject: [PATCH 12/52] chore: Add funding known url, b=no-bug, c=no-component --- .well-known/funding-manifest-urls | 1 + 1 file changed, 1 insertion(+) create mode 100644 .well-known/funding-manifest-urls diff --git a/.well-known/funding-manifest-urls b/.well-known/funding-manifest-urls new file mode 100644 index 000000000..e77da4919 --- /dev/null +++ b/.well-known/funding-manifest-urls @@ -0,0 +1 @@ +https://zen-browser.app/funding.json \ No newline at end of file From 1e7eaff92efb58d0c0705eb96746d7e99c2bc53d Mon Sep 17 00:00:00 2001 From: boobachad <83977152+boobachad@users.noreply.github.com> Date: Tue, 21 Oct 2025 22:39:50 +0530 Subject: [PATCH 13/52] fix: Update maxEssentialTabs in context menu item, p=#10901 Signed-off-by: boobachad <83977152+boobachad@users.noreply.github.com> --- src/zen/tabs/ZenPinnedTabManager.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zen/tabs/ZenPinnedTabManager.mjs b/src/zen/tabs/ZenPinnedTabManager.mjs index 3a200ac1a..2bce92145 100644 --- a/src/zen/tabs/ZenPinnedTabManager.mjs +++ b/src/zen/tabs/ZenPinnedTabManager.mjs @@ -1098,7 +1098,7 @@ const element = window.MozXULElement.parseXULToFragment(`