-
Date: Tue, 25 Nov 2025 11:30:10 +1100
Subject: [PATCH 09/12] refactor: update vertical tabs CSS by removing
deprecated styles and enhancing separator animations for grouping
---
src/zen/tabs/zen-tabs/vertical-tabs.css | 43 ++++++++++++-------------
1 file changed, 20 insertions(+), 23 deletions(-)
diff --git a/src/zen/tabs/zen-tabs/vertical-tabs.css b/src/zen/tabs/zen-tabs/vertical-tabs.css
index 06bbaead18..becd31a357 100644
--- a/src/zen/tabs/zen-tabs/vertical-tabs.css
+++ b/src/zen/tabs/zen-tabs/vertical-tabs.css
@@ -157,25 +157,6 @@
border-inline-start: none;
}
- &::after {
- content: '';
- position: absolute;
- inset: auto 4px;
- left: 4px;
- right: 4px;
- top: 50%;
- height: 12px;
- transform: translateY(-50%);
- background-color: currentColor;
- mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2048%2012'%20fill='none'%3E%3Cpath%20d='M0%206%20Q6%200%2012%206%20T24%206%20T36%206%20T48%206'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20fill='none'/%3E%3C/svg%3E");
- mask-size: 48px 12px;
- mask-repeat: repeat;
- mask-position: 0 50%;
- opacity: 0;
- pointer-events: none;
- transition: opacity 0.2s ease-in-out;
- will-change: mask-position;
- }
}
#tabbrowser-tabs[movingtab] & {
@@ -237,11 +218,27 @@
&[data-grouping='true'] toolbarseparator {
background: transparent;
- }
- &[data-grouping='true'] toolbarseparator::after {
- opacity: 0.9;
- animation: zenWorkspaceSquiggle 1.2s linear infinite;
+ &::after {
+ content: '';
+ position: absolute;
+ inset: auto 4px;
+ left: 4px;
+ right: 4px;
+ top: 50%;
+ height: 12px;
+ transform: translateY(-50%);
+ background-color: currentColor;
+ mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2048%2012'%20fill='none'%3E%3Cpath%20d='M0%206%20Q6%200%2012%206%20T24%206%20T36%206%20T48%206'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20fill='none'/%3E%3C/svg%3E");
+ mask-size: 48px 12px;
+ mask-repeat: repeat;
+ mask-position: 0 50%;
+ opacity: 0.9;
+ pointer-events: none;
+ transition: opacity 0.2s ease-in-out;
+ will-change: mask-position;
+ animation: zenWorkspaceSquiggle 1.2s linear infinite;
+ }
}
}
From 8956cfb59ce3fd1e47285689da7453f0e0a99633 Mon Sep 17 00:00:00 2001
From: Matteo Mekhail <67237370+matteoiscrying@users.noreply.github.com>
Date: Tue, 25 Nov 2025 11:30:59 +1100
Subject: [PATCH 10/12] refactor: remove unused Services import from
ZenTabsTidy.sys.mjs
---
src/zen/ml/ZenTabsTidy.sys.mjs | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/zen/ml/ZenTabsTidy.sys.mjs b/src/zen/ml/ZenTabsTidy.sys.mjs
index de29c23d6b..f5d6fd36bc 100644
--- a/src/zen/ml/ZenTabsTidy.sys.mjs
+++ b/src/zen/ml/ZenTabsTidy.sys.mjs
@@ -2,7 +2,6 @@
// 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/.
-const Services = globalThis.Services;
const { setTimeout } = ChromeUtils.importESModule('resource://gre/modules/Timer.sys.mjs');
export async function groupTabsBySimilarity({
From c33c23cc4847e3b9479390cf1b0b02b9657636cc Mon Sep 17 00:00:00 2001
From: Matteo Mekhail <67237370+matteoiscrying@users.noreply.github.com>
Date: Tue, 25 Nov 2025 11:34:40 +1100
Subject: [PATCH 11/12] refactor: optimize EngineProcess import by using lazy
loading in ZenTabsTidy.sys.mjs
---
src/zen/ml/ZenTabsTidy.sys.mjs | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/zen/ml/ZenTabsTidy.sys.mjs b/src/zen/ml/ZenTabsTidy.sys.mjs
index f5d6fd36bc..8a83039d23 100644
--- a/src/zen/ml/ZenTabsTidy.sys.mjs
+++ b/src/zen/ml/ZenTabsTidy.sys.mjs
@@ -3,6 +3,11 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
const { setTimeout } = ChromeUtils.importESModule('resource://gre/modules/Timer.sys.mjs');
+const lazy = {};
+
+ChromeUtils.defineESModuleGetters(lazy, {
+ EngineProcess: 'chrome://global/content/ml/EngineProcess.sys.mjs',
+});
export async function groupTabsBySimilarity({
window: browserWindow,
@@ -317,9 +322,7 @@ async function generateTabEmbeddings(tabData) {
}
try {
- const { createEngine } = ChromeUtils.importESModule(
- 'chrome://global/content/ml/EngineProcess.sys.mjs'
- );
+ const { createEngine } = lazy.EngineProcess;
const engine = await createEngine({
taskName: 'feature-extraction',
@@ -475,9 +478,7 @@ async function generateAiClusterLabel(clusterData) {
}
try {
- const { createEngine } = ChromeUtils.importESModule(
- 'chrome://global/content/ml/EngineProcess.sys.mjs'
- );
+ const { createEngine } = lazy.EngineProcess;
const tabDescriptions = clusterData
.map((data, idx) => {
From 4cf856ebbf2cb51c8d06ead23470ac2fc5f92a2d Mon Sep 17 00:00:00 2001
From: Matteo Mekhail <67237370+matteoiscrying@users.noreply.github.com>
Date: Tue, 25 Nov 2025 12:01:27 +1100
Subject: [PATCH 12/12] refactor: update ZenTabsTidy import path and clean up
zen-assets.jar.inc.mn
---
src/browser/base/content/zen-assets.jar.inc.mn | 1 -
src/zen/ml/moz.build | 8 ++++++++
src/zen/moz.build | 1 +
src/zen/workspaces/ZenWorkspaces.mjs | 2 +-
4 files changed, 10 insertions(+), 2 deletions(-)
create mode 100644 src/zen/ml/moz.build
diff --git a/src/browser/base/content/zen-assets.jar.inc.mn b/src/browser/base/content/zen-assets.jar.inc.mn
index 1e038ef388..d8ee81f6ed 100644
--- a/src/browser/base/content/zen-assets.jar.inc.mn
+++ b/src/browser/base/content/zen-assets.jar.inc.mn
@@ -44,7 +44,6 @@
content/browser/zen-components/ZenWorkspaceCreation.mjs (../../zen/workspaces/ZenWorkspaceCreation.mjs)
content/browser/zen-components/ZenWorkspacesStorage.mjs (../../zen/workspaces/ZenWorkspacesStorage.mjs)
content/browser/zen-components/ZenWorkspacesSync.mjs (../../zen/workspaces/ZenWorkspacesSync.mjs)
- content/browser/zen-components/ZenTabsTidy.sys.mjs (../../zen/ml/ZenTabsTidy.sys.mjs)
content/browser/zen-components/ZenGradientGenerator.mjs (../../zen/workspaces/ZenGradientGenerator.mjs)
* content/browser/zen-styles/zen-workspaces.css (../../zen/workspaces/zen-workspaces.css)
content/browser/zen-styles/zen-gradient-generator.css (../../zen/workspaces/zen-gradient-generator.css)
diff --git a/src/zen/ml/moz.build b/src/zen/ml/moz.build
new file mode 100644
index 0000000000..0c0e1c65fa
--- /dev/null
+++ b/src/zen/ml/moz.build
@@ -0,0 +1,8 @@
+# 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 += [
+ "ZenTabsTidy.sys.mjs",
+]
+
diff --git a/src/zen/moz.build b/src/zen/moz.build
index 21915a69ab..660e34bdba 100644
--- a/src/zen/moz.build
+++ b/src/zen/moz.build
@@ -9,6 +9,7 @@ EXTRA_PP_COMPONENTS += [
DIRS += [
"common",
"glance",
+ "ml",
"mods",
"tests",
"urlbar",
diff --git a/src/zen/workspaces/ZenWorkspaces.mjs b/src/zen/workspaces/ZenWorkspaces.mjs
index d4947972df..eae658e2cc 100644
--- a/src/zen/workspaces/ZenWorkspaces.mjs
+++ b/src/zen/workspaces/ZenWorkspaces.mjs
@@ -56,7 +56,7 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
async #getTabsTidyModule() {
if (!this.#tabsTidyModulePromise) {
this.#tabsTidyModulePromise = ChromeUtils.importESModule(
- 'chrome://browser/content/zen-components/ZenTabsTidy.sys.mjs'
+ 'resource:///modules/ZenTabsTidy.sys.mjs'
);
}
return this.#tabsTidyModulePromise;