From 4980f3ce18bfc5904f5c884f122062e9b3960f96 Mon Sep 17 00:00:00 2001 From: Alain Stulz Date: Mon, 14 Sep 2026 09:42:23 +0200 Subject: [PATCH] gh-10577: Add various requested url bar actions (gh-15376) Co-authored-by: mr. m <91018726+mr-cheffy@users.noreply.github.com> Signed-off-by: Alain Stulz --- .../browser/browser/zen-command-palette.ftl | 5 +++ .../common/styles/squircle-exclusions.inc.css | 1 + src/zen/spaces/ZenSpaceManager.mjs | 3 +- src/zen/urlbar/ZenUBGlobalActions.sys.mjs | 43 +++++++++++++++++++ 4 files changed, 50 insertions(+), 2 deletions(-) diff --git a/locales/en-US/browser/browser/zen-command-palette.ftl b/locales/en-US/browser/browser/zen-command-palette.ftl index c8af413e2..15b31201f 100644 --- a/locales/en-US/browser/browser/zen-command-palette.ftl +++ b/locales/en-US/browser/browser/zen-command-palette.ftl @@ -5,6 +5,8 @@ zen-action-toggle-compact-mode = Toggle Compact Mode zen-action-open-theme-picker = Open Theme Picker zen-action-new-split-view = New Split View +zen-action-unsplit-view = Expand current view +zen-action-new-space = New Space zen-action-new-folder = New Folder zen-action-copy-current-url = Copy Current URL zen-action-settings = Settings @@ -18,6 +20,9 @@ zen-action-new-boost = New Boost zen-action-next-space = Next Space zen-action-previous-space = Previous Space zen-action-close-tab = Close Tab +zen-action-reopen-closed-tab = Reopen Closed Tab +zen-action-duplicate-tab = Duplicate Current Tab +zen-action-reset-pinned-tab = Reset Pinned Tab zen-action-reload-tab = Reload Tab zen-action-reload-tab-without-cache = Reload Tab Without Cache zen-action-next-tab = Next Tab diff --git a/src/zen/common/styles/squircle-exclusions.inc.css b/src/zen/common/styles/squircle-exclusions.inc.css index 3d8419f52..d2789ba29 100644 --- a/src/zen/common/styles/squircle-exclusions.inc.css +++ b/src/zen/common/styles/squircle-exclusions.inc.css @@ -25,6 +25,7 @@ [fxastatus='signedin'] #fxa-avatar-image, #profile-icon-image, .appMenu-update-banner-pulse-ring, +.urlbarView-favicon, :is(#appMenu-zoomReduce-button2, #appMenu-zoomEnlarge-button2) > .toolbarbutton-icon, .color-swatches .userContext-icon, .reusable-relay-masks > button, diff --git a/src/zen/spaces/ZenSpaceManager.mjs b/src/zen/spaces/ZenSpaceManager.mjs index 6be4cffb3..1a8a3fe54 100644 --- a/src/zen/spaces/ZenSpaceManager.mjs +++ b/src/zen/spaces/ZenSpaceManager.mjs @@ -3033,8 +3033,7 @@ class nsZenWorkspaces { tabWorkspaceId, containerId, this._workspaceCache - ) && - !tab.hasAttribute("zen-empty-tab") + ) && !tab.hasAttribute("zen-empty-tab") ); } diff --git a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs index 517938ec5..a109a329c 100644 --- a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs +++ b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs @@ -17,6 +17,11 @@ ChromeUtils.defineLazyGetter(lazy, "l10n", () => { return new Localization(["browser/zen-command-palette.ftl"], true); }); +ChromeUtils.defineESModuleGetters(lazy, { + SessionStore: + "moz-src:///browser/components/sessionstore/SessionStore.sys.mjs", +}); + function isNotEmptyTab(window) { return !window.gBrowser.selectedTab.hasAttribute("zen-empty-tab"); } @@ -37,6 +42,19 @@ const globalActionsTemplate = [ command: "cmd_zenNewEmptySplit", icon: "chrome://browser/skin/zen-icons/split.svg", }, + { + l10nId: "zen-action-unsplit-view", + command: "cmd_zenSplitViewUnsplit", + icon: "chrome://browser/skin/zen-icons/split.svg", + isAvailable: window => { + return window.gZenViewSplitter.splitViewActive; + }, + }, + { + l10nId: "zen-action-new-space", + command: "cmd_zenOpenWorkspaceCreation", + icon: "chrome://browser/skin/zen-icons/plus.svg", + }, { l10nId: "zen-action-new-folder", command: "cmd_zenOpenFolderCreation", @@ -158,6 +176,31 @@ const globalActionsTemplate = [ return isNotEmptyTab(window); }, }, + { + l10nId: "zen-action-reopen-closed-tab", + command: "History:RestoreLastClosedTabOrWindowOrSession", + icon: "chrome://browser/skin/zen-icons/history.svg", + isAvailable: window => { + return lazy.SessionStore.getClosedTabCount(window) > 0; + }, + }, + { + l10nId: "zen-action-duplicate-tab", + command: "cmd_zenDuplicateTab", + icon: "chrome://browser/skin/zen-icons/duplicate-tab.svg", + isAvailable: window => { + return isNotEmptyTab(window); + }, + }, + { + l10nId: "zen-action-reset-pinned-tab", + command: "cmd_zenPinnedTabReset", + icon: "chrome://browser/skin/zen-icons/arrow-rotate-anticlockwise.svg", + isAvailable: window => { + const tab = window.gBrowser.selectedTab; + return tab.pinned && tab.hasAttribute("zen-pinned-changed"); + }, + }, { l10nId: "zen-action-reload-tab", command: "Browser:Reload",