From 0fcc3f7c0efdcf3a69f3e749748a4841fcdedd6d Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Sat, 13 Sep 2025 01:34:47 +0200 Subject: [PATCH 1/5] feat: Improve border rendering for compact mode, b=no-bug, c=common, compact-mode, tabs --- src/zen/common/styles/zen-browser-ui.css | 4 ++-- src/zen/compact-mode/zen-compact-mode.css | 14 ++++++++++++-- src/zen/tabs/zen-tabs/vertical-tabs.css | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/zen/common/styles/zen-browser-ui.css b/src/zen/common/styles/zen-browser-ui.css index f5fc53ae2..e971eec0c 100644 --- a/src/zen/common/styles/zen-browser-ui.css +++ b/src/zen/common/styles/zen-browser-ui.css @@ -89,8 +89,8 @@ } } - :root[animating-background='true'] &::after, - :root[animating-background='true'] &::before { + &::after, + &::before { mix-blend-mode: plus-lighter; } } diff --git a/src/zen/compact-mode/zen-compact-mode.css b/src/zen/compact-mode/zen-compact-mode.css index daaafe3bc..ee9346b9b 100644 --- a/src/zen/compact-mode/zen-compact-mode.css +++ b/src/zen/compact-mode/zen-compact-mode.css @@ -147,13 +147,23 @@ & #zen-toolbar-background { display: flex; - outline: 1px solid rgba(255, 255, 255, .15); - border-radius: calc(var(--zen-native-inner-radius) + var(--zen-element-separation) / 4 - var(--zen-compact-mode-no-padding-radius-fix, 0px)); + overflow: clip; + background: transparent; z-index: -1; box-shadow: var(--zen-big-shadow); @media -moz-pref('zen.theme.acrylic-elements') { backdrop-filter: blur(42px) saturate(110%) brightness(0.25) contrast(100%) !important; } + &::before, + &::after { + outline: 1px solid rgba(255, 255, 255, .15); + outline-offset: -1px; + } + &, + &::before, + &::after { + border-radius: calc(var(--zen-native-inner-radius) + var(--zen-element-separation) / 4 - var(--zen-compact-mode-no-padding-radius-fix, 0px)); + } } } diff --git a/src/zen/tabs/zen-tabs/vertical-tabs.css b/src/zen/tabs/zen-tabs/vertical-tabs.css index d80b0ca34..8c089d6b4 100644 --- a/src/zen/tabs/zen-tabs/vertical-tabs.css +++ b/src/zen/tabs/zen-tabs/vertical-tabs.css @@ -200,7 +200,7 @@ @media (-moz-platform: macos) { --border-radius-medium: 12px; - --tab-border-radius: 10px; + --tab-border-radius: 8px; } min-width: var(--zen-toolbox-min-width); From 9ce963f1cd88f4a2198d785e399cb2b833a47686 Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com> Date: Sat, 13 Sep 2025 01:35:38 +0200 Subject: [PATCH 2/5] feat: New urlbar actions, c=common, p=#10340 --- prefs/zen-urlbar.yaml | 5 + .../base/content/zen-assets.jar.inc.mn | 1 - .../components/BrowserGlue-sys-mjs.patch | 4 +- src/zen/@types/lib.gecko.darwin.d.ts | 3 + src/zen/@types/lib.gecko.dom.d.ts | 3 + src/zen/@types/lib.gecko.glean.d.ts | 3 + src/zen/@types/lib.gecko.linux.d.ts | 3 + src/zen/@types/lib.gecko.modules.d.ts | 3 + src/zen/@types/lib.gecko.nsresult.d.ts | 3 + src/zen/@types/lib.gecko.services.d.ts | 3 + src/zen/@types/lib.gecko.tweaks.d.ts | 3 + src/zen/@types/lib.gecko.win32.d.ts | 3 + src/zen/@types/lib.gecko.xpcom.d.ts | 3 + src/zen/@types/lib.gecko.xpidl.d.ts | 3 + src/zen/common/ZenUIManager.mjs | 8 + ...UIMigration.mjs => ZenUIMigration.sys.mjs} | 0 src/zen/common/moz.build | 1 + src/zen/common/styles/zen-urlbar.css | 45 ++- src/zen/images/favicons/calendar.svg | 5 + src/zen/images/favicons/discord.svg | 5 + src/zen/images/favicons/figma.svg | 5 + src/zen/images/favicons/github.svg | 5 + src/zen/images/favicons/notion.svg | 5 + src/zen/images/favicons/obsidian.svg | 5 + src/zen/images/favicons/reddit.svg | 5 + src/zen/images/favicons/slack.svg | 5 + src/zen/images/favicons/trello.svg | 5 + src/zen/images/favicons/x.svg | 5 + src/zen/kbs/ZenKeyboardShortcuts.mjs | 65 +++- src/zen/moz.build | 2 +- src/zen/tests/moz.build | 1 + src/zen/tests/ub-actions/browser.toml | 5 + .../ub-actions/browser_ub_actions_search.js | 23 ++ src/zen/urlbar/ZenUBActionsProvider.sys.mjs | 277 ++++++++++++++++++ src/zen/urlbar/ZenUBGlobalActions.sys.mjs | 17 ++ src/zen/urlbar/ZenUBProvider.sys.mjs | 16 + src/zen/urlbar/moz.build | 9 + 37 files changed, 541 insertions(+), 21 deletions(-) rename src/zen/common/{ZenUIMigration.mjs => ZenUIMigration.sys.mjs} (100%) create mode 100644 src/zen/tests/ub-actions/browser.toml create mode 100644 src/zen/tests/ub-actions/browser_ub_actions_search.js create mode 100644 src/zen/urlbar/ZenUBActionsProvider.sys.mjs create mode 100644 src/zen/urlbar/ZenUBGlobalActions.sys.mjs create mode 100644 src/zen/urlbar/ZenUBProvider.sys.mjs create mode 100644 src/zen/urlbar/moz.build diff --git a/prefs/zen-urlbar.yaml b/prefs/zen-urlbar.yaml index 9e6b435f3..b9b0533d4 100644 --- a/prefs/zen-urlbar.yaml +++ b/prefs/zen-urlbar.yaml @@ -22,3 +22,8 @@ - name: zen.urlbar.enable-overrides value: false + +# Mark: Zen suggestions controls + +- name: zen.urlbar.suggestions.quick-actions + value: true diff --git a/src/browser/base/content/zen-assets.jar.inc.mn b/src/browser/base/content/zen-assets.jar.inc.mn index 7fe689ff0..67e089715 100644 --- a/src/browser/base/content/zen-assets.jar.inc.mn +++ b/src/browser/base/content/zen-assets.jar.inc.mn @@ -8,7 +8,6 @@ content/browser/zen-sets.js (../../zen/common/zen-sets.js) content/browser/ZenUIManager.mjs (../../zen/common/ZenUIManager.mjs) content/browser/zen-components/ZenActorsManager.mjs (../../zen/common/ZenActorsManager.mjs) - content/browser/zen-components/ZenUIMigration.mjs (../../zen/common/ZenUIMigration.mjs) content/browser/zen-components/ZenCommonUtils.mjs (../../zen/common/ZenCommonUtils.mjs) content/browser/zen-components/ZenSessionStore.mjs (../../zen/common/ZenSessionStore.mjs) content/browser/zen-components/ZenEmojisData.min.mjs (../../zen/common/emojis/ZenEmojisData.min.mjs) diff --git a/src/browser/components/BrowserGlue-sys-mjs.patch b/src/browser/components/BrowserGlue-sys-mjs.patch index ba2d411ef..b7d6408ac 100644 --- a/src/browser/components/BrowserGlue-sys-mjs.patch +++ b/src/browser/components/BrowserGlue-sys-mjs.patch @@ -1,12 +1,12 @@ diff --git a/browser/components/BrowserGlue.sys.mjs b/browser/components/BrowserGlue.sys.mjs -index eae3ed9518ad9ce2103bb912963465c1b10ac050..51859cd542bc69f524d891a67e725c30d4cf14bb 100644 +index eae3ed9518ad9ce2103bb912963465c1b10ac050..ccbb04cd36fd8fd63fd8c9ebd0b51f0a5966829c 100644 --- a/browser/components/BrowserGlue.sys.mjs +++ b/browser/components/BrowserGlue.sys.mjs @@ -8,6 +8,7 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { -+ gZenUIMigration: "chrome://browser/content/zen-components/ZenUIMigration.mjs", ++ gZenUIMigration: "resource:///modules/ZenUIMigration.sys.mjs", AboutHomeStartupCache: "resource:///modules/AboutHomeStartupCache.sys.mjs", AWToolbarButton: "resource:///modules/aboutwelcome/AWToolbarUtils.sys.mjs", ASRouter: "resource:///modules/asrouter/ASRouter.sys.mjs", diff --git a/src/zen/@types/lib.gecko.darwin.d.ts b/src/zen/@types/lib.gecko.darwin.d.ts index 400ad03f7..9fbe0954c 100644 --- a/src/zen/@types/lib.gecko.darwin.d.ts +++ b/src/zen/@types/lib.gecko.darwin.d.ts @@ -1,3 +1,6 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// 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/. /** * NOTE: Do not modify this file by hand. * Content was generated from source XPCOM .idl files. diff --git a/src/zen/@types/lib.gecko.dom.d.ts b/src/zen/@types/lib.gecko.dom.d.ts index 024b28296..765ef7ca1 100644 --- a/src/zen/@types/lib.gecko.dom.d.ts +++ b/src/zen/@types/lib.gecko.dom.d.ts @@ -1,3 +1,6 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// 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/. /** * NOTE: Do not modify this file by hand. * Content was generated from source .webidl files. diff --git a/src/zen/@types/lib.gecko.glean.d.ts b/src/zen/@types/lib.gecko.glean.d.ts index 522b87c05..fc46b3b26 100644 --- a/src/zen/@types/lib.gecko.glean.d.ts +++ b/src/zen/@types/lib.gecko.glean.d.ts @@ -1,3 +1,6 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// 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/. /** * NOTE: Do not modify this file by hand. * Content was generated from glean .yaml files. diff --git a/src/zen/@types/lib.gecko.linux.d.ts b/src/zen/@types/lib.gecko.linux.d.ts index 78f933974..d38d49d38 100644 --- a/src/zen/@types/lib.gecko.linux.d.ts +++ b/src/zen/@types/lib.gecko.linux.d.ts @@ -1,3 +1,6 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// 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/. /** * NOTE: Do not modify this file by hand. * Content was generated from source XPCOM .idl files. diff --git a/src/zen/@types/lib.gecko.modules.d.ts b/src/zen/@types/lib.gecko.modules.d.ts index dc9bafaab..39e78034a 100644 --- a/src/zen/@types/lib.gecko.modules.d.ts +++ b/src/zen/@types/lib.gecko.modules.d.ts @@ -1,3 +1,6 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// 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/. /** * NOTE: Do not modify this file by hand. * Content was generated by running "mach ts paths". diff --git a/src/zen/@types/lib.gecko.nsresult.d.ts b/src/zen/@types/lib.gecko.nsresult.d.ts index 7c810658d..615709a0d 100644 --- a/src/zen/@types/lib.gecko.nsresult.d.ts +++ b/src/zen/@types/lib.gecko.nsresult.d.ts @@ -1,3 +1,6 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// 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/. /** * NOTE: Do not modify this file by hand. * Content was generated from xpc.msg and error_list.json. diff --git a/src/zen/@types/lib.gecko.services.d.ts b/src/zen/@types/lib.gecko.services.d.ts index 149327c68..35c3182ff 100644 --- a/src/zen/@types/lib.gecko.services.d.ts +++ b/src/zen/@types/lib.gecko.services.d.ts @@ -1,3 +1,6 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// 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/. /** * NOTE: Do not modify this file by hand. * Content was generated from services.json. diff --git a/src/zen/@types/lib.gecko.tweaks.d.ts b/src/zen/@types/lib.gecko.tweaks.d.ts index d2474244d..3f3392bf2 100644 --- a/src/zen/@types/lib.gecko.tweaks.d.ts +++ b/src/zen/@types/lib.gecko.tweaks.d.ts @@ -1,3 +1,6 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// 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/. /** * Gecko generic/specialized adjustments for xpcom and webidl types. */ diff --git a/src/zen/@types/lib.gecko.win32.d.ts b/src/zen/@types/lib.gecko.win32.d.ts index a9f74a6a9..2a8cddafd 100644 --- a/src/zen/@types/lib.gecko.win32.d.ts +++ b/src/zen/@types/lib.gecko.win32.d.ts @@ -1,3 +1,6 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// 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/. /** * NOTE: Do not modify this file by hand. * Content was generated from source XPCOM .idl files. diff --git a/src/zen/@types/lib.gecko.xpcom.d.ts b/src/zen/@types/lib.gecko.xpcom.d.ts index 723b6ea97..3786f6fbc 100644 --- a/src/zen/@types/lib.gecko.xpcom.d.ts +++ b/src/zen/@types/lib.gecko.xpcom.d.ts @@ -1,3 +1,6 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// 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/. /** * NOTE: Do not modify this file by hand. * Content was generated from source XPCOM .idl files. diff --git a/src/zen/@types/lib.gecko.xpidl.d.ts b/src/zen/@types/lib.gecko.xpidl.d.ts index 97e0a04c9..7ab726f19 100644 --- a/src/zen/@types/lib.gecko.xpidl.d.ts +++ b/src/zen/@types/lib.gecko.xpidl.d.ts @@ -1,3 +1,6 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// 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/. /** * Gecko XPIDL base types. */ diff --git a/src/zen/common/ZenUIManager.mjs b/src/zen/common/ZenUIManager.mjs index b61f74794..365e13fee 100644 --- a/src/zen/common/ZenUIManager.mjs +++ b/src/zen/common/ZenUIManager.mjs @@ -75,6 +75,14 @@ var gZenUIManager = { this._initCreateNewPopup(); this._debloatContextMenus(); + this._initOmniboxCommands(); + }, + + _initOmniboxCommands() { + const { registerZenUrlbarProviders } = ChromeUtils.importESModule( + 'resource:///modules/ZenUBProvider.sys.mjs' + ); + registerZenUrlbarProviders(); }, _debloatContextMenus() { diff --git a/src/zen/common/ZenUIMigration.mjs b/src/zen/common/ZenUIMigration.sys.mjs similarity index 100% rename from src/zen/common/ZenUIMigration.mjs rename to src/zen/common/ZenUIMigration.sys.mjs diff --git a/src/zen/common/moz.build b/src/zen/common/moz.build index 86c57726c..2de29514c 100644 --- a/src/zen/common/moz.build +++ b/src/zen/common/moz.build @@ -4,4 +4,5 @@ EXTRA_JS_MODULES += [ "ZenCustomizableUI.sys.mjs", + "ZenUIMigration.sys.mjs", ] diff --git a/src/zen/common/styles/zen-urlbar.css b/src/zen/common/styles/zen-urlbar.css index 7b71af908..fe49658f8 100644 --- a/src/zen/common/styles/zen-urlbar.css +++ b/src/zen/common/styles/zen-urlbar.css @@ -61,8 +61,11 @@ } #urlbar:not([breakout-extend='true']) { - :root:not([supress-primary-adjustment]) & .urlbar-background { + & .urlbar-background { transition: background-color 0.15s ease; + :root[supress-primary-adjustment] & { + transition: none !important; + } } &:hover .urlbar-background { @@ -559,6 +562,22 @@ button.popup-notification-dropmarker { border-top: none !important; } +.urlbarView-shortcutContent { + border-radius: 4px; + padding: 6px 8px; + font-size: 10px; + font-weight: 600; + text-transform: uppercase; + margin-left: auto; + margin-top: auto; + margin-bottom: auto; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1); + + &:empty { + display: none !important; + } +} + .urlbarView-row[has-action]:is([type='switchtab'], [type='remotetab'], [type='clipboard']) { & .urlbarView-action:last-child { margin-left: auto !important; @@ -616,15 +635,14 @@ button.popup-notification-dropmarker { --urlbarView-item-inline-padding: 8px; --urlbarView-item-block-padding: 10px; - &:hover { - .urlbarView-favicon, - & { - background-color: color-mix( - in srgb, - var(--zen-branding-bg-reverse) 5%, - transparent 95% - ) !important; - } + &:hover.urlbarView-favicon, + &:hover, + & .urlbarView-shortcutContent { + background-color: color-mix( + in srgb, + var(--zen-branding-bg-reverse) 5%, + transparent 95% + ) !important; } &[selected] { @@ -643,7 +661,12 @@ button.popup-notification-dropmarker { fill: black !important; } - & .urlbarView-favicon { + & .urlbarView-shortcutContent { + color: black !important; + } + + & .urlbarView-favicon, + & .urlbarView-shortcutContent { background-color: rgba(255, 255, 255, 0.9) !important; } } diff --git a/src/zen/images/favicons/calendar.svg b/src/zen/images/favicons/calendar.svg index fd4edd73a..15e7f3ba7 100644 --- a/src/zen/images/favicons/calendar.svg +++ b/src/zen/images/favicons/calendar.svg @@ -1,3 +1,8 @@ + diff --git a/src/zen/images/favicons/discord.svg b/src/zen/images/favicons/discord.svg index 5b5e3df23..bb16ea0c6 100644 --- a/src/zen/images/favicons/discord.svg +++ b/src/zen/images/favicons/discord.svg @@ -1,3 +1,8 @@ + diff --git a/src/zen/images/favicons/figma.svg b/src/zen/images/favicons/figma.svg index ed566dcc1..5f400059b 100644 --- a/src/zen/images/favicons/figma.svg +++ b/src/zen/images/favicons/figma.svg @@ -1,3 +1,8 @@ + diff --git a/src/zen/images/favicons/github.svg b/src/zen/images/favicons/github.svg index 9b39d72a5..242dd5c86 100644 --- a/src/zen/images/favicons/github.svg +++ b/src/zen/images/favicons/github.svg @@ -1 +1,6 @@ + \ No newline at end of file diff --git a/src/zen/images/favicons/notion.svg b/src/zen/images/favicons/notion.svg index 1da179e0b..f5876ace0 100644 --- a/src/zen/images/favicons/notion.svg +++ b/src/zen/images/favicons/notion.svg @@ -1,3 +1,8 @@ + diff --git a/src/zen/images/favicons/obsidian.svg b/src/zen/images/favicons/obsidian.svg index 02b119b1c..b8349e998 100644 --- a/src/zen/images/favicons/obsidian.svg +++ b/src/zen/images/favicons/obsidian.svg @@ -1,3 +1,8 @@ + diff --git a/src/zen/images/favicons/reddit.svg b/src/zen/images/favicons/reddit.svg index fcb08b5e6..95447b8e1 100644 --- a/src/zen/images/favicons/reddit.svg +++ b/src/zen/images/favicons/reddit.svg @@ -1,3 +1,8 @@ + diff --git a/src/zen/images/favicons/slack.svg b/src/zen/images/favicons/slack.svg index 2cdecb2a9..2d370e471 100644 --- a/src/zen/images/favicons/slack.svg +++ b/src/zen/images/favicons/slack.svg @@ -1,3 +1,8 @@ + diff --git a/src/zen/images/favicons/trello.svg b/src/zen/images/favicons/trello.svg index 4411e5026..ca092ed8f 100644 --- a/src/zen/images/favicons/trello.svg +++ b/src/zen/images/favicons/trello.svg @@ -1,3 +1,8 @@ + diff --git a/src/zen/images/favicons/x.svg b/src/zen/images/favicons/x.svg index 966787626..e6afe972e 100644 --- a/src/zen/images/favicons/x.svg +++ b/src/zen/images/favicons/x.svg @@ -1,3 +1,8 @@ + diff --git a/src/zen/kbs/ZenKeyboardShortcuts.mjs b/src/zen/kbs/ZenKeyboardShortcuts.mjs index 819e05ed7..8d309e357 100644 --- a/src/zen/kbs/ZenKeyboardShortcuts.mjs +++ b/src/zen/kbs/ZenKeyboardShortcuts.mjs @@ -194,20 +194,26 @@ class nsKeyShortcutModifiers { toUserString() { let str = ''; + const separation = AppConstants.platform == 'macosx' ? ' ' : '+'; if (this.#control && !this.#accel) { - str += 'Ctrl+'; + str += AppConstants.platform == 'macosx' ? '⌃' : 'Ctrl'; + str += separation; } if (this.#alt) { - str += AppConstants.platform == 'macosx' ? 'Option+' : 'Alt+'; + str += AppConstants.platform == 'macosx' ? '⌥' : 'Alt'; + str += separation; } if (this.#shift) { - str += 'Shift+'; + str += '⇧'; + str += separation; } if (this.#meta) { - str += AppConstants.platform == 'macosx' ? 'Cmd+' : 'Win+'; + str += AppConstants.platform == 'macosx' ? '⌘' : 'Win'; + str += separation; } if (this.#accel) { - str += AppConstants.platform == 'macosx' ? 'Cmd+' : 'Ctrl+'; + str += AppConstants.platform == 'macosx' ? '⌘' : 'Ctrl'; + str += separation; } return str; } @@ -546,7 +552,32 @@ class KeyShortcut { // Get the key from the value for (let [key, value] of Object.entries(KEYCODE_MAP)) { if (value == this.#keycode) { - str += key.toLowerCase(); + const normalizedKey = key.toLowerCase(); + switch (normalizedKey) { + case 'arrowleft': + str += '←'; + break; + case 'arrowright': + str += '→'; + break; + case 'arrowup': + str += '↑'; + break; + case 'arrowdown': + str += '↓'; + break; + case 'escape': + str += AppConstants.platform == 'macosx' ? '⎋' : 'Esc'; + break; + case 'enter': + str += AppConstants.platform == 'macosx' ? '↩' : 'Enter'; + break; + case 'space': + str += AppConstants.platform == 'macosx' ? '␣' : 'Space'; + break; + default: + str += normalizedKey; + } break; } } @@ -1315,6 +1346,28 @@ var gZenKeyboardShortcutsManager = { return false; }, + + getShortcutFromCommand(command) { + for (let targetShortcut of this._currentShortcutList) { + if (targetShortcut.getAction() == command) { + return targetShortcut; + } + } + return null; + }, + + /** + * Get the shortcut as a display format for a given action/command. + * @param {string} command The action/command to search for + * @returns {string|null} The shortcut as a string or null if not found + */ + getShortcutDisplayFromCommand(command) { + const shortcut = this.getShortcutFromCommand(command); + if (shortcut) { + return shortcut.toUserString(); + } + return null; + }, }; document.addEventListener( diff --git a/src/zen/moz.build b/src/zen/moz.build index 1840323d7..56782122f 100644 --- a/src/zen/moz.build +++ b/src/zen/moz.build @@ -1,4 +1,3 @@ -# # This Source Code Form is subject to the terms of the Mozilla Public # 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/. @@ -8,5 +7,6 @@ DIRS += [ "glance", "mods", "tests", + "urlbar", "toolkit", ] diff --git a/src/zen/tests/moz.build b/src/zen/tests/moz.build index 06a9b9604..fd6101bce 100644 --- a/src/zen/tests/moz.build +++ b/src/zen/tests/moz.build @@ -10,6 +10,7 @@ BROWSER_CHROME_MANIFESTS += [ "pinned/browser.toml", "split_view/browser.toml", "tabs/browser.toml", + "ub-actions/browser.toml", "urlbar/browser.toml", "welcome/browser.toml", "workspaces/browser.toml", diff --git a/src/zen/tests/ub-actions/browser.toml b/src/zen/tests/ub-actions/browser.toml new file mode 100644 index 000000000..c3b3936c2 --- /dev/null +++ b/src/zen/tests/ub-actions/browser.toml @@ -0,0 +1,5 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# 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/. + +["browser_ub_actions_search.js"] \ No newline at end of file diff --git a/src/zen/tests/ub-actions/browser_ub_actions_search.js b/src/zen/tests/ub-actions/browser_ub_actions_search.js new file mode 100644 index 000000000..372598f0b --- /dev/null +++ b/src/zen/tests/ub-actions/browser_ub_actions_search.js @@ -0,0 +1,23 @@ +/* Any copyright is dedicated to the Public Domain. + https://creativecommons.org/publicdomain/zero/1.0/ */ + +'use strict'; + +ChromeUtils.defineESModuleGetters(this, { + globalActions: 'resource:///modules/ZenUBGlobalActions.sys.mjs', + UrlbarTestUtils: 'resource://testing-common/UrlbarTestUtils.sys.mjs', +}); + +add_task(async function test_Ub_Actions_Search() { + for (const action of globalActions) { + const label = action.label; + await UrlbarTestUtils.promiseAutocompleteResultPopup({ + window, + waitForFocus, + value: label, + }); + let { result } = await UrlbarTestUtils.getRowAt(window, 1); + Assert.equal(result.providerName, 'ZenUrlbarProviderGlobalActions'); + Assert.equal(result.payload.title, label); + } +}); diff --git a/src/zen/urlbar/ZenUBActionsProvider.sys.mjs b/src/zen/urlbar/ZenUBActionsProvider.sys.mjs new file mode 100644 index 000000000..d1cef4e36 --- /dev/null +++ b/src/zen/urlbar/ZenUBActionsProvider.sys.mjs @@ -0,0 +1,277 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +import { XPCOMUtils } from 'resource://gre/modules/XPCOMUtils.sys.mjs'; +import { UrlbarProvider, UrlbarUtils } from 'resource:///modules/UrlbarUtils.sys.mjs'; +import { globalActions } from 'resource:///modules/ZenUBGlobalActions.sys.mjs'; + +const lazy = {}; + +const DYNAMIC_TYPE_NAME = 'zen-actions'; + +// The suggestion index of the actions row within the urlbar results. +const MAX_RECENT_ACTIONS = 5; +const MINIMUM_QUERY_SCORE = 93; + +const EN_LOCALE_MATCH = /^en(-.*)$/; + +ChromeUtils.defineESModuleGetters(lazy, { + UrlbarResult: 'resource:///modules/UrlbarResult.sys.mjs', + UrlbarTokenizer: 'resource:///modules/UrlbarTokenizer.sys.mjs', + QueryScorer: 'resource:///modules/UrlbarProviderInterventions.sys.mjs', + BrowserWindowTracker: 'resource:///modules/BrowserWindowTracker.sys.mjs', +}); + +XPCOMUtils.defineLazyPreferenceGetter( + lazy, + 'enabledPref', + 'zen.urlbar.suggestions.quick-actions', + true +); + +/** + * A provider that lets the user view all available global actions for a query. + */ +export class ZenUrlbarProviderGlobalActions extends UrlbarProvider { + get name() { + return 'ZenUrlbarProviderGlobalActions'; + } + + /** + * @returns {Values} + */ + get type() { + return UrlbarUtils.PROVIDER_TYPE.PROFILE; + } + + /** + * Whether this provider should be invoked for the given context. + * If this method returns false, the providers manager won't start a query + * with this provider, to save on resources. + * + * @param {UrlbarQueryContext} queryContext The query context object + */ + async isActive(queryContext) { + return ( + lazy.enabledPref && + queryContext.searchString && + queryContext.searchString.length < UrlbarUtils.MAX_TEXT_LENGTH && + queryContext.searchString.length > 2 && + !lazy.UrlbarTokenizer.REGEXP_LIKE_PROTOCOL.test(queryContext.searchString) && + EN_LOCALE_MATCH.test(Services.locale.appLocaleAsBCP47) + ); + } + + /** + * @returns All the available global actions. + */ + get #availableActions() { + return globalActions.filter((a) => + typeof a.isAvailable === 'function' ? a.isAvailable() : true + ); + } + + /** + * Starts a search query amongst the available global actions. + * + * @param {string} queryContext The query context object + */ + #findMatchingActions(query) { + const actions = this.#availableActions; + let results = []; + for (let action of actions) { + const label = action.label; + const score = this.#calculateFuzzyScore(label, query); + if (score > MINIMUM_QUERY_SCORE) { + results.push({ + score, + action, + }); + } + } + results.sort((a, b) => b.score - a.score); + return results.slice(0, MAX_RECENT_ACTIONS).map((r) => r.action); + } + + /** + * A VS Code-style fuzzy scoring algorithm. + * @param {string} target The string to score against. + * @param {string} query The user's search query. + * @returns {number} A score representing the match quality. + * + * @credits Thanks a lot @BibekBhusal0 on GitHub for this implementation! + */ + #calculateFuzzyScore(target, query) { + if (!target || !query) return 0; + const targetLower = target.toLowerCase(); + const queryLower = query.toLowerCase(); + const targetLen = target.length; + const queryLen = query.length; + if (queryLen > targetLen) return 0; + if (queryLen === 0) return 0; + // 1. Exact match gets the highest score. + if (targetLower === queryLower) { + return 200; + } + // 2. Exact prefix matches are heavily prioritized. + if (targetLower.startsWith(queryLower)) { + return 100 + queryLen; + } + // 3. Exact abbreviation (e.g., 'tcm' for 'Toggle Compact Mode') + const initials = targetLower + .split(/[\s-_]+/) + .map((word) => word[0]) + .join(''); + if (initials === queryLower) { + return 90 + queryLen; + } + let score = 0; + let queryIndex = 0; + let lastMatchIndex = -1; + let consecutiveMatches = 0; + for (let targetIndex = 0; targetIndex < targetLen; targetIndex++) { + if (queryIndex < queryLen && targetLower[targetIndex] === queryLower[queryIndex]) { + let bonus = 10; + // Bonus for matching at the beginning of a word + if (targetIndex === 0 || [' ', '-', '_'].includes(targetLower[targetIndex - 1])) { + bonus += 15; + } + // Bonus for consecutive matches + if (lastMatchIndex === targetIndex - 1) { + consecutiveMatches++; + bonus += 20 * consecutiveMatches; + } else { + consecutiveMatches = 0; + } + // Penalty for distance from the last match + if (lastMatchIndex !== -1) { + const distance = targetIndex - lastMatchIndex; + bonus -= Math.min(distance - 1, 10); // Cap penalty + } + score += bonus; + lastMatchIndex = targetIndex; + queryIndex++; + } + } + return queryIndex === queryLen ? score : 0; + } + + async startQuery(queryContext, addCallback) { + const query = queryContext.searchString.trim().toLowerCase(); + if (!query) { + return; + } + + const actionsResults = this.#findMatchingActions(query); + if (!actionsResults.length) { + return; + } + + const ownerGlobal = lazy.BrowserWindowTracker.getTopWindow(); + for (const action of actionsResults) { + const [payload, payloadHighlights] = lazy.UrlbarResult.payloadAndSimpleHighlights([], { + suggestion: action.label, + title: action.label, + query: queryContext.searchString, + zenCommand: action.command, + dynamicType: DYNAMIC_TYPE_NAME, + icon: action.icon || 'chrome://browser/skin/trending.svg', + shortcutContent: ownerGlobal.gZenKeyboardShortcutsManager.getShortcutDisplayFromCommand( + action.command + ), + }); + + let result = new lazy.UrlbarResult( + UrlbarUtils.RESULT_TYPE.DYNAMIC, + UrlbarUtils.RESULT_SOURCE.OTHER_LOCAL, + payload, + payloadHighlights + ); + if (action.suggestedIndex) { + result.suggestedIndex = action.suggestedIndex; + } + addCallback(this, result); + } + } + + /** + * Gets the provider's priority. + * + * @returns {number} The provider's priority for the given query. + */ + getPriority() { + return 0; + } + + /** + * This is called only for dynamic result types, when the urlbar view updates + * the view of one of the results of the provider. It should return an object + * describing the view update. + * + * @param {UrlbarResult} result The result whose view will be updated. + * @returns {object} An object describing the view update. + */ + getViewUpdate(result) { + return { + icon: { + attributes: { + src: result.payload.icon || 'chrome://browser/skin/trending.svg', + }, + }, + titleStrong: { + textContent: result.payload.title, + attributes: { dir: 'ltr' }, + }, + shortcutContent: { + textContent: result.payload.shortcutContent || '', + }, + }; + } + + getViewTemplate() { + return { + attributes: { + selectable: true, + }, + children: [ + { + name: 'icon', + tag: 'img', + classList: ['urlbarView-favicon'], + }, + { + name: 'title', + tag: 'span', + classList: ['urlbarView-title'], + children: [ + { + name: 'titleStrong', + tag: 'strong', + }, + ], + }, + { + name: 'shortcutContent', + tag: 'span', + classList: ['urlbarView-shortcutContent'], + }, + ], + }; + } + + onEngagement(queryContext, controller, details) { + const result = details.result; + const payload = result.payload; + const command = payload.zenCommand; + if (!command) { + return; + } + const ownerGlobal = details.element.ownerGlobal; + const commandToRun = ownerGlobal.document.getElementById(command); + if (commandToRun) { + ownerGlobal.gBrowser.selectedBrowser.focus(); + commandToRun.doCommand(); + } + } +} diff --git a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs new file mode 100644 index 000000000..737162308 --- /dev/null +++ b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs @@ -0,0 +1,17 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +export const globalActions = [ + { + label: 'Toggle Compact Mode', + command: 'cmd_zenCompactModeToggle', + icon: 'chrome://browser/skin/zen-icons/sidebar.svg', + }, + { + label: 'Open Theme Picker', + command: 'cmd_zenOpenZenThemePicker', + icon: 'chrome://browser/skin/zen-icons/edit-theme.svg', + suggestedIndex: 4, + }, +]; diff --git a/src/zen/urlbar/ZenUBProvider.sys.mjs b/src/zen/urlbar/ZenUBProvider.sys.mjs new file mode 100644 index 000000000..414c98725 --- /dev/null +++ b/src/zen/urlbar/ZenUBProvider.sys.mjs @@ -0,0 +1,16 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +import { UrlbarProvidersManager } from 'resource:///modules/UrlbarProvidersManager.sys.mjs'; + +const providers = {}; +ChromeUtils.defineESModuleGetters(providers, { + ZenUrlbarProviderGlobalActions: 'resource:///modules/ZenUBActionsProvider.sys.mjs', +}); + +export function registerZenUrlbarProviders() { + for (let provider of Object.values(providers)) { + UrlbarProvidersManager.registerProvider(new provider()); + } +} diff --git a/src/zen/urlbar/moz.build b/src/zen/urlbar/moz.build new file mode 100644 index 000000000..306a7c08b --- /dev/null +++ b/src/zen/urlbar/moz.build @@ -0,0 +1,9 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# 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/. + +EXTRA_JS_MODULES += [ + "ZenUBActionsProvider.sys.mjs", + "ZenUBGlobalActions.sys.mjs", + "ZenUBProvider.sys.mjs", +] From 5c8e6dd5a43e81eaa9960dfa9d44e98ea3778cee Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Sat, 13 Sep 2025 01:46:35 +0200 Subject: [PATCH 3/5] chore: Change the use of `hidden` after the new firefox update, b=no-bug, c=compact-mode, split-view, workspaces --- src/zen/compact-mode/ZenCompactMode.mjs | 3 ++- src/zen/split-view/ZenViewSplitter.mjs | 15 +++++++++++---- src/zen/workspaces/ZenGradientGenerator.mjs | 11 ++++++++--- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/zen/compact-mode/ZenCompactMode.mjs b/src/zen/compact-mode/ZenCompactMode.mjs index 1f0d70eb3..9232af336 100644 --- a/src/zen/compact-mode/ZenCompactMode.mjs +++ b/src/zen/compact-mode/ZenCompactMode.mjs @@ -189,10 +189,11 @@ var gZenCompactModeManager = { updateCompactModeContext(isSingleToolbar) { const menuitem = document.getElementById('zen-context-menu-compact-mode-toggle'); const menu = document.getElementById('zen-context-menu-compact-mode'); - menu.setAttribute('hidden', isSingleToolbar); if (isSingleToolbar) { + menu.setAttribute('hidden', 'true'); menu.before(menuitem); } else { + menu.removeAttribute('hidden'); menu.querySelector('menupopup').prepend(menuitem); } }, diff --git a/src/zen/split-view/ZenViewSplitter.mjs b/src/zen/split-view/ZenViewSplitter.mjs index b50a12a93..39c8b4edc 100644 --- a/src/zen/split-view/ZenViewSplitter.mjs +++ b/src/zen/split-view/ZenViewSplitter.mjs @@ -513,7 +513,11 @@ class nsZenViewSplitter extends nsZenDOMOperatedFeature { const wrapper = this.overlay?.parentNode; if (!wrapper) return; - wrapper.setAttribute('hidden', !value); + if (!value) { + wrapper.setAttribute('hidden', 'true'); + } else { + wrapper.removeAttribute('hidden'); + } } enableTabRearrangeView(tabDrag = false) { @@ -896,9 +900,12 @@ class nsZenViewSplitter extends nsZenDOMOperatedFeature { tabCount: window.gBrowser.selectedTabs.length, }); document.getElementById('context_zenSplitTabs').setAttribute('data-l10n-args', tabCountInfo); - document - .getElementById('context_zenSplitTabs') - .setAttribute('hidden', !this.contextCanSplitTabs()); + const splitTabs = document.getElementById('context_zenSplitTabs'); + if (!this.contextCanSplitTabs()) { + splitTabs.setAttribute('hidden', 'true'); + } else { + splitTabs.removeAttribute('hidden'); + } }); } diff --git a/src/zen/workspaces/ZenGradientGenerator.mjs b/src/zen/workspaces/ZenGradientGenerator.mjs index 2bc5d6bb5..1c287d894 100644 --- a/src/zen/workspaces/ZenGradientGenerator.mjs +++ b/src/zen/workspaces/ZenGradientGenerator.mjs @@ -1400,9 +1400,14 @@ ? workspaceTheme.gradientColors.length >= nsZenThemePicker.MAX_DOTS : false); } - document - .getElementById('PanelUI-zen-gradient-generator-color-click-to-add') - .toggleAttribute('hidden', workspaceTheme.gradientColors.length > 0); + const clickToAdd = browser.document.getElementById( + 'PanelUI-zen-gradient-generator-color-click-to-add' + ); + if (workspaceTheme.gradientColors.length > 0) { + clickToAdd.setAttribute('hidden', 'true'); + } else { + clickToAdd.removeAttribute('hidden'); + } opacitySlider.value = browser.gZenThemePicker.currentOpacity; const textureSelectWrapper = browser.document.getElementById( From 9776a049dff43b37ed479c811617ce24fe477b34 Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Sat, 13 Sep 2025 14:40:02 +0200 Subject: [PATCH 4/5] feat: First urlbar action must be selected, b=no-bug, c=common, tests, workspaces --- .../UrlbarProvidersManager-sys-mjs.patch | 13 ---------- .../urlbar/UrlbarView-sys-mjs.patch | 26 ++++++++++++++++--- src/zen/common/styles/zen-theme.css | 12 +++------ .../ub-actions/browser_ub_actions_search.js | 2 +- src/zen/urlbar/ZenUBActionsProvider.sys.mjs | 15 +++-------- src/zen/urlbar/ZenUBGlobalActions.sys.mjs | 1 + src/zen/urlbar/ZenUBProvider.sys.mjs | 8 ++++-- src/zen/workspaces/ZenGradientGenerator.mjs | 17 +++++++----- 8 files changed, 50 insertions(+), 44 deletions(-) delete mode 100644 src/browser/components/urlbar/UrlbarProvidersManager-sys-mjs.patch diff --git a/src/browser/components/urlbar/UrlbarProvidersManager-sys-mjs.patch b/src/browser/components/urlbar/UrlbarProvidersManager-sys-mjs.patch deleted file mode 100644 index efba36500..000000000 --- a/src/browser/components/urlbar/UrlbarProvidersManager-sys-mjs.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/browser/components/urlbar/UrlbarProvidersManager.sys.mjs b/browser/components/urlbar/UrlbarProvidersManager.sys.mjs -index 555273f6ea1efd77aa3062b9910bbfe28568775d..c8aae86e1233d256e538970d58fd0febed745893 100644 ---- a/browser/components/urlbar/UrlbarProvidersManager.sys.mjs -+++ b/browser/components/urlbar/UrlbarProvidersManager.sys.mjs -@@ -138,7 +138,7 @@ class ProvidersManager { - // To improve dataflow and reduce UI work, when a result is added we may notify - // it to the controller after a delay, so that we can chunk results in that - // timeframe into a single call. See _notifyResultsFromProvider for details. -- this.CHUNK_RESULTS_DELAY_MS = 16; -+ this.CHUNK_RESULTS_DELAY_MS = 20; - } - - /** diff --git a/src/browser/components/urlbar/UrlbarView-sys-mjs.patch b/src/browser/components/urlbar/UrlbarView-sys-mjs.patch index 5767343e4..0ece37d21 100644 --- a/src/browser/components/urlbar/UrlbarView-sys-mjs.patch +++ b/src/browser/components/urlbar/UrlbarView-sys-mjs.patch @@ -1,5 +1,5 @@ diff --git a/browser/components/urlbar/UrlbarView.sys.mjs b/browser/components/urlbar/UrlbarView.sys.mjs -index fdbab8806fd320f4aacec46a42c8ef953580d00c..a1be83735cd2b69d335cd36d3287cd3b3e3f2a5b 100644 +index fdbab8806fd320f4aacec46a42c8ef953580d00c..40568280c3ba2f0a36f4443a5116430d3c502ec1 100644 --- a/browser/components/urlbar/UrlbarView.sys.mjs +++ b/browser/components/urlbar/UrlbarView.sys.mjs @@ -613,7 +613,7 @@ export class UrlbarView { @@ -11,7 +11,27 @@ index fdbab8806fd320f4aacec46a42c8ef953580d00c..a1be83735cd2b69d335cd36d3287cd3b // Try to reuse the cached top-sites context. If it's not cached, then // there will be a gap of time between when the input is focused and // when the view opens that can be perceived as flicker. -@@ -1341,7 +1341,7 @@ export class UrlbarView { +@@ -823,6 +823,19 @@ export class UrlbarView { + // them, resembling tab-to-search. In that case, the input value is + // still associated with the first result. + this.input.setResultForCurrentValue(firstResult); ++ } else if (firstResult.payload.zenAction) { ++ this.#selectElement(this.getFirstSelectableElement(), { ++ updateInput: false, ++ setAccessibleFocus: ++ this.controller._userSelectionBehavior == "arrow", ++ }); ++ this.window.setTimeout(() => { ++ this.#selectElement(this.getFirstSelectableElement(), { ++ updateInput: false, ++ setAccessibleFocus: ++ this.controller._userSelectionBehavior == "arrow", ++ }); ++ }, 150); + } + } + +@@ -1341,7 +1354,7 @@ export class UrlbarView { includeHiddenExposures: true, }); let canBeVisible = @@ -20,7 +40,7 @@ index fdbab8806fd320f4aacec46a42c8ef953580d00c..a1be83735cd2b69d335cd36d3287cd3b if (result.isHiddenExposure) { if (canBeVisible) { this.controller.engagementEvent.addExposure( -@@ -3189,7 +3189,7 @@ export class UrlbarView { +@@ -3189,7 +3202,7 @@ export class UrlbarView { } #enableOrDisableRowWrap() { diff --git a/src/zen/common/styles/zen-theme.css b/src/zen/common/styles/zen-theme.css index cba88fd22..bf2a34ebc 100644 --- a/src/zen/common/styles/zen-theme.css +++ b/src/zen/common/styles/zen-theme.css @@ -206,7 +206,7 @@ --tab-close-button-padding: 5px !important; --input-border-color: var(--zen-input-border-color) !important; - --zen-themed-toolbar-bg-transparent: light-dark(var(--zen-branding-bg), #171717); + --zen-themed-toolbar-bg-transparent: transparent; --zen-workspace-indicator-height: 46px; @@ -265,13 +265,9 @@ #main-window:not([chromehidden~='toolbar']) { min-height: 495px !important; - @media (-moz-windows-mica) or (-moz-platform: macos) or ((-moz-platform: linux) and -moz-pref('zen.widget.linux.transparency')) { - background: transparent; - --zen-themed-toolbar-bg-transparent: transparent; - - @media (-moz-windows-mica) and (not (-moz-pref('widget.windows.mica.toplevel-backdrop', 1))) and (not (-moz-pref('widget.windows.mica.toplevel-backdrop', 2))) { - --zen-themed-toolbar-bg-transparent: rgba(255, 255, 255, 0.2); - } + background: transparent; + @media (-moz-windows-mica) and (not (-moz-pref('widget.windows.mica.toplevel-backdrop', 1))) and (not (-moz-pref('widget.windows.mica.toplevel-backdrop', 2))) { + --zen-themed-toolbar-bg-transparent: rgba(255, 255, 255, 0.2); } &, diff --git a/src/zen/tests/ub-actions/browser_ub_actions_search.js b/src/zen/tests/ub-actions/browser_ub_actions_search.js index 372598f0b..847fb5d75 100644 --- a/src/zen/tests/ub-actions/browser_ub_actions_search.js +++ b/src/zen/tests/ub-actions/browser_ub_actions_search.js @@ -16,7 +16,7 @@ add_task(async function test_Ub_Actions_Search() { waitForFocus, value: label, }); - let { result } = await UrlbarTestUtils.getRowAt(window, 1); + let { result } = await UrlbarTestUtils.getRowAt(window, Math.min(action.suggestedIndex, 1)); Assert.equal(result.providerName, 'ZenUrlbarProviderGlobalActions'); Assert.equal(result.payload.title, label); } diff --git a/src/zen/urlbar/ZenUBActionsProvider.sys.mjs b/src/zen/urlbar/ZenUBActionsProvider.sys.mjs index d1cef4e36..18283e4f0 100644 --- a/src/zen/urlbar/ZenUBActionsProvider.sys.mjs +++ b/src/zen/urlbar/ZenUBActionsProvider.sys.mjs @@ -12,7 +12,7 @@ const DYNAMIC_TYPE_NAME = 'zen-actions'; // The suggestion index of the actions row within the urlbar results. const MAX_RECENT_ACTIONS = 5; -const MINIMUM_QUERY_SCORE = 93; +const MINIMUM_QUERY_SCORE = 92; const EN_LOCALE_MATCH = /^en(-.*)$/; @@ -42,7 +42,7 @@ export class ZenUrlbarProviderGlobalActions extends UrlbarProvider { * @returns {Values} */ get type() { - return UrlbarUtils.PROVIDER_TYPE.PROFILE; + return UrlbarUtils.PROVIDER_TYPE.HEURISTIC; } /** @@ -118,14 +118,6 @@ export class ZenUrlbarProviderGlobalActions extends UrlbarProvider { if (targetLower.startsWith(queryLower)) { return 100 + queryLen; } - // 3. Exact abbreviation (e.g., 'tcm' for 'Toggle Compact Mode') - const initials = targetLower - .split(/[\s-_]+/) - .map((word) => word[0]) - .join(''); - if (initials === queryLower) { - return 90 + queryLen; - } let score = 0; let queryIndex = 0; let lastMatchIndex = -1; @@ -176,6 +168,7 @@ export class ZenUrlbarProviderGlobalActions extends UrlbarProvider { query: queryContext.searchString, zenCommand: action.command, dynamicType: DYNAMIC_TYPE_NAME, + zenAction: true, icon: action.icon || 'chrome://browser/skin/trending.svg', shortcutContent: ownerGlobal.gZenKeyboardShortcutsManager.getShortcutDisplayFromCommand( action.command @@ -188,7 +181,7 @@ export class ZenUrlbarProviderGlobalActions extends UrlbarProvider { payload, payloadHighlights ); - if (action.suggestedIndex) { + if (typeof action.suggestedIndex === 'number') { result.suggestedIndex = action.suggestedIndex; } addCallback(this, result); diff --git a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs index 737162308..1b831ba03 100644 --- a/src/zen/urlbar/ZenUBGlobalActions.sys.mjs +++ b/src/zen/urlbar/ZenUBGlobalActions.sys.mjs @@ -7,6 +7,7 @@ export const globalActions = [ label: 'Toggle Compact Mode', command: 'cmd_zenCompactModeToggle', icon: 'chrome://browser/skin/zen-icons/sidebar.svg', + suggestedIndex: 0, }, { label: 'Open Theme Picker', diff --git a/src/zen/urlbar/ZenUBProvider.sys.mjs b/src/zen/urlbar/ZenUBProvider.sys.mjs index 414c98725..6ba14396e 100644 --- a/src/zen/urlbar/ZenUBProvider.sys.mjs +++ b/src/zen/urlbar/ZenUBProvider.sys.mjs @@ -10,7 +10,11 @@ ChromeUtils.defineESModuleGetters(providers, { }); export function registerZenUrlbarProviders() { - for (let provider of Object.values(providers)) { - UrlbarProvidersManager.registerProvider(new provider()); + for (let i = 0; i < Object.keys(providers).length; i++) { + const provider = Object.values(providers)[i]; + const name = Object.keys(providers)[i]; + if (!UrlbarProvidersManager.getProvider(name)) { + UrlbarProvidersManager.registerProvider(new provider()); + } } } diff --git a/src/zen/workspaces/ZenGradientGenerator.mjs b/src/zen/workspaces/ZenGradientGenerator.mjs index 1c287d894..54075fc06 100644 --- a/src/zen/workspaces/ZenGradientGenerator.mjs +++ b/src/zen/workspaces/ZenGradientGenerator.mjs @@ -1089,7 +1089,10 @@ return color.c; } let opacity = this.currentOpacity; - if (forToolbar && !this.#allowTransparencyOnSidebar) { + if ( + (forToolbar && !this.#allowTransparencyOnSidebar) || + (!forToolbar && !this.canBeTransparent) + ) { color = this.blendColors( color.c, this.getToolbarModifiedBaseRaw().slice(0, 3), @@ -1140,11 +1143,13 @@ const rotation = -45; // TODO: Detect rotation based on the accent color if (themedColors.length === 0) { - return forToolbar - ? this.getToolbarModifiedBase() - : this.isDarkMode - ? 'rgba(0, 0, 0, 0.4)' - : 'transparent'; + const getBrowserBg = () => { + if (this.canBeTransparent) { + return this.isDarkMode ? 'rgba(0, 0, 0, 0.4)' : 'transparent'; + } + return this.isDarkMode ? '#131313' : '#e9e9e9'; + }; + return forToolbar ? this.getToolbarModifiedBase() : getBrowserBg(); } else if (themedColors.length === 1) { return this.getSingleRGBColor(themedColors[0], forToolbar); } else { From 58245ed8d2ad62cdfbf60735dd72da01478af5f7 Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com> Date: Sat, 13 Sep 2025 14:41:21 +0200 Subject: [PATCH 5/5] New Crowdin updates (#10343) --- .../browser/preferences/zen-preferences.ftl | 4 +- .../browser/preferences/zen-preferences.ftl | 20 ++++----- locales/fr/browser/browser/zen-folders.ftl | 4 +- locales/fr/browser/browser/zen-general.ftl | 4 +- locales/fr/browser/browser/zen-welcome.ftl | 6 +-- locales/fr/browser/browser/zen-workspaces.ftl | 22 +++++----- .../browser/preferences/zen-preferences.ftl | 4 +- .../browser/preferences/zen-preferences.ftl | 4 +- locales/id/browser/browser/zen-folders.ftl | 2 +- .../browser/preferences/zen-preferences.ftl | 42 +++++++++---------- locales/zh-TW/browser/browser/zen-folders.ftl | 2 +- locales/zh-TW/browser/browser/zen-general.ftl | 14 +++---- .../zh-TW/browser/browser/zen-split-view.ftl | 2 +- .../browser/browser/zen-vertical-tabs.ftl | 2 +- locales/zh-TW/browser/browser/zen-welcome.ftl | 2 +- .../zh-TW/browser/browser/zen-workspaces.ftl | 26 ++++++------ 16 files changed, 80 insertions(+), 80 deletions(-) diff --git a/locales/cs/browser/browser/preferences/zen-preferences.ftl b/locales/cs/browser/browser/preferences/zen-preferences.ftl index 7e9f7dbdc..b465db4d2 100644 --- a/locales/cs/browser/browser/preferences/zen-preferences.ftl +++ b/locales/cs/browser/browser/preferences/zen-preferences.ftl @@ -223,7 +223,7 @@ zen-key-exit-full-screen = Ukončit režim celé obrazovky zen-ai-chatbot-sidebar-shortcut = Přepnout postranní panel AI chatbota zen-key-inspector-mac = Přepnout inspektor (Mac) zen-toggle-sidebar-shortcut = Přepnout postranní panel Firefoxu -zen-toggle-pin-tab-shortcut = Toggle Pin Tab +zen-toggle-pin-tab-shortcut = Přepnout připnutí záložky zen-reader-mode-toggle-shortcut-other = Přepnout čtecí režim zen-picture-in-picture-toggle-shortcut = Přepnout obraz v obraze zen-nav-reload-shortcut-2 = Znovu načíst stránku @@ -257,7 +257,7 @@ zen-close-tab-shortcut = Zavřít kartu zen-compact-mode-shortcut-show-sidebar = Přepnout plovoucí postranní panel zen-compact-mode-shortcut-show-toolbar = Přepnout plovoucí panel nástrojů zen-compact-mode-shortcut-toggle = Přepnout kompaktní režim -zen-glance-expand = Expand Glance +zen-glance-expand = Rozšířit Glance zen-workspace-shortcut-switch-1 = Přepnout do pracovního prostoru 1 zen-workspace-shortcut-switch-2 = Přepnout do pracovního prostoru 2 zen-workspace-shortcut-switch-3 = Přepnout do pracovního prostoru 3 diff --git a/locales/fr/browser/browser/preferences/zen-preferences.ftl b/locales/fr/browser/browser/preferences/zen-preferences.ftl index c05e76fab..35c39b612 100644 --- a/locales/fr/browser/browser/preferences/zen-preferences.ftl +++ b/locales/fr/browser/browser/preferences/zen-preferences.ftl @@ -10,14 +10,14 @@ zen-layout-collapsed-toolbar = Barre d’outils réduite sync-currently-syncing-workspaces = Espaces de travail sync-engine-workspaces = .label = Espaces de travail - .tooltiptext = Synchroniser vos Espaces de travail sur plusieurs appareils + .tooltiptext = Synchronisez vos espaces de travail sur plusieurs appareils .accesskey = W -zen-glance-title = Aperçu -zen-glance-header = Paramètres généraux d’Aperçu +zen-glance-title = Glance +zen-glance-header = Paramètres généraux de Glance zen-glance-description = Obtenez un aperçu rapide de vos liens, sans les ouvrir dans un nouvel onglet zen-glance-trigger-label = Méthode de déclenchement zen-glance-enabled = - .label = Activer Aperçu + .label = Activer Glance zen-glance-trigger-ctrl-click = .label = Ctrl + clic zen-glance-trigger-alt-click = @@ -54,7 +54,7 @@ zen-pinned-tab-manager-description = Gérer le comportement supplémentaire des zen-pinned-tab-manager-restore-pinned-tabs-to-pinned-url = .label = Au démarrage, restaurer les onglets épinglés à leur URL d’origine zen-pinned-tab-manager-container-specific-essentials-enabled = - .label = Activer les Essentiels spécifiques aux conteneurs + .label = Activer les Essentials spécifiques aux conteneurs zen-pinned-tab-manager-close-shortcut-behavior-label = Comportement du raccourci pour fermer l'onglet zen-pinned-tab-manager-reset-unload-switch-close-shortcut-option = .label = Réinitialiser l’URL, décharger et passer à l’onglet suivant @@ -69,10 +69,10 @@ zen-pinned-tab-manager-reset-close-shortcut-option = zen-pinned-tab-manager-close-close-shortcut-option = .label = Fermer l’onglet pane-zen-workspaces-header = Espaces de travail -zen-settings-workspaces-header = Paramètres généraux des Espaces de travail -zen-settings-workspaces-description = Avec les Espaces de travail, vous pouvez avoir plusieurs sessions de navigation à la fois ! +zen-settings-workspaces-header = Paramètres généraux des espaces de travail +zen-settings-workspaces-description = Avec les espaces de travail, vous pouvez avoir plusieurs sessions de navigation à la fois ! zen-settings-workspaces-enabled = - .label = Activer les Espaces de travail + .label = Activer les espaces de travail zen-settings-workspaces-hide-default-container-indicator = .label = Dans la barre d’onglets, masquer l’indicateur de conteneur par défaut zen-key-unsaved = Raccourci non sauvegardé ! Pour l’enregistrer, veuillez le resaisir et en appuyer sur Échap. @@ -128,7 +128,7 @@ pane-zen-marketplace-title = Mods Zen zen-themes-auto-update = .label = Mettre à jour automatiquement les mods installés lors du démarrage zen-settings-workspaces-force-container-tabs-to-workspace = - .label = À l'ouverture des onglets du conteneur, basculer vers l’Espace de travail où le conteneur est défini par défaut + .label = À l'ouverture des onglets du conteneur, basculer vers l’espace de travail où le conteneur est défini par défaut zen-theme-marketplace-link = Visiter le magasin zen-dark-theme-styles-header = Styles de thème sombre zen-dark-theme-styles-description = Personnalisez le thème sombre selon vos préférences @@ -223,7 +223,7 @@ zen-key-exit-full-screen = Quitter le mode plein écran zen-ai-chatbot-sidebar-shortcut = Activer/désactiver la barre latérale de discussion IA zen-key-inspector-mac = Activer/désactiver l’inspecteur (macOS) zen-toggle-sidebar-shortcut = Activer/désactiver la barre latérale de Firefox -zen-toggle-pin-tab-shortcut = Activer Epingler l'onglet +zen-toggle-pin-tab-shortcut = Activer/désactiver Épingler l'onglet zen-reader-mode-toggle-shortcut-other = Activer/désactiver le mode lecture zen-picture-in-picture-toggle-shortcut = Activer/désactiver le mode inscrutation zen-nav-reload-shortcut-2 = Recharger la page diff --git a/locales/fr/browser/browser/zen-folders.ftl b/locales/fr/browser/browser/zen-folders.ftl index be4069dfc..72df16ae6 100644 --- a/locales/fr/browser/browser/zen-folders.ftl +++ b/locales/fr/browser/browser/zen-folders.ftl @@ -9,9 +9,9 @@ zen-folders-new-subfolder = zen-folders-panel-delete-folder = .label = Supprimer le dossier zen-folders-panel-convert-folder-to-space = - .label = Convertir le dossier en Espace + .label = Convertir le dossier en espace zen-folders-panel-change-folder-space = - .label = Changer d'Espace... + .label = Changer d'espace... zen-folders-panel-change-icon-folder = .label = Changer d'icône zen-folders-unload-all-tooltip = diff --git a/locales/fr/browser/browser/zen-general.ftl b/locales/fr/browser/browser/zen-general.ftl index 3142b3e4a..6997be448 100644 --- a/locales/fr/browser/browser/zen-general.ftl +++ b/locales/fr/browser/browser/zen-general.ftl @@ -4,10 +4,10 @@ tab-context-zen-reset-pinned-tab = .label = Réinitialiser l’onglet épinglé .accesskey = R tab-context-zen-add-essential = - .label = Ajouter aux Essentiels ({ $num } / 12 emplacements remplis) + .label = Ajouter aux Essentials ({ $num } / 12 emplacements remplis) .accesskey = E tab-context-zen-remove-essential = - .label = Retirer des Essentiels + .label = Retirer des Essentials .accesskey = R tab-context-zen-replace-pinned-url-with-current = .label = Remplacer l’URL épinglée par l’actuelle diff --git a/locales/fr/browser/browser/zen-welcome.ftl b/locales/fr/browser/browser/zen-welcome.ftl index bbd5ad97b..037d9d80c 100644 --- a/locales/fr/browser/browser/zen-welcome.ftl +++ b/locales/fr/browser/browser/zen-welcome.ftl @@ -3,7 +3,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. zen-welcome-title-line1 = Bienvenue dans -zen-welcome-title-line2 = un internet plus calme +zen-welcome-title-line2 = un Internet plus calme zen-welcome-import-title = Un nouveau départ, les mêmes favoris zen-welcome-import-description-1 = Vos favoris, votre historique, et vos mots de passe sont comme des miettes sur internet. Ne les laissez pas trainer derrière vous ! zen-welcome-import-description-2 = Importez-les facilement depuis un autre navigateur et reprenez là où vous vous êtes arrêté. @@ -12,8 +12,8 @@ zen-welcome-set-default-browser = Définir { -brand-short-name } comme votre nav zen-welcome-dont-set-default-browser = NE PAS définir { -brand-short-name } comme votre navigateur par défaut zen-welcome-initial-essentials-title = Vos onglets principaux, toujours à portée de main zen-welcome-initial-essentials-description-1 = Gardez vos onglets les plus importants facilement accessibles et toujours à portée de main, peu importe combien vous en ouvrez. -zen-welcome-initial-essentials-description-2 = Les onglets Essentiels sont toujours visibles, peu importe l’espace de travail où vous êtes. -zen-welcome-workspace-colors-title = Vos Espaces de travail, vos couleurs +zen-welcome-initial-essentials-description-2 = Les onglets Essentials sont toujours visibles, peu importe l’espace de travail où vous êtes. +zen-welcome-workspace-colors-title = Vos espaces de travail, vos couleurs zen-welcome-workspace-colors-description = Personnalisez votre navigateur en donnant à chaque espace de travail sa propre identité de couleur. zen-welcome-start-browsing-title = Tout est prêt ?
diff --git a/locales/fr/browser/browser/zen-workspaces.ftl b/locales/fr/browser/browser/zen-workspaces.ftl index fcba38810..98ee2bf93 100644 --- a/locales/fr/browser/browser/zen-workspaces.ftl +++ b/locales/fr/browser/browser/zen-workspaces.ftl @@ -1,10 +1,10 @@ zen-panel-ui-workspaces-text = Espaces zen-panel-ui-workspaces-create = - .label = Créer un Espace + .label = Créer un espace zen-panel-ui-folder-create = .label = Créer un dossier zen-workspaces-panel-context-delete = - .label = Supprimer l’Espace + .label = Supprimer l’espace .accesskey = D zen-workspaces-panel-change-name = .label = Modifier le nom @@ -12,18 +12,18 @@ zen-workspaces-panel-change-icon = .label = Changer d'icône zen-workspaces-panel-context-default-profile = .label = Définir le profil -zen-workspaces-how-to-reorder-title = Comment réordonner les Espaces +zen-workspaces-how-to-reorder-title = Comment réordonner les espaces zen-workspaces-how-to-reorder-desc = Faites glisser les icônes d'espace en bas de la barre latérale pour les réorganiser zen-workspaces-change-theme = .label = Modifier le thème zen-workspaces-panel-context-open = - .label = Ouvrir un Espace de travail + .label = Ouvrir un espace de travail .accesskey = O zen-workspaces-panel-context-edit = - .label = Éditer l’Espace + .label = Éditer l’espace .accesskey = E context-zen-change-workspace-tab = - .label = Déplacer vers l’Espace de travail + .label = Déplacer vers l’espace de travail .accesskey = C zen-bookmark-edit-panel-workspace-selector = .value = Espaces de travail @@ -40,12 +40,12 @@ zen-panel-ui-gradient-generator-algo-floating = .label = Flottant zen-panel-ui-gradient-click-to-add = Cliquez pour ajouter une couleur zen-workspace-creation-name = - .placeholder = Nom de l'Espace + .placeholder = Nom de l'espace zen-workspaces-panel-context-reorder = - .label = Réorganiser les Espaces + .label = Réorganiser les espaces zen-workspace-creation-profile = Profil .tooltiptext = Les profils sont utilisés pour séparer les cookies et les données des sites entre les Espaces. -zen-workspace-creation-header = Créer un Espace -zen-workspace-creation-label = Les Espaces sont utilisés pour organiser vos onglets et sessions. -zen-workspaces-delete-workspace-title = Supprimer l’Espace ? +zen-workspace-creation-header = Créer un espace +zen-workspace-creation-label = Les espaces sont utilisés pour organiser vos onglets et sessions. +zen-workspaces-delete-workspace-title = Supprimer l’espace ? zen-workspaces-delete-workspace-body = Êtes-vous sûr de vouloir supprimer { $name } ? Cette action ne peut pas être annulée. diff --git a/locales/ga-IE/browser/browser/preferences/zen-preferences.ftl b/locales/ga-IE/browser/browser/preferences/zen-preferences.ftl index 8dc6c8bea..37c8679e3 100644 --- a/locales/ga-IE/browser/browser/preferences/zen-preferences.ftl +++ b/locales/ga-IE/browser/browser/preferences/zen-preferences.ftl @@ -223,7 +223,7 @@ zen-key-exit-full-screen = Scoir Lánscáileáin zen-ai-chatbot-sidebar-shortcut = Barra Taobh Comhrá AI a Athrú zen-key-inspector-mac = Scoránaigh Cigire (Mac) zen-toggle-sidebar-shortcut = Scoránaigh an Taobhbharra Firefox -zen-toggle-pin-tab-shortcut = Toggle Pin Tab +zen-toggle-pin-tab-shortcut = Cluaisín bioráin a scoránaigh zen-reader-mode-toggle-shortcut-other = Scoránaigh Mód Léitheoir zen-picture-in-picture-toggle-shortcut = Scoránaigh Pictiúr-i-Pictiúr zen-nav-reload-shortcut-2 = Athlódáil an Leathanach @@ -257,7 +257,7 @@ zen-close-tab-shortcut = Dún an Cluaisín zen-compact-mode-shortcut-show-sidebar = Scoránaigh Barra Taoibh Snámh zen-compact-mode-shortcut-show-toolbar = Scoránaigh Barra Uirlisí Snámh zen-compact-mode-shortcut-toggle = Scoránaigh Mód Dlúth -zen-glance-expand = Expand Glance +zen-glance-expand = Leathnaigh an Súil zen-workspace-shortcut-switch-1 = Athraigh go Spás Oibre 1 zen-workspace-shortcut-switch-2 = Athraigh go Spás Oibre 2 zen-workspace-shortcut-switch-3 = Athraigh go Spás Oibre 3 diff --git a/locales/id/browser/browser/preferences/zen-preferences.ftl b/locales/id/browser/browser/preferences/zen-preferences.ftl index c3fd262e4..9d18d3f27 100644 --- a/locales/id/browser/browser/preferences/zen-preferences.ftl +++ b/locales/id/browser/browser/preferences/zen-preferences.ftl @@ -223,7 +223,7 @@ zen-key-exit-full-screen = Keluar Dari Layar Penuh zen-ai-chatbot-sidebar-shortcut = Beralih ke AI Chatbot Sidebar zen-key-inspector-mac = Beralih ke Inspector (Mac) zen-toggle-sidebar-shortcut = Beralih ke Firefox Sidebar -zen-toggle-pin-tab-shortcut = Toggle Pin Tab +zen-toggle-pin-tab-shortcut = Alihkan Sematan Tab zen-reader-mode-toggle-shortcut-other = Aktif/nonaktifkan Mode Membaca zen-picture-in-picture-toggle-shortcut = Aktif/nonaktifkan Picture-in-Picture zen-nav-reload-shortcut-2 = Muat Ulang Halaman @@ -257,7 +257,7 @@ zen-close-tab-shortcut = Tutup Tab zen-compact-mode-shortcut-show-sidebar = Beralih ke Bilah sisi mengambang zen-compact-mode-shortcut-show-toolbar = Nyala/Matikan Toolbar Mengambang zen-compact-mode-shortcut-toggle = Aktifkan/Sembunyikan Mode Ringkas -zen-glance-expand = Expand Glance +zen-glance-expand = Perluas Glance zen-workspace-shortcut-switch-1 = Beralih ke Ruang Kerja 1 zen-workspace-shortcut-switch-2 = Beralih ke Ruang Kerja 2 zen-workspace-shortcut-switch-3 = Beralih ke Ruang Kerja 3 diff --git a/locales/id/browser/browser/zen-folders.ftl b/locales/id/browser/browser/zen-folders.ftl index 313225a4f..169439392 100644 --- a/locales/id/browser/browser/zen-folders.ftl +++ b/locales/id/browser/browser/zen-folders.ftl @@ -15,7 +15,7 @@ zen-folders-panel-change-folder-space = zen-folders-panel-change-icon-folder = .label = Ubah Ikon zen-folders-unload-all-tooltip = - .tooltiptext = Unload active in this folder + .tooltiptext = Lepaskan tab yang aktif di folder ini zen-folders-unload-folder = .label = Lepaskan Semua Tab zen-folders-search-no-results = Tidak ada tab yang cocok 🤔 diff --git a/locales/zh-TW/browser/browser/preferences/zen-preferences.ftl b/locales/zh-TW/browser/browser/preferences/zen-preferences.ftl index b984d008c..fef25eb60 100644 --- a/locales/zh-TW/browser/browser/preferences/zen-preferences.ftl +++ b/locales/zh-TW/browser/browser/preferences/zen-preferences.ftl @@ -15,7 +15,7 @@ sync-engine-workspaces = zen-glance-title = Glance zen-glance-header = Glance 一般設定 zen-glance-description = 無需打開新分頁,即可快速預覽 -zen-glance-trigger-label = 觸發方法 +zen-glance-trigger-label = 觸發方式 zen-glance-enabled = .label = 啟用 Glance zen-glance-trigger-ctrl-click = @@ -27,7 +27,7 @@ zen-glance-trigger-shift-click = zen-glance-trigger-meta-click = .label = Meta (Command) + 左鍵 zen-glance-trigger-mantain-click = - .label = Mantain Click + .label = 長按(即將上線!) zen-look-and-feel-compact-view-header = 在緊湊模式下顯示 zen-look-and-feel-compact-view-description = 只顯示你需要用的工具欄! zen-look-and-feel-compact-view-enabled = @@ -45,7 +45,7 @@ zen-tabs-unloader-enabled = zen-look-and-feel-compact-toolbar-themed = .label = 將主題顏色套用至折疊工具欄 zen-look-and-feel-compact-sidebar-themed = - .label = 將主題顏色套用至摺疊側邊欄 + .label = 將主題顏色套用至折疊側邊欄 zen-workspace-continue-where-left-off = .label = Continue where you left off pane-zen-pinned-tab-manager-title = 釘選分頁 @@ -70,12 +70,12 @@ zen-pinned-tab-manager-close-close-shortcut-option = .label = 關閉分頁 pane-zen-workspaces-header = 工作區 zen-settings-workspaces-header = 工作區的一般設定 -zen-settings-workspaces-description = 有了工作區,你就可以同時瀏覽多個頁面! +zen-settings-workspaces-description = 透過工作區,您能同時擁有多個獨立的瀏覽環境! zen-settings-workspaces-enabled = - .label = 啟用工作區 (實驗性的) + .label = 啟用工作區 zen-settings-workspaces-hide-default-container-indicator = .label = 隱藏分頁欄中的容器指標 -zen-key-unsaved = 快捷鍵未儲存!請重新輸入並按下 "Escape" 鍵來儲存快捷鍵 +zen-key-unsaved = 快捷鍵未儲存!請重新輸入並按下 "Escape" 鍵來儲存快捷鍵。 zen-key-conflict = 與其它快捷鍵發生衝突 pane-zen-theme-title = 主題設定 zen-vertical-tabs-title = 側邊欄與分頁排版 @@ -92,7 +92,7 @@ zen-vertical-tabs-dont-expand-tabs-by-default = 預設不展開分頁 zen-vertical-tabs-expand-tabs-on-hover = 懸停時擴展分頁 (無法在緊湊模式下使用) zen-vertical-tabs-expand-tabs-header = 如何擴展分頁 zen-vertical-tabs-expand-tabs-description = 選擇要如何擴展側邊欄中的分頁 -zen-theme-marketplace-header = Zen模式 +zen-theme-marketplace-header = Zen 模組 zen-theme-disable-all-enabled = .title = 啟用所有主題 zen-theme-disable-all-disabled = @@ -103,15 +103,15 @@ zen-theme-marketplace-remove-button = zen-theme-marketplace-check-for-updates-button = .label = 檢查更新 zen-theme-marketplace-import-button = - .label = Import mods + .label = 匯入模組 zen-theme-marketplace-export-button = - .label = Export Mods -zen-theme-marketplace-import-success = Mods imported successfully -zen-theme-marketplace-import-failure = There was an error importing the mods -zen-theme-marketplace-export-success = Mods exported successfully -zen-theme-marketplace-export-failure = There was an error exporting the mods + .label = 匯出模組 +zen-theme-marketplace-import-success = 模組匯入成功 +zen-theme-marketplace-import-failure = 匯入模組時發生錯誤 +zen-theme-marketplace-export-success = 模組匯出成功 +zen-theme-marketplace-export-failure = 匯出模組時發生錯誤 zen-theme-marketplace-updates-success = 主題更新成功 -zen-theme-marketplace-updates-failure = Couldn't find any updates! +zen-theme-marketplace-updates-failure = 找不到任何更新! zen-theme-marketplace-toggle-enabled-button = .title = 關閉佈景主題 zen-theme-marketplace-toggle-disabled-button = @@ -126,7 +126,7 @@ zen-theme-marketplace-input-default-placeholder = .placeholder = 請輸入 pane-zen-marketplace-title = Zen 模式 zen-themes-auto-update = - .label = Automatically update installed mods on startup + .label = 啟動時自動更新已安裝模組 zen-settings-workspaces-force-container-tabs-to-workspace = .label = 開啟容器分頁時,切換到容器設定為預設值的工作區 zen-theme-marketplace-link = 造訪商店 @@ -175,17 +175,17 @@ zenCKSOption-group-devTools = 開發人員工具 zen-key-quick-restart = 快速重啟 zen-window-new-shortcut = 開新視窗 zen-tab-new-shortcut = 開新分頁 -zen-key-redo = 取消「復原」 +zen-key-redo = 重做 zen-restore-last-closed-tab-shortcut = 復原上次關閉的分頁 zen-location-open-shortcut = 選取網址列 -zen-location-open-shortcut-alt = 選取網址列 (備用) +zen-location-open-shortcut-alt = 選取網址列(備用) zen-key-undo-close-window = 還原已關閉視窗 zen-text-action-undo-shortcut = 復原 zen-text-action-redo-shortcut = 取消「復原」 zen-text-action-cut-shortcut = 剪下 zen-text-action-copy-shortcut = 複製 zen-text-action-copy-url-shortcut = 複製目前網址 -zen-text-action-copy-url-markdown-shortcut = 把目前網址複製成Markdown +zen-text-action-copy-url-markdown-shortcut = 將目前網址複製為 Markdown zen-text-action-paste-shortcut = 貼上 zen-text-action-select-all-shortcut = 全選 zen-text-action-delete-shortcut = 刪除 @@ -240,9 +240,9 @@ zen-key-stop = 停止載入 zen-full-zoom-reduce-shortcut = 縮小 zen-full-zoom-enlarge-shortcut = 放大 zen-full-zoom-reset-shortcut = 縮放重設 -zen-full-zoom-reset-shortcut-alt = Reset Zoom (Alt) -zen-full-zoom-enlarge-shortcut-alt = Zoom In (Alt) -zen-full-zoom-enlarge-shortcut-alt2 = Zoom In (Alt 2) +zen-full-zoom-reset-shortcut-alt = 重置縮放(Alt) +zen-full-zoom-enlarge-shortcut-alt = 放大(Alt) +zen-full-zoom-enlarge-shortcut-alt2 = 放大(Alt 2) zen-bidi-switch-direction-shortcut = 切換文字方向 zen-private-browsing-shortcut = 隱私瀏覽 zen-screenshot-shortcut = 截圖 diff --git a/locales/zh-TW/browser/browser/zen-folders.ftl b/locales/zh-TW/browser/browser/zen-folders.ftl index 409703d2a..f29a2b1a5 100644 --- a/locales/zh-TW/browser/browser/zen-folders.ftl +++ b/locales/zh-TW/browser/browser/zen-folders.ftl @@ -18,4 +18,4 @@ zen-folders-unload-all-tooltip = .tooltiptext = Unload active in this folder zen-folders-unload-folder = .label = Unload All Tabs -zen-folders-search-no-results = No tabs matching that search 🤔 +zen-folders-search-no-results = 沒有找到搜尋的分頁 🤔 diff --git a/locales/zh-TW/browser/browser/zen-general.ftl b/locales/zh-TW/browser/browser/zen-general.ftl index 5b99b2d60..e1efa0d7b 100644 --- a/locales/zh-TW/browser/browser/zen-general.ftl +++ b/locales/zh-TW/browser/browser/zen-general.ftl @@ -12,7 +12,7 @@ tab-context-zen-remove-essential = tab-context-zen-replace-pinned-url-with-current = .label = 將釘選的網址換成目前的網址 .accesskey = C -zen-themes-corrupted = 你的 { -brand-short-name } 模組文件已損壞,它們已重置為預設佈景主題 +zen-themes-corrupted = 你的 { -brand-short-name } 模組文件已損壞,它們已重置為預設佈景主題。 zen-shortcuts-corrupted = 你的 { -brand-short-name } 快捷文件已損壞。它們已被重設為預設值。 # note: Do not translate the "
" tags in the following string zen-new-urlbar-notification = 新的 URL 欄已啟用,你不再需要新增新分頁。

