From 809bced523c620b915de778c7d215c975c9fc74a Mon Sep 17 00:00:00 2001 From: Papa Leo Date: Sun, 28 Sep 2025 15:03:19 +0200 Subject: [PATCH 01/14] Added 'Create New Workspace' command --- src/zen/urlbar/ZenUBGlobalActions.sys.mjs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs index 8418e14be3..9504c3a4c7 100644 --- a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs +++ b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs @@ -153,6 +153,11 @@ const globalActionsTemplate = [ command: 'Tools:Addons', icon: 'chrome://browser/skin/zen-icons/extension.svg', }, + { + label: 'Create New Workspace', + command: 'cmd_zenOpenWorkspaceCreation', + icon: 'chrome://browser/skin/zen-icons/duplicate-tab.svg', + }, ]; export const globalActions = globalActionsTemplate.map((action) => ({ From 641cec0d178b92a89b4dc585ef9f855e59762edc Mon Sep 17 00:00:00 2001 From: Papa Leo Date: Sun, 28 Sep 2025 15:03:38 +0200 Subject: [PATCH 02/14] Added 'Delete Current Workspace' command --- src/zen/urlbar/ZenUBGlobalActions.sys.mjs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs index 9504c3a4c7..3c596f0d9e 100644 --- a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs +++ b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs @@ -158,6 +158,11 @@ const globalActionsTemplate = [ command: 'cmd_zenOpenWorkspaceCreation', icon: 'chrome://browser/skin/zen-icons/duplicate-tab.svg', }, + { + label: 'Delete Current Workspace', + command: 'cmd_zenCtxDeleteWorkspace', + icon: 'chrome://browser/skin/zen-icons/trash.svg', + }, ]; export const globalActions = globalActionsTemplate.map((action) => ({ From d327cd5596975e0d2eedd9bca511018545718fb6 Mon Sep 17 00:00:00 2001 From: Papa Leo Date: Sun, 28 Sep 2025 17:49:08 +0200 Subject: [PATCH 03/14] Added 'Unsplit Tabs' command --- src/zen/urlbar/ZenUBGlobalActions.sys.mjs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs index 3c596f0d9e..8fdee2cfb9 100644 --- a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs +++ b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs @@ -163,6 +163,14 @@ const globalActionsTemplate = [ command: 'cmd_zenCtxDeleteWorkspace', icon: 'chrome://browser/skin/zen-icons/trash.svg', }, + { + label: 'Unsplit Tabs', + command: 'cmd_zenSplitViewUnsplit', + icon: 'chrome://browser/skin/zen-icons/fullscreen.svg', + isAvailable: (window) => { + return window.gZenViewSplitter.splitViewActive; + }, + }, ]; export const globalActions = globalActionsTemplate.map((action) => ({ From a18d88baef07654253eaaf444d4c18971a52e02b Mon Sep 17 00:00:00 2001 From: Papa Leo Date: Mon, 29 Sep 2025 00:48:14 +0200 Subject: [PATCH 04/14] Added 'Unsplit Current Tab' command --- src/zen/urlbar/ZenUBGlobalActions.sys.mjs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs index 8fdee2cfb9..5a839808b7 100644 --- a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs +++ b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs @@ -166,11 +166,28 @@ const globalActionsTemplate = [ { label: 'Unsplit Tabs', command: 'cmd_zenSplitViewUnsplit', - icon: 'chrome://browser/skin/zen-icons/fullscreen.svg', + icon: 'chrome://browser/skin/zen-icons/tab.svg', isAvailable: (window) => { return window.gZenViewSplitter.splitViewActive; }, }, + { + label: 'Unsplit Current Tab', + icon: 'chrome://browser/skin/zen-icons/fullscreen.svg', + command: (window) => { + const container = window.gBrowser.selectedTab.linkedBrowser?.closest( + '.browserSidebarContainer' + ); + window.gZenViewSplitter.removeTabFromSplit(container); + }, + isAvailable: (window) => { + return ( + // This command is hidden if split has only 2 tabs, just use 'Unsplit Tabs' + window.gZenViewSplitter.splitViewActive && + window.gZenViewSplitter._data[window.gZenViewSplitter.currentView].tabs.length > 2 + ); + }, + }, ]; export const globalActions = globalActionsTemplate.map((action) => ({ From a0789be5b77731990d6b312a5d64cb7850bc4299 Mon Sep 17 00:00:00 2001 From: Papa Leo Date: Mon, 29 Sep 2025 12:54:49 +0200 Subject: [PATCH 05/14] Added 'Reset Pinned Tab' command --- src/zen/urlbar/ZenUBGlobalActions.sys.mjs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs index 5a839808b7..05a13243ee 100644 --- a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs +++ b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs @@ -182,12 +182,24 @@ const globalActionsTemplate = [ }, isAvailable: (window) => { return ( - // This command is hidden if split has only 2 tabs, just use 'Unsplit Tabs' + // This command is hidden if split view has only 2 tabs; just use 'Unsplit Tabs' window.gZenViewSplitter.splitViewActive && window.gZenViewSplitter._data[window.gZenViewSplitter.currentView].tabs.length > 2 ); }, }, + { + label: 'Reset Pinned Tab', + icon: 'chrome://browser/skin/zen-icons/reload.svg', + command: 'cmd_zenPinnedTabReset', + isAvailable: (window) => { + const tab = window.gBrowser.selectedTab; + return ( + // This command only available when the tab is non-empty, pinned, and has been changed + tab.hasAttribute('zen-pinned-changed') && !tab.hasAttribute('zen-empty-tab') && tab.pinned + ); + }, + }, ]; export const globalActions = globalActionsTemplate.map((action) => ({ From dd181ede8779a10b58d7deefb13b583cb59970e5 Mon Sep 17 00:00:00 2001 From: Papa Leo Date: Mon, 29 Sep 2025 13:56:50 +0200 Subject: [PATCH 06/14] Added 'Replace Pinned URL with Current' command --- src/zen/urlbar/ZenUBGlobalActions.sys.mjs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs index 05a13243ee..bee0211c0b 100644 --- a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs +++ b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs @@ -6,6 +6,11 @@ function isNotEmptyTab(window) { return !window.gBrowser.selectedTab.hasAttribute('zen-empty-tab'); } +// Returns true if the current tab is pinned, non-empty, and has been changed +function isPinnedTabChanged(tab) { + return tab.hasAttribute('zen-pinned-changed') && !tab.hasAttribute('zen-empty-tab') && tab.pinned; +} + const globalActionsTemplate = [ { label: 'Toggle Compact Mode', @@ -193,11 +198,17 @@ const globalActionsTemplate = [ icon: 'chrome://browser/skin/zen-icons/reload.svg', command: 'cmd_zenPinnedTabReset', isAvailable: (window) => { - const tab = window.gBrowser.selectedTab; - return ( - // This command only available when the tab is non-empty, pinned, and has been changed - tab.hasAttribute('zen-pinned-changed') && !tab.hasAttribute('zen-empty-tab') && tab.pinned - ); + return isPinnedTabChanged(window.gBrowser.selectedTab); + }, + }, + { + label: 'Replace Pinned URL with Current', + icon: 'chrome://browser/skin/zen-icons/pin.svg', + command: (window) => { + window.gZenPinnedTabManager.replacePinnedUrlWithCurrent(window.gBrowser.selectedTab); + }, + isAvailable: (window) => { + return isPinnedTabChanged(window.gBrowser.selectedTab); }, }, ]; From 7eef30421d1afd6fa1a901cc30e296e2a7fd615d Mon Sep 17 00:00:00 2001 From: Papa Leo Date: Mon, 29 Sep 2025 15:03:27 +0200 Subject: [PATCH 07/14] Added 'Split Selected Tabs' command --- src/zen/urlbar/ZenUBGlobalActions.sys.mjs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs index bee0211c0b..5dc5df92d0 100644 --- a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs +++ b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs @@ -168,6 +168,14 @@ const globalActionsTemplate = [ command: 'cmd_zenCtxDeleteWorkspace', icon: 'chrome://browser/skin/zen-icons/trash.svg', }, + { + label: 'Split Selected Tabs', + command: (window) => window.gZenViewSplitter.contextSplitTabs(), + icon: 'chrome://browser/skin/zen-icons/manage.svg', + isAvailable: (window) => { + return window.gZenViewSplitter.contextCanSplitTabs(); + }, + }, { label: 'Unsplit Tabs', command: 'cmd_zenSplitViewUnsplit', From 16433789b05015f9f34c770848de1f79214352d4 Mon Sep 17 00:00:00 2001 From: Papa Leo Date: Mon, 29 Sep 2025 15:11:24 +0200 Subject: [PATCH 08/14] Added 'Duplicate Tab' command --- src/zen/urlbar/ZenUBGlobalActions.sys.mjs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs index 5dc5df92d0..57ab199fa2 100644 --- a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs +++ b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs @@ -219,6 +219,16 @@ const globalActionsTemplate = [ return isPinnedTabChanged(window.gBrowser.selectedTab); }, }, + { + label: 'Duplicate Tab', + icon: 'chrome://browser/skin/zen-icons/duplicate-tab.svg', + command: (window) => { + window.gBrowser.duplicateTab(window.gBrowser.selectedTab, true); + }, + isAvailable: (window) => { + return isNotEmptyTab(window); + }, + }, ]; export const globalActions = globalActionsTemplate.map((action) => ({ From d2b336d0a24eb846464ab04874c4419c34b6e5a3 Mon Sep 17 00:00:00 2001 From: Papa Leo Date: Mon, 29 Sep 2025 17:16:13 +0200 Subject: [PATCH 09/14] Added 'Copy Current URL Markdown' command --- src/zen/urlbar/ZenUBGlobalActions.sys.mjs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs index 57ab199fa2..85c7b7858f 100644 --- a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs +++ b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs @@ -229,6 +229,14 @@ const globalActionsTemplate = [ return isNotEmptyTab(window); }, }, + { + label: 'Copy Current URL Markdown', + icon: 'chrome://browser/skin/zen-icons/edit-copy.svg', + command: 'cmd_zenCopyCurrentURLMarkdown', + isAvailable: (window) => { + return isNotEmptyTab(window); + }, + }, ]; export const globalActions = globalActionsTemplate.map((action) => ({ From a97d5abd3c4978905f5efe40daf7490997bab443 Mon Sep 17 00:00:00 2001 From: Papa Leo Date: Mon, 29 Sep 2025 18:35:47 +0200 Subject: [PATCH 10/14] Added 'Split View Vertical', 'Split View Horizontal', 'Split View Grid' commands. Removed 'Split Selected Tabs' command, redundant --- src/zen/urlbar/ZenUBGlobalActions.sys.mjs | 24 +++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs index 85c7b7858f..ca11a278a9 100644 --- a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs +++ b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs @@ -169,11 +169,27 @@ const globalActionsTemplate = [ icon: 'chrome://browser/skin/zen-icons/trash.svg', }, { - label: 'Split Selected Tabs', - command: (window) => window.gZenViewSplitter.contextSplitTabs(), - icon: 'chrome://browser/skin/zen-icons/manage.svg', + label: 'Split View Vertical', + command: 'cmd_zenSplitViewVertical', + icon: 'chrome://browser/skin/zen-icons/split.svg', + isAvailable: (window) => { + return window.gBrowser.tabs.length > 1 && !(window.gZenViewSplitter.currentView >= 0); + }, + }, + { + label: 'Split View Horizontal', + command: 'cmd_zenSplitViewHorizontal', + icon: 'chrome://browser/skin/zen-icons/split.svg', + isAvailable: (window) => { + return window.gBrowser.tabs.length > 1 && !(window.gZenViewSplitter.currentView >= 0); + }, + }, + { + label: 'Split View Grid', + command: 'cmd_zenSplitViewGrid', + icon: 'chrome://browser/skin/zen-icons/split.svg', isAvailable: (window) => { - return window.gZenViewSplitter.contextCanSplitTabs(); + return window.gBrowser.tabs.length > 1 && !(window.gZenViewSplitter.currentView >= 0); }, }, { From b1a4046f30739369847fdacf68ad8470772fb7bc Mon Sep 17 00:00:00 2001 From: Papa Leo Date: Wed, 1 Oct 2025 16:08:42 +0200 Subject: [PATCH 11/14] Added 'Reopen Closed Tab' command --- src/zen/urlbar/ZenUBGlobalActions.sys.mjs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs index ca11a278a9..439b4deb00 100644 --- a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs +++ b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs @@ -95,6 +95,11 @@ const globalActionsTemplate = [ return isNotEmptyTab(window); }, }, + { + label: 'Reopen Closed Tab', + command: 'History:UndoCloseTab', + icon: 'chrome://browser/skin/zen-icons/open.svg', + }, { label: 'Reload Tab', command: 'Browser:Reload', From e238afb94f8fad28d164ffb322c1aa8dd4f34e5d Mon Sep 17 00:00:00 2001 From: Papa Leo Date: Wed, 1 Oct 2025 16:36:04 +0200 Subject: [PATCH 12/14] Added 'Bookmark Tab', 'Search Bookmarks' commands --- src/zen/urlbar/ZenUBGlobalActions.sys.mjs | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs index 439b4deb00..8411c04603 100644 --- a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs +++ b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs @@ -37,6 +37,14 @@ const globalActionsTemplate = [ command: 'cmd_zenCopyCurrentURL', icon: 'chrome://browser/skin/zen-icons/edit-copy.svg', }, + { + label: 'Copy Current URL Markdown', + icon: 'chrome://browser/skin/zen-icons/edit-copy.svg', + command: 'cmd_zenCopyCurrentURLMarkdown', + isAvailable: (window) => { + return isNotEmptyTab(window); + }, + }, { label: 'Settings', command: (window) => window.openPreferences(), @@ -251,12 +259,15 @@ const globalActionsTemplate = [ }, }, { - label: 'Copy Current URL Markdown', - icon: 'chrome://browser/skin/zen-icons/edit-copy.svg', - command: 'cmd_zenCopyCurrentURLMarkdown', - isAvailable: (window) => { - return isNotEmptyTab(window); - }, + label: 'Bookmark Tab', + icon: 'chrome://browser/skin/zen-icons/bookmark-hollow.svg', + command: 'Browser:AddBookmarkAs', + isAvailable: (window) => isNotEmptyTab(window), + }, + { + label: 'Search Bookmarks', + icon: 'chrome://browser/skin/zen-icons/bookmark-star-on-tray.svg', + command: 'Browser:SearchBookmarks', }, ]; From 8d14cc46faea3da3d3a6d855a49325029cbbe0b8 Mon Sep 17 00:00:00 2001 From: Papa Leo Date: Wed, 1 Oct 2025 16:58:49 +0200 Subject: [PATCH 13/14] Add quick actions advanced mode behind preference flag --- prefs/zen-urlbar.yaml | 3 +++ src/zen/urlbar/ZenUBGlobalActions.sys.mjs | 31 +++++++++++++++++++---- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/prefs/zen-urlbar.yaml b/prefs/zen-urlbar.yaml index b9b0533d4f..2d468c98b8 100644 --- a/prefs/zen-urlbar.yaml +++ b/prefs/zen-urlbar.yaml @@ -27,3 +27,6 @@ - name: zen.urlbar.suggestions.quick-actions value: true + +- name: zen.urlbar.suggestions.quick-actions.advanced + value: false diff --git a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs index 8411c04603..a94ae00702 100644 --- a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs +++ b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs @@ -11,6 +11,11 @@ function isPinnedTabChanged(tab) { return tab.hasAttribute('zen-pinned-changed') && !tab.hasAttribute('zen-empty-tab') && tab.pinned; } +// Returns true if the user has enabled advanced quick actions +function isAdvancedQuickActionsEnabled() { + return Services.prefs.getBoolPref('zen.urlbar.suggestions.quick-actions.advanced', false); +} + const globalActionsTemplate = [ { label: 'Toggle Compact Mode', @@ -42,7 +47,7 @@ const globalActionsTemplate = [ icon: 'chrome://browser/skin/zen-icons/edit-copy.svg', command: 'cmd_zenCopyCurrentURLMarkdown', isAvailable: (window) => { - return isNotEmptyTab(window); + return isAdvancedQuickActionsEnabled() && isNotEmptyTab(window); }, }, { @@ -175,18 +180,24 @@ const globalActionsTemplate = [ label: 'Create New Workspace', command: 'cmd_zenOpenWorkspaceCreation', icon: 'chrome://browser/skin/zen-icons/duplicate-tab.svg', + isAvailable: () => isAdvancedQuickActionsEnabled(), }, { label: 'Delete Current Workspace', command: 'cmd_zenCtxDeleteWorkspace', icon: 'chrome://browser/skin/zen-icons/trash.svg', + isAvailable: () => isAdvancedQuickActionsEnabled(), }, { label: 'Split View Vertical', command: 'cmd_zenSplitViewVertical', icon: 'chrome://browser/skin/zen-icons/split.svg', isAvailable: (window) => { - return window.gBrowser.tabs.length > 1 && !(window.gZenViewSplitter.currentView >= 0); + return ( + isAdvancedQuickActionsEnabled() && + window.gBrowser.tabs.length > 1 && + !(window.gZenViewSplitter.currentView >= 0) + ); }, }, { @@ -194,7 +205,11 @@ const globalActionsTemplate = [ command: 'cmd_zenSplitViewHorizontal', icon: 'chrome://browser/skin/zen-icons/split.svg', isAvailable: (window) => { - return window.gBrowser.tabs.length > 1 && !(window.gZenViewSplitter.currentView >= 0); + return ( + isAdvancedQuickActionsEnabled() && + window.gBrowser.tabs.length > 1 && + !(window.gZenViewSplitter.currentView >= 0) + ); }, }, { @@ -202,7 +217,11 @@ const globalActionsTemplate = [ command: 'cmd_zenSplitViewGrid', icon: 'chrome://browser/skin/zen-icons/split.svg', isAvailable: (window) => { - return window.gBrowser.tabs.length > 1 && !(window.gZenViewSplitter.currentView >= 0); + return ( + isAdvancedQuickActionsEnabled() && + window.gBrowser.tabs.length > 1 && + !(window.gZenViewSplitter.currentView >= 0) + ); }, }, { @@ -210,7 +229,7 @@ const globalActionsTemplate = [ command: 'cmd_zenSplitViewUnsplit', icon: 'chrome://browser/skin/zen-icons/tab.svg', isAvailable: (window) => { - return window.gZenViewSplitter.splitViewActive; + return isAdvancedQuickActionsEnabled() && window.gZenViewSplitter.splitViewActive; }, }, { @@ -225,6 +244,7 @@ const globalActionsTemplate = [ isAvailable: (window) => { return ( // This command is hidden if split view has only 2 tabs; just use 'Unsplit Tabs' + isAdvancedQuickActionsEnabled() && window.gZenViewSplitter.splitViewActive && window.gZenViewSplitter._data[window.gZenViewSplitter.currentView].tabs.length > 2 ); @@ -268,6 +288,7 @@ const globalActionsTemplate = [ label: 'Search Bookmarks', icon: 'chrome://browser/skin/zen-icons/bookmark-star-on-tray.svg', command: 'Browser:SearchBookmarks', + isAvailable: () => isAdvancedQuickActionsEnabled(), }, ]; From 78fe2fa8aa7e181ae9044d020c087f7ac88dfc84 Mon Sep 17 00:00:00 2001 From: Papa Leo Date: Fri, 3 Oct 2025 15:03:05 +0200 Subject: [PATCH 14/14] Refactored fetching of advanced quick actions pref --- src/zen/urlbar/ZenUBGlobalActions.sys.mjs | 165 ++++++++++------------ 1 file changed, 72 insertions(+), 93 deletions(-) diff --git a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs index a94ae00702..52a019cb45 100644 --- a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs +++ b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs @@ -11,11 +11,6 @@ function isPinnedTabChanged(tab) { return tab.hasAttribute('zen-pinned-changed') && !tab.hasAttribute('zen-empty-tab') && tab.pinned; } -// Returns true if the user has enabled advanced quick actions -function isAdvancedQuickActionsEnabled() { - return Services.prefs.getBoolPref('zen.urlbar.suggestions.quick-actions.advanced', false); -} - const globalActionsTemplate = [ { label: 'Toggle Compact Mode', @@ -42,14 +37,6 @@ const globalActionsTemplate = [ command: 'cmd_zenCopyCurrentURL', icon: 'chrome://browser/skin/zen-icons/edit-copy.svg', }, - { - label: 'Copy Current URL Markdown', - icon: 'chrome://browser/skin/zen-icons/edit-copy.svg', - command: 'cmd_zenCopyCurrentURLMarkdown', - isAvailable: (window) => { - return isAdvancedQuickActionsEnabled() && isNotEmptyTab(window); - }, - }, { label: 'Settings', command: (window) => window.openPreferences(), @@ -176,80 +163,6 @@ const globalActionsTemplate = [ command: 'Tools:Addons', icon: 'chrome://browser/skin/zen-icons/extension.svg', }, - { - label: 'Create New Workspace', - command: 'cmd_zenOpenWorkspaceCreation', - icon: 'chrome://browser/skin/zen-icons/duplicate-tab.svg', - isAvailable: () => isAdvancedQuickActionsEnabled(), - }, - { - label: 'Delete Current Workspace', - command: 'cmd_zenCtxDeleteWorkspace', - icon: 'chrome://browser/skin/zen-icons/trash.svg', - isAvailable: () => isAdvancedQuickActionsEnabled(), - }, - { - label: 'Split View Vertical', - command: 'cmd_zenSplitViewVertical', - icon: 'chrome://browser/skin/zen-icons/split.svg', - isAvailable: (window) => { - return ( - isAdvancedQuickActionsEnabled() && - window.gBrowser.tabs.length > 1 && - !(window.gZenViewSplitter.currentView >= 0) - ); - }, - }, - { - label: 'Split View Horizontal', - command: 'cmd_zenSplitViewHorizontal', - icon: 'chrome://browser/skin/zen-icons/split.svg', - isAvailable: (window) => { - return ( - isAdvancedQuickActionsEnabled() && - window.gBrowser.tabs.length > 1 && - !(window.gZenViewSplitter.currentView >= 0) - ); - }, - }, - { - label: 'Split View Grid', - command: 'cmd_zenSplitViewGrid', - icon: 'chrome://browser/skin/zen-icons/split.svg', - isAvailable: (window) => { - return ( - isAdvancedQuickActionsEnabled() && - window.gBrowser.tabs.length > 1 && - !(window.gZenViewSplitter.currentView >= 0) - ); - }, - }, - { - label: 'Unsplit Tabs', - command: 'cmd_zenSplitViewUnsplit', - icon: 'chrome://browser/skin/zen-icons/tab.svg', - isAvailable: (window) => { - return isAdvancedQuickActionsEnabled() && window.gZenViewSplitter.splitViewActive; - }, - }, - { - label: 'Unsplit Current Tab', - icon: 'chrome://browser/skin/zen-icons/fullscreen.svg', - command: (window) => { - const container = window.gBrowser.selectedTab.linkedBrowser?.closest( - '.browserSidebarContainer' - ); - window.gZenViewSplitter.removeTabFromSplit(container); - }, - isAvailable: (window) => { - return ( - // This command is hidden if split view has only 2 tabs; just use 'Unsplit Tabs' - isAdvancedQuickActionsEnabled() && - window.gZenViewSplitter.splitViewActive && - window.gZenViewSplitter._data[window.gZenViewSplitter.currentView].tabs.length > 2 - ); - }, - }, { label: 'Reset Pinned Tab', icon: 'chrome://browser/skin/zen-icons/reload.svg', @@ -284,12 +197,78 @@ const globalActionsTemplate = [ command: 'Browser:AddBookmarkAs', isAvailable: (window) => isNotEmptyTab(window), }, - { - label: 'Search Bookmarks', - icon: 'chrome://browser/skin/zen-icons/bookmark-star-on-tray.svg', - command: 'Browser:SearchBookmarks', - isAvailable: () => isAdvancedQuickActionsEnabled(), - }, + ...(Services.prefs.getBoolPref('zen.urlbar.suggestions.quick-actions.advanced', false) + ? [ + { + label: 'Search Bookmarks', + icon: 'chrome://browser/skin/zen-icons/bookmark-star-on-tray.svg', + command: 'Browser:SearchBookmarks', + }, + { + label: 'Copy Current URL Markdown', + icon: 'chrome://browser/skin/zen-icons/edit-copy.svg', + command: 'cmd_zenCopyCurrentURLMarkdown', + isAvailable: (window) => isNotEmptyTab(window), + }, + { + label: 'Create New Workspace', + command: 'cmd_zenOpenWorkspaceCreation', + icon: 'chrome://browser/skin/zen-icons/duplicate-tab.svg', + }, + { + label: 'Delete Current Workspace', + command: 'cmd_zenCtxDeleteWorkspace', + icon: 'chrome://browser/skin/zen-icons/trash.svg', + }, + { + label: 'Split View Vertical', + command: 'cmd_zenSplitViewVertical', + icon: 'chrome://browser/skin/zen-icons/split.svg', + isAvailable: (window) => { + return window.gBrowser.tabs.length > 1 && !(window.gZenViewSplitter.currentView >= 0); + }, + }, + { + label: 'Split View Horizontal', + command: 'cmd_zenSplitViewHorizontal', + icon: 'chrome://browser/skin/zen-icons/split.svg', + isAvailable: (window) => { + return window.gBrowser.tabs.length > 1 && !(window.gZenViewSplitter.currentView >= 0); + }, + }, + { + label: 'Split View Grid', + command: 'cmd_zenSplitViewGrid', + icon: 'chrome://browser/skin/zen-icons/split.svg', + isAvailable: (window) => { + return window.gBrowser.tabs.length > 1 && !(window.gZenViewSplitter.currentView >= 0); + }, + }, + { + label: 'Unsplit Tabs', + command: 'cmd_zenSplitViewUnsplit', + icon: 'chrome://browser/skin/zen-icons/tab.svg', + isAvailable: (window) => window.gZenViewSplitter.splitViewActive, + }, + { + label: 'Unsplit Current Tab', + icon: 'chrome://browser/skin/zen-icons/fullscreen.svg', + command: (window) => { + const container = window.gBrowser.selectedTab.linkedBrowser?.closest( + '.browserSidebarContainer' + ); + window.gZenViewSplitter.removeTabFromSplit(container); + }, + isAvailable: (window) => { + return ( + // This command is hidden if split view has only 2 tabs; just use 'Unsplit Tabs' + window.gZenViewSplitter.splitViewActive && + window.gZenViewSplitter._data[window.gZenViewSplitter.currentView].tabs.length > 2 + ); + }, + }, + ] + : []), ]; export const globalActions = globalActionsTemplate.map((action) => ({