From a8ccd1ca3cd665b97ddc59f1fdec350022176950 Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Tue, 24 Feb 2026 12:47:20 +0100 Subject: [PATCH] feat: Make folder search popup ignore outside clicks, b=no-bug, c=folders, common --- .../content/zen-panels/folders-search.inc | 8 +- .../base/content/zen-panels/popups.inc | 4 +- src/zen/common/styles/zen-panel-ui.css | 6 ++ .../common/styles/zen-single-components.css | 29 ++++-- src/zen/folders/ZenFolder.mjs | 9 +- src/zen/folders/ZenFolders.mjs | 8 +- .../ZenLiveFoldersManager.sys.mjs | 88 +++++++++---------- 7 files changed, 89 insertions(+), 63 deletions(-) diff --git a/src/browser/base/content/zen-panels/folders-search.inc b/src/browser/base/content/zen-panels/folders-search.inc index cbd622ef6..13805361b 100644 --- a/src/browser/base/content/zen-panels/folders-search.inc +++ b/src/browser/base/content/zen-panels/folders-search.inc @@ -2,7 +2,13 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. - + + image="chrome://browser/skin/zen-icons/selectable/logo-github.svg" /> + image="chrome://browser/skin/zen-icons/selectable/logo-github.svg" /> { // If popup is focused don't hide it - if (this.#popup.matches(":hover")) { + if (this.#popup.matches(":hover") || labelContainer.matches(":hover")) { return; } this.#popup.hidePopup(true); @@ -1262,7 +1262,7 @@ class nsZenFolders extends nsZenDOMOperatedFeature { } get #folderAnimationDuration() { - return this._sessionRestoring ? 0 : 0.12; + return this._sessionRestoring || this._dontAnimateFolder ? 0 : 0.12; } async animateCollapse(group) { diff --git a/src/zen/live-folders/ZenLiveFoldersManager.sys.mjs b/src/zen/live-folders/ZenLiveFoldersManager.sys.mjs index 2fd0fe59a..4819f8ed7 100644 --- a/src/zen/live-folders/ZenLiveFoldersManager.sys.mjs +++ b/src/zen/live-folders/ZenLiveFoldersManager.sys.mjs @@ -228,14 +228,14 @@ class nsZenLiveFoldersManager { let labelElement = folder.labelElement; labelElement.setAttribute("live-folder-animation", "true"); labelElement.style.backgroundPositionX = "0%"; - let animation = folder.ownerGlobal.gZenUIManager.motion + folder.ownerGlobal.gZenUIManager.motion .animate( labelElement, { backgroundPositionX: ["0%", "-50%"], }, { - duration: 1.5, + duration: 1, } ) .then(() => { @@ -256,54 +256,52 @@ class nsZenLiveFoldersManager { browser: gBrowser.selectedBrowser, theme: { preset: "chrome" }, }); - animation.then(() => { - callout.showFeatureCallout({ + callout.showFeatureCallout({ + id: "ZEN_LIVE_FOLDERS_CALLOUT", + template: "feature_callout", + groups: ["cfr"], + content: { id: "ZEN_LIVE_FOLDERS_CALLOUT", - template: "feature_callout", - groups: ["cfr"], - content: { - id: "ZEN_LIVE_FOLDERS_CALLOUT", - template: "spotlight", - backdrop: "transparent", - transitions: true, - autohide: true, - screens: [ - { - id: "ZEN_LIVE_FOLDERS_CALLOUT", - anchors: [ - { - selector: `[id="${folder.id}"]`, - panel_position: { - anchor_attachment: "rightcenter", - callout_attachment: "topleft", - }, - }, - ], - content: { - position: "callout", - width: "355px", - title_logo: { - imageURL: icon, - width: "18px", - height: "18px", - marginInline: "0 8px", - }, - title: { - string_id: "zen-live-folders-promotion-title", - }, - subtitle: { - string_id: "zen-live-folders-promotion-description", + template: "spotlight", + backdrop: "transparent", + transitions: true, + autohide: true, + screens: [ + { + id: "ZEN_LIVE_FOLDERS_CALLOUT", + anchors: [ + { + selector: `[id="${folder.id}"]`, + panel_position: { + anchor_attachment: "rightcenter", + callout_attachment: "topleft", }, }, + ], + content: { + width: "310px", + position: "callout", + title_logo: { + imageURL: icon, + width: "18px", + height: "18px", + marginInline: "0 8px", + }, + title: { + string_id: "zen-live-folders-promotion-title", + }, + subtitle: { + string_id: "zen-live-folders-promotion-description", + }, }, - ], - }, - }); - - lazy.setTimeout(() => { - callout.endTour(); - }, 8000); + }, + ], + }, }); + + lazy.setTimeout(() => { + callout.endTour(); + }, 10000); } deleteFolder(id, deleteFolder = true) {