馬上打開新分頁來看看新的 URL 欄! @@ -24,25 +24,25 @@ zen-panel-ui-gradient-generator-custom-color = 自訂顏色 zen-panel-ui-gradient-generator-saved-message = 漸層儲存成功! zen-copy-current-url-confirmation = 網址已複製到剪貼簿。 zen-general-cancel-label = - .label = Cancel + .label = 取消 zen-general-confirm = - .label = Confirm + .label = 確認 zen-pinned-tab-replaced = 釘選分頁網址已替換為當前當前網址。 zen-tabs-renamed = 分頁重新命名成功! zen-background-tab-opened-toast = New background tab opened! zen-workspace-renamed-toast = Workspace has been successfully renamed! zen-library-sidebar-workspaces = - .label = Spaces + .label = 工作區 zen-library-sidebar-mods = - .label = Mods + .label = 模組 # note: Do not translate the "
" tags in the following string zen-learn-more-text = 瞭解更多 zen-close-label = 關閉 zen-singletoolbar-urlbar-placeholder-with-name = - .placeholder = Search... + .placeholder = 搜尋... zen-icons-picker-emoji = - .label = Emojis + .label = 表情符號 zen-icons-picker-svg = .label = Icons diff --git a/locales/zh-TW/browser/browser/zen-split-view.ftl b/locales/zh-TW/browser/browser/zen-split-view.ftl index 978035afe..3c6a616de 100644 --- a/locales/zh-TW/browser/browser/zen-split-view.ftl +++ b/locales/zh-TW/browser/browser/zen-split-view.ftl @@ -11,6 +11,6 @@ zen-split-link = zen-split-view-modifier-header = 分割畫面 zen-split-view-modifier-activate-reallocation = .label = 啟用重新分配 -zen-split-view-modifier-enabled-toast = 分割畫面重新排列已開啟 +zen-split-view-modifier-enabled-toast = 分割畫面重新排列已開啟。 zen-split-view-modifier-enabled-toast-description = 拖曳畫面以重新排列。按 Esc 鍵退出 zen-split-view-modifier-disabled-toast = 分割畫面重新排列已關閉 diff --git a/locales/zh-TW/browser/browser/zen-vertical-tabs.ftl b/locales/zh-TW/browser/browser/zen-vertical-tabs.ftl index 308b709ec..d8a81f797 100644 --- a/locales/zh-TW/browser/browser/zen-vertical-tabs.ftl +++ b/locales/zh-TW/browser/browser/zen-vertical-tabs.ftl @@ -33,4 +33,4 @@ tabbrowser-reset-pin-button = [one] Reset and pin tab *[other] Reset and pin { $tabCount } tabs } -tab-reset-pin-label = Back to pinned url +tab-reset-pin-label = 返回釘選網址 diff --git a/locales/zh-TW/browser/browser/zen-welcome.ftl b/locales/zh-TW/browser/browser/zen-welcome.ftl index 0767c9bb0..9b2818248 100644 --- a/locales/zh-TW/browser/browser/zen-welcome.ftl +++ b/locales/zh-TW/browser/browser/zen-welcome.ftl @@ -6,7 +6,7 @@ zen-welcome-title-line1 = Welcome to zen-welcome-title-line2 = a calmer internet zen-welcome-import-title = A Fresh Start, Same Bookmarks zen-welcome-import-description-1 = Your bookmarks, history, and passwords are like a trail of breadcrumbs through the internet—don’t leave them behind! -zen-welcome-import-description-2 = Easily bring them over from another browser and pick up right where you left off.. +zen-welcome-import-description-2 = 輕鬆匯入其他瀏覽器的資料,無縫接續瀏覽體驗。 zen-welcome-import-button = Import now zen-welcome-set-default-browser = Set { -brand-short-name } as your default browser zen-welcome-dont-set-default-browser = DON’T set { -brand-short-name } as your default browser diff --git a/locales/zh-TW/browser/browser/zen-workspaces.ftl b/locales/zh-TW/browser/browser/zen-workspaces.ftl index d49cc2f54..c2b6a2742 100644 --- a/locales/zh-TW/browser/browser/zen-workspaces.ftl +++ b/locales/zh-TW/browser/browser/zen-workspaces.ftl @@ -1,21 +1,21 @@ -zen-panel-ui-workspaces-text = 其他工作區 +zen-panel-ui-workspaces-text = 工作區 zen-panel-ui-workspaces-create = - .label = Create Space + .label = 創建工作區 zen-panel-ui-folder-create = .label = Create Folder zen-workspaces-panel-context-delete = .label = 刪除工作區 .accesskey = D zen-workspaces-panel-change-name = - .label = Change Name + .label = 重新命名 zen-workspaces-panel-change-icon = - .label = Change Icon + .label = 變更圖示 zen-workspaces-panel-context-default-profile = .label = Set Profile -zen-workspaces-how-to-reorder-title = How to reorder spaces -zen-workspaces-how-to-reorder-desc = Drag the space icons at the bottom of the sidebar to reorder them +zen-workspaces-how-to-reorder-title = 如何排序工作區 +zen-workspaces-how-to-reorder-desc = 拖曳側邊欄底部工作區圖示以重新排序 zen-workspaces-change-theme = - .label = Edit Theme + .label = 編輯主題 zen-workspaces-panel-context-open = .label = 打開工作區 .accesskey = O @@ -23,7 +23,7 @@ zen-workspaces-panel-context-edit = .label = 編輯工作區 .accesskey = E context-zen-change-workspace-tab = - .label = 將分頁(含多個)移至工作區 + .label = 將分頁(含多個)移至工作區 .accesskey = C zen-bookmark-edit-panel-workspace-selector = .value = 選擇工作區 @@ -40,12 +40,12 @@ zen-panel-ui-gradient-generator-algo-floating = .label = 懸浮 zen-panel-ui-gradient-click-to-add = 點擊新增顏色 zen-workspace-creation-name = - .placeholder = Space Name + .placeholder = 工作區名稱 zen-workspaces-panel-context-reorder = - .label = Reorder Spaces + .label = 排序工作區 zen-workspace-creation-profile = Profile .tooltiptext = Profiles are used to separate cookies and site data between spaces. -zen-workspace-creation-header = Create a Space +zen-workspace-creation-header = 創建工作區 zen-workspace-creation-label = Spaces are used to organize your tabs and sessions. -zen-workspaces-delete-workspace-title = Delete Workspace? -zen-workspaces-delete-workspace-body = Are you sure you want to delete { $name }? This action cannot be undone. +zen-workspaces-delete-workspace-title = 刪除工作區? +zen-workspaces-delete-workspace-body = 你確定要刪除 { $name } 嗎?該動作無法物復原。