From 6287f1a11809a3a43abf1d2b6be7e4e04486756d Mon Sep 17 00:00:00 2001
From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com>
Date: Fri, 13 Mar 2026 17:35:00 +0100
Subject: [PATCH] chore: Refactor spaces organization, p=#12764
---
src/-stylelintignore.patch | 4 +-
src/browser/base/content/zen-assets.inc.xhtml | 2 +-
.../base/content/zen-assets.jar.inc.mn | 2 +-
.../base/content/zen-preloaded.inc.xhtml | 6 +-
.../content/bookmarkProperties-xhtml.patch | 2 +-
.../content/widgets/arrowscrollbox-js.patch | 4 +-
src/zen/common/ZenPreloadedScripts.js | 2 +-
src/zen/moz.build | 1 +
.../ZenGradientGenerator.mjs | 0
.../ZenWorkspace.mjs => spaces/ZenSpace.mjs} | 0
.../ZenSpaceBookmarksStorage.js} | 0
.../ZenSpaceCreation.mjs} | 0
.../ZenSpaceIcons.mjs} | 0
.../ZenSpaceManager.mjs} | 188 +---------------
src/zen/spaces/ZenSpacesSwipe.mjs | 210 ++++++++++++++++++
.../create-workspace-form.css | 0
src/zen/spaces/jar.inc.mn | 7 +
src/zen/spaces/moz.build | 12 +
.../overflow-icons.inc.css | 0
.../zen-gradient-generator.css | 0
.../{workspaces => spaces}/zen-workspaces.css | 2 -
src/zen/workspaces/jar.inc.mn | 12 -
22 files changed, 249 insertions(+), 205 deletions(-)
rename src/zen/{workspaces => spaces}/ZenGradientGenerator.mjs (100%)
rename src/zen/{workspaces/ZenWorkspace.mjs => spaces/ZenSpace.mjs} (100%)
rename src/zen/{workspaces/ZenWorkspaceBookmarksStorage.js => spaces/ZenSpaceBookmarksStorage.js} (100%)
rename src/zen/{workspaces/ZenWorkspaceCreation.mjs => spaces/ZenSpaceCreation.mjs} (100%)
rename src/zen/{workspaces/ZenWorkspaceIcons.mjs => spaces/ZenSpaceIcons.mjs} (100%)
rename src/zen/{workspaces/ZenWorkspaces.mjs => spaces/ZenSpaceManager.mjs} (95%)
create mode 100644 src/zen/spaces/ZenSpacesSwipe.mjs
rename src/zen/{workspaces => spaces}/create-workspace-form.css (100%)
create mode 100644 src/zen/spaces/jar.inc.mn
create mode 100644 src/zen/spaces/moz.build
rename src/zen/{workspaces => spaces}/overflow-icons.inc.css (100%)
rename src/zen/{workspaces => spaces}/zen-gradient-generator.css (100%)
rename src/zen/{workspaces => spaces}/zen-workspaces.css (99%)
delete mode 100644 src/zen/workspaces/jar.inc.mn
diff --git a/src/-stylelintignore.patch b/src/-stylelintignore.patch
index 3e44aac53..58ed0315e 100644
--- a/src/-stylelintignore.patch
+++ b/src/-stylelintignore.patch
@@ -1,5 +1,5 @@
diff --git a/.stylelintignore b/.stylelintignore
-index 185490999507b8a5032977237af50f5e61c71df1..e887fafa90b881e852a287ed8898638c995861ab 100644
+index 185490999507b8a5032977237af50f5e61c71df1..d535178552c6a744022be1d0bfff5fbb8bf9a5ef 100644
--- a/.stylelintignore
+++ b/.stylelintignore
@@ -106,3 +106,19 @@ build/pgo/blueprint/**/*.css
@@ -18,7 +18,7 @@ index 185490999507b8a5032977237af50f5e61c71df1..e887fafa90b881e852a287ed8898638c
+zen/compact-mode/zen-compact-mode.css
+
+zen/split-view/zen-decks.css
-+zen/workspaces/zen-workspaces.css
++zen/spaces/zen-workspaces.css
+zen/common/styles/zen-toolbar.css
+
+*.inc
diff --git a/src/browser/base/content/zen-assets.inc.xhtml b/src/browser/base/content/zen-assets.inc.xhtml
index 036308d06..6debe819c 100644
--- a/src/browser/base/content/zen-assets.inc.xhtml
+++ b/src/browser/base/content/zen-assets.inc.xhtml
@@ -42,7 +42,7 @@
# Scripts used all over the browser
-
+
diff --git a/src/browser/base/content/zen-assets.jar.inc.mn b/src/browser/base/content/zen-assets.jar.inc.mn
index 2a44065d4..9d470ace8 100644
--- a/src/browser/base/content/zen-assets.jar.inc.mn
+++ b/src/browser/base/content/zen-assets.jar.inc.mn
@@ -7,7 +7,7 @@
#include ../../../zen/drag-and-drop/jar.inc.mn
#include ../../../zen/split-view/jar.inc.mn
#include ../../../zen/mods/jar.inc.mn
-#include ../../../zen/workspaces/jar.inc.mn
+#include ../../../zen/spaces/jar.inc.mn
#include ../../../zen/tabs/jar.inc.mn
#include ../../../zen/kbs/jar.inc.mn
#include ../../../zen/glance/jar.inc.mn
diff --git a/src/browser/base/content/zen-preloaded.inc.xhtml b/src/browser/base/content/zen-preloaded.inc.xhtml
index 76f32fd5f..3e38442e9 100644
--- a/src/browser/base/content/zen-preloaded.inc.xhtml
+++ b/src/browser/base/content/zen-preloaded.inc.xhtml
@@ -8,6 +8,6 @@
-
-
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/src/browser/components/places/content/bookmarkProperties-xhtml.patch b/src/browser/components/places/content/bookmarkProperties-xhtml.patch
index 9ee0344b3..3207a4b51 100644
--- a/src/browser/components/places/content/bookmarkProperties-xhtml.patch
+++ b/src/browser/components/places/content/bookmarkProperties-xhtml.patch
@@ -15,7 +15,7 @@ index 4aad4e4fb4139aa3d81e00eefa82e26b697df973..831e42a4a55e277b5b8e81e4317a2007
src="chrome://browser/locale/places/bookmarkProperties.properties"/>
-+
++
+
diff --git a/src/toolkit/content/widgets/arrowscrollbox-js.patch b/src/toolkit/content/widgets/arrowscrollbox-js.patch
index b81b366f9..4f15c2c29 100644
--- a/src/toolkit/content/widgets/arrowscrollbox-js.patch
+++ b/src/toolkit/content/widgets/arrowscrollbox-js.patch
@@ -1,5 +1,5 @@
diff --git a/toolkit/content/widgets/arrowscrollbox.js b/toolkit/content/widgets/arrowscrollbox.js
-index b80d1049bb6ae305f2ac9c4c35fe975fd508031c..9bc80194d4e35f663b5c15baae55fa48eed4ffe9 100644
+index b80d1049bb6ae305f2ac9c4c35fe975fd508031c..be2cbdb20cb2064459b6f7bef56fd0470c3b7f40 100644
--- a/toolkit/content/widgets/arrowscrollbox.js
+++ b/toolkit/content/widgets/arrowscrollbox.js
@@ -98,6 +98,7 @@
@@ -15,7 +15,7 @@ index b80d1049bb6ae305f2ac9c4c35fe975fd508031c..9bc80194d4e35f663b5c15baae55fa48
on_wheel(event) {
// Don't consume the event if we can't scroll.
- if (!this.overflowing) {
-+ if (!this.overflowing || this.id === 'tabbrowser-arrowscrollbox' || ((event.deltaY == 0 || window.gZenWorkspaces?._swipeState?.isGestureActive) && this.classList.contains('workspace-arrowscrollbox'))) {
++ if (!this.overflowing || this.id === 'tabbrowser-arrowscrollbox' || ((event.deltaY == 0 || window.gZenWorkspaces?._swipeManager?.isGestureActive) && this.classList.contains('workspace-arrowscrollbox'))) {
return;
}
diff --git a/src/zen/common/ZenPreloadedScripts.js b/src/zen/common/ZenPreloadedScripts.js
index 92ef4f65f..dd83de876 100644
--- a/src/zen/common/ZenPreloadedScripts.js
+++ b/src/zen/common/ZenPreloadedScripts.js
@@ -5,7 +5,7 @@
// prettier-ignore
// eslint-disable-next-line no-lone-blocks
{
- Services.scriptloader.loadSubScript("chrome://browser/content/zen-components/ZenWorkspaceBookmarksStorage.js", this);
+ Services.scriptloader.loadSubScript("chrome://browser/content/zen-components/ZenSpaceBookmarksStorage.js", this);
ChromeUtils.importESModule("chrome://browser/content/ZenStartup.mjs", { global: "current" });
ChromeUtils.importESModule("chrome://browser/content/zen-components/ZenCompactMode.mjs", { global: "current" });
diff --git a/src/zen/moz.build b/src/zen/moz.build
index 6e54f9573..2d32efe20 100644
--- a/src/zen/moz.build
+++ b/src/zen/moz.build
@@ -17,4 +17,5 @@ DIRS += [
"toolkit",
"sessionstore",
"share",
+ "spaces",
]
diff --git a/src/zen/workspaces/ZenGradientGenerator.mjs b/src/zen/spaces/ZenGradientGenerator.mjs
similarity index 100%
rename from src/zen/workspaces/ZenGradientGenerator.mjs
rename to src/zen/spaces/ZenGradientGenerator.mjs
diff --git a/src/zen/workspaces/ZenWorkspace.mjs b/src/zen/spaces/ZenSpace.mjs
similarity index 100%
rename from src/zen/workspaces/ZenWorkspace.mjs
rename to src/zen/spaces/ZenSpace.mjs
diff --git a/src/zen/workspaces/ZenWorkspaceBookmarksStorage.js b/src/zen/spaces/ZenSpaceBookmarksStorage.js
similarity index 100%
rename from src/zen/workspaces/ZenWorkspaceBookmarksStorage.js
rename to src/zen/spaces/ZenSpaceBookmarksStorage.js
diff --git a/src/zen/workspaces/ZenWorkspaceCreation.mjs b/src/zen/spaces/ZenSpaceCreation.mjs
similarity index 100%
rename from src/zen/workspaces/ZenWorkspaceCreation.mjs
rename to src/zen/spaces/ZenSpaceCreation.mjs
diff --git a/src/zen/workspaces/ZenWorkspaceIcons.mjs b/src/zen/spaces/ZenSpaceIcons.mjs
similarity index 100%
rename from src/zen/workspaces/ZenWorkspaceIcons.mjs
rename to src/zen/spaces/ZenSpaceIcons.mjs
diff --git a/src/zen/workspaces/ZenWorkspaces.mjs b/src/zen/spaces/ZenSpaceManager.mjs
similarity index 95%
rename from src/zen/workspaces/ZenWorkspaces.mjs
rename to src/zen/spaces/ZenSpaceManager.mjs
index d66024bec..b5e2506d8 100644
--- a/src/zen/workspaces/ZenWorkspaces.mjs
+++ b/src/zen/spaces/ZenSpaceManager.mjs
@@ -4,7 +4,8 @@
/* eslint-disable no-shadow */
-import { nsZenThemePicker } from "chrome://browser/content/zen-components/ZenGradientGenerator.mjs";
+import { nsZenThemePicker } from "resource:///modules/zen/ZenGradientGenerator.mjs";
+import { ZenSpacesSwipe } from "resource:///modules/zen/ZenSpacesSwipe.mjs";
const lazy = {};
@@ -40,12 +41,6 @@ class nsZenWorkspaces {
#canDebug = Services.prefs.getBoolPref("zen.workspaces.debug", false);
#activeWorkspace = "";
- _swipeState = {
- isGestureActive: true,
- lastDelta: 0,
- direction: null,
- };
-
_workspaceCache = [];
#lastScrollTime = 0;
@@ -194,7 +189,7 @@ class nsZenWorkspaces {
this.workspaceEnabled &&
!this.isPrivateWindow
) {
- this.initializeGestureHandlers();
+ this._swipeManager = new ZenSpacesSwipe();
this.initializeWorkspaceNavigation();
}
}
@@ -647,73 +642,9 @@ class nsZenWorkspaces {
);
}
- initializeGestureHandlers() {
- const elements = [
- gNavToolbox,
- // event handlers do not work on elements inside shadow DOM so we need to attach them directly
- document
- .getElementById("tabbrowser-arrowscrollbox")
- .shadowRoot.querySelector("scrollbox"),
- ];
-
- // Attach gesture handlers to each element
- for (const element of elements) {
- if (!element) {
- continue;
- }
- this.attachGestureHandlers(element);
- }
- }
-
- attachGestureHandlers(element) {
- element.addEventListener(
- "MozSwipeGestureMayStart",
- this._handleSwipeMayStart.bind(this),
- true
- );
- element.addEventListener(
- "MozSwipeGestureStart",
- this._handleSwipeStart.bind(this),
- true
- );
- element.addEventListener(
- "MozSwipeGestureUpdate",
- this._handleSwipeUpdate.bind(this),
- true
- );
-
- // Use MozSwipeGesture instead of MozSwipeGestureEnd because MozSwipeGestureEnd is fired after animation ends,
- // while MozSwipeGesture is fired immediately after swipe ends.
- element.addEventListener(
- "MozSwipeGesture",
- this._handleSwipeEnd.bind(this),
- true
- );
-
- element.addEventListener(
- "MozSwipeGestureEnd",
- () => {
- Services.prefs.setBoolPref("zen.swipe.is-fast-swipe", false);
- document.documentElement.removeAttribute("swipe-gesture");
- gZenUIManager.tabsWrapper.style.removeProperty("scrollbar-width");
- [lazy.browserBackgroundElement, lazy.toolbarBackgroundElement].forEach(
- element => {
- element.style.setProperty("--zen-background-opacity", "1");
- }
- );
- delete this._hasAnimatedBackgrounds;
- this.updateTabsContainers();
- document.removeEventListener("popupshown", this.popupOpenHandler, {
- once: true,
- });
- },
- true
- );
- }
-
_popupOpenHandler() {
// If a popup is opened, we should stop the swipe gesture
- if (this._swipeState?.isGestureActive) {
+ if (this._swipeManager?.isGestureActive) {
document.documentElement.removeAttribute("swipe-gesture");
gZenUIManager.tabsWrapper.style.removeProperty("scrollbar-width");
this.updateTabsContainers();
@@ -721,113 +652,6 @@ class nsZenWorkspaces {
}
}
- _handleSwipeMayStart(event) {
- if (this.privateWindowOrDisabled || this.#inChangingWorkspace) {
- return;
- }
- if (
- event.target.closest("#zen-sidebar-foot-buttons") ||
- event.target.closest('#urlbar[zen-floating-urlbar="true"]')
- ) {
- return;
- }
-
- // Only handle horizontal swipes
- if (
- event.direction === event.DIRECTION_LEFT ||
- event.direction === event.DIRECTION_RIGHT
- ) {
- event.preventDefault();
- event.stopPropagation();
-
- // Set allowed directions based on available workspaces
- event.allowedDirections |= event.DIRECTION_LEFT | event.DIRECTION_RIGHT;
- }
- }
-
- _handleSwipeStart(event) {
- if (!this.workspaceEnabled) {
- return;
- }
-
- gZenFolders.cancelPopupTimer();
-
- document.documentElement.setAttribute("swipe-gesture", "true");
- document.addEventListener("popupshown", this.popupOpenHandler, {
- once: true,
- });
-
- event.preventDefault();
- event.stopPropagation();
- this._swipeState = {
- isGestureActive: true,
- lastDelta: 0,
- direction: null,
- };
- Services.prefs.setBoolPref("zen.swipe.is-fast-swipe", true);
- }
-
- _handleSwipeUpdate(event) {
- if (!this.workspaceEnabled || !this._swipeState?.isGestureActive) {
- return;
- }
-
- event.preventDefault();
- event.stopPropagation();
-
- const delta = event.delta * 300;
- const stripWidth =
- window.windowUtils.getBoundsWithoutFlushing(
- document.getElementById("navigator-toolbox")
- ).width +
- window.windowUtils.getBoundsWithoutFlushing(
- document.getElementById("zen-sidebar-splitter")
- ).width *
- 2;
- let translateX = this._swipeState.lastDelta + delta;
- // Add a force multiplier as we are translating the strip depending on how close to the edge we are
- let forceMultiplier = Math.min(
- 1,
- 1 - Math.abs(translateX) / (stripWidth * 4.5)
- ); // 4.5 instead of 4 to add a bit of a buffer
- if (forceMultiplier > 0.5) {
- translateX *= forceMultiplier;
- this._swipeState.lastDelta = delta + (translateX - delta) * 0.5;
- } else {
- translateX = this._swipeState.lastDelta;
- }
-
- if (Math.abs(delta) > 0.8) {
- this._swipeState.direction = delta > 0 ? "left" : "right";
- }
-
- // Apply a translateX to the tab strip to give the user feedback on the swipe
- const currentWorkspace = this.getActiveWorkspaceFromCache();
- this._organizeWorkspaceStripLocations(currentWorkspace, true, translateX);
- }
-
- async _handleSwipeEnd(event) {
- if (!this.workspaceEnabled) {
- return;
- }
- event.preventDefault();
- event.stopPropagation();
- const isRTL = document.documentElement.matches(":-moz-locale-dir(rtl)");
- const moveForward =
- (event.direction === SimpleGestureEvent.DIRECTION_RIGHT) !== isRTL;
-
- const rawDirection = moveForward ? 1 : -1;
- const direction = this.naturalScroll ? -1 : 1;
- await this.changeWorkspaceShortcut(rawDirection * direction, true);
-
- // Reset swipe state
- this._swipeState = {
- isGestureActive: false,
- lastDelta: 0,
- direction: null,
- };
- }
-
get activeWorkspace() {
return this.#activeWorkspace;
}
@@ -847,6 +671,10 @@ class nsZenWorkspaces {
Services.prefs.setStringPref("zen.workspaces.active", value);
}
+ get isChangingWorkspace() {
+ return this.#inChangingWorkspace;
+ }
+
get shouldHaveWorkspaces() {
if (typeof this._shouldHaveWorkspaces === "undefined") {
let chromeFlags = window.docShell.treeOwner
diff --git a/src/zen/spaces/ZenSpacesSwipe.mjs b/src/zen/spaces/ZenSpacesSwipe.mjs
new file mode 100644
index 000000000..dca3359b7
--- /dev/null
+++ b/src/zen/spaces/ZenSpacesSwipe.mjs
@@ -0,0 +1,210 @@
+/* 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/. */
+
+const lazy = {};
+
+ChromeUtils.defineLazyGetter(lazy, "browserBackgroundElement", () => {
+ return document.getElementById("zen-browser-background");
+});
+
+ChromeUtils.defineLazyGetter(lazy, "toolbarBackgroundElement", () => {
+ return document.getElementById("zen-toolbar-background");
+});
+
+export class ZenSpacesSwipe {
+ _swipeState = {
+ isGestureActive: false,
+ lastDelta: 0,
+ direction: null,
+ };
+
+ constructor() {
+ const elements = [
+ gNavToolbox,
+ // Event handlers do not work on elements inside shadow DOM
+ // so we need to attach them directly.
+ document
+ .getElementById("tabbrowser-arrowscrollbox")
+ ?.shadowRoot?.querySelector("scrollbox"),
+ ];
+
+ for (const element of elements) {
+ if (!element) {
+ continue;
+ }
+ this._attachWorkspaceSwipeGestures(element);
+ }
+ }
+
+ _attachWorkspaceSwipeGestures(element) {
+ element.addEventListener(
+ "MozSwipeGestureMayStart",
+ this._handleSwipeMayStart.bind(this),
+ true
+ );
+ element.addEventListener(
+ "MozSwipeGestureStart",
+ this._handleSwipeStart.bind(this),
+ true
+ );
+ element.addEventListener(
+ "MozSwipeGestureUpdate",
+ this._handleSwipeUpdate.bind(this),
+ true
+ );
+
+ // Use MozSwipeGesture instead of MozSwipeGestureEnd because MozSwipeGestureEnd is fired after animation ends,
+ // while MozSwipeGesture is fired immediately after swipe ends.
+ element.addEventListener(
+ "MozSwipeGesture",
+ this._handleSwipeEnd.bind(this),
+ true
+ );
+
+ element.addEventListener(
+ "MozSwipeGestureEnd",
+ () => {
+ this.onSwipeGestureAnimationEnd();
+ },
+ true
+ );
+ }
+
+ _handleSwipeMayStart(event) {
+ const ws = gZenWorkspaces;
+
+ if (ws.privateWindowOrDisabled || ws.isChangingWorkspace) {
+ return;
+ }
+ if (
+ event.target.closest("#zen-sidebar-foot-buttons") ||
+ event.target.closest('#urlbar[zen-floating-urlbar="true"]')
+ ) {
+ return;
+ }
+
+ // Only handle horizontal swipes
+ if (
+ event.direction === event.DIRECTION_LEFT ||
+ event.direction === event.DIRECTION_RIGHT
+ ) {
+ event.preventDefault();
+ event.stopPropagation();
+
+ // Set allowed directions based on available workspaces
+ event.allowedDirections |= event.DIRECTION_LEFT | event.DIRECTION_RIGHT;
+ }
+ }
+
+ _handleSwipeStart(event) {
+ const ws = gZenWorkspaces;
+
+ if (!ws.workspaceEnabled) {
+ return;
+ }
+
+ gZenFolders.cancelPopupTimer();
+
+ document.documentElement.setAttribute("swipe-gesture", "true");
+ document.addEventListener("popupshown", ws.popupOpenHandler, {
+ once: true,
+ });
+
+ event.preventDefault();
+ event.stopPropagation();
+ this._swipeState = {
+ isGestureActive: true,
+ lastDelta: 0,
+ direction: null,
+ };
+ Services.prefs.setBoolPref("zen.swipe.is-fast-swipe", true);
+ }
+
+ _handleSwipeUpdate(event) {
+ const ws = gZenWorkspaces;
+
+ if (!ws.workspaceEnabled || !this._swipeState?.isGestureActive) {
+ return;
+ }
+
+ event.preventDefault();
+ event.stopPropagation();
+
+ const delta = event.delta * 300;
+ const stripWidth =
+ window.windowUtils.getBoundsWithoutFlushing(
+ document.getElementById("navigator-toolbox")
+ ).width +
+ window.windowUtils.getBoundsWithoutFlushing(
+ document.getElementById("zen-sidebar-splitter")
+ ).width *
+ 2;
+ let translateX = this._swipeState.lastDelta + delta;
+ // Add a force multiplier as we are translating the strip depending on how close to the edge we are
+ let forceMultiplier = Math.min(
+ 1,
+ 1 - Math.abs(translateX) / (stripWidth * 4.5)
+ ); // 4.5 instead of 4 to add a bit of a buffer
+ if (forceMultiplier > 0.5) {
+ translateX *= forceMultiplier;
+ this._swipeState.lastDelta = delta + (translateX - delta) * 0.5;
+ } else {
+ translateX = this._swipeState.lastDelta;
+ }
+
+ if (Math.abs(delta) > 0.8) {
+ this._swipeState.direction = delta > 0 ? "left" : "right";
+ }
+
+ // Apply a translateX to the tab strip to give the user feedback on the swipe
+ const currentWorkspace = ws.getActiveWorkspaceFromCache();
+ ws._organizeWorkspaceStripLocations(currentWorkspace, true, translateX);
+ }
+
+ async _handleSwipeEnd(event) {
+ const ws = gZenWorkspaces;
+
+ if (!ws.workspaceEnabled) {
+ return;
+ }
+ event.preventDefault();
+ event.stopPropagation();
+ const isRTL = document.documentElement.matches(":-moz-locale-dir(rtl)");
+ const moveForward =
+ (event.direction === SimpleGestureEvent.DIRECTION_RIGHT) !== isRTL;
+
+ const rawDirection = moveForward ? 1 : -1;
+ const direction = ws.naturalScroll ? -1 : 1;
+ await ws.changeWorkspaceShortcut(rawDirection * direction, true);
+
+ // Reset swipe state
+ this._swipeState = {
+ isGestureActive: false,
+ lastDelta: 0,
+ direction: null,
+ };
+ }
+
+ onSwipeGestureAnimationEnd() {
+ const ws = gZenWorkspaces;
+
+ Services.prefs.setBoolPref("zen.swipe.is-fast-swipe", false);
+ document.documentElement.removeAttribute("swipe-gesture");
+ gZenUIManager.tabsWrapper.style.removeProperty("scrollbar-width");
+ [lazy.browserBackgroundElement, lazy.toolbarBackgroundElement].forEach(
+ element => {
+ element.style.setProperty("--zen-background-opacity", "1");
+ }
+ );
+ delete ws._hasAnimatedBackgrounds;
+ ws.updateTabsContainers();
+ document.removeEventListener("popupshown", ws.popupOpenHandler, {
+ once: true,
+ });
+ }
+
+ get isGestureActive() {
+ return this._swipeState?.isGestureActive;
+ }
+}
diff --git a/src/zen/workspaces/create-workspace-form.css b/src/zen/spaces/create-workspace-form.css
similarity index 100%
rename from src/zen/workspaces/create-workspace-form.css
rename to src/zen/spaces/create-workspace-form.css
diff --git a/src/zen/spaces/jar.inc.mn b/src/zen/spaces/jar.inc.mn
new file mode 100644
index 000000000..0d7aed6d3
--- /dev/null
+++ b/src/zen/spaces/jar.inc.mn
@@ -0,0 +1,7 @@
+# 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/.
+
+ content/browser/zen-components/ZenSpaceBookmarksStorage.js (../../zen/spaces/ZenSpaceBookmarksStorage.js)
+* content/browser/zen-styles/zen-workspaces.css (../../zen/spaces/zen-workspaces.css)
+ content/browser/zen-styles/zen-gradient-generator.css (../../zen/spaces/zen-gradient-generator.css)
diff --git a/src/zen/spaces/moz.build b/src/zen/spaces/moz.build
new file mode 100644
index 000000000..e1225e24e
--- /dev/null
+++ b/src/zen/spaces/moz.build
@@ -0,0 +1,12 @@
+# 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.zen += [
+ "ZenGradientGenerator.mjs",
+ "ZenSpace.mjs",
+ "ZenSpaceCreation.mjs",
+ "ZenSpaceIcons.mjs",
+ "ZenSpaceManager.mjs",
+ "ZenSpacesSwipe.mjs",
+]
diff --git a/src/zen/workspaces/overflow-icons.inc.css b/src/zen/spaces/overflow-icons.inc.css
similarity index 100%
rename from src/zen/workspaces/overflow-icons.inc.css
rename to src/zen/spaces/overflow-icons.inc.css
diff --git a/src/zen/workspaces/zen-gradient-generator.css b/src/zen/spaces/zen-gradient-generator.css
similarity index 100%
rename from src/zen/workspaces/zen-gradient-generator.css
rename to src/zen/spaces/zen-gradient-generator.css
diff --git a/src/zen/workspaces/zen-workspaces.css b/src/zen/spaces/zen-workspaces.css
similarity index 99%
rename from src/zen/workspaces/zen-workspaces.css
rename to src/zen/spaces/zen-workspaces.css
index 45a81ecb5..66d4d7c5e 100644
--- a/src/zen/workspaces/zen-workspaces.css
+++ b/src/zen/spaces/zen-workspaces.css
@@ -13,7 +13,6 @@
font-size: x-small;
margin: 0 3px;
padding: 0;
- appearance: auto;
position: relative;
-moz-window-dragging: no-drag;
@@ -243,7 +242,6 @@
.zen-current-workspace-indicator-name {
display: block;
- white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
cursor: auto;
diff --git a/src/zen/workspaces/jar.inc.mn b/src/zen/workspaces/jar.inc.mn
deleted file mode 100644
index 32c9919ab..000000000
--- a/src/zen/workspaces/jar.inc.mn
+++ /dev/null
@@ -1,12 +0,0 @@
-# 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/.
-
- content/browser/zen-components/ZenWorkspaceIcons.mjs (../../zen/workspaces/ZenWorkspaceIcons.mjs)
- content/browser/zen-components/ZenWorkspace.mjs (../../zen/workspaces/ZenWorkspace.mjs)
- content/browser/zen-components/ZenWorkspaces.mjs (../../zen/workspaces/ZenWorkspaces.mjs)
- content/browser/zen-components/ZenWorkspaceCreation.mjs (../../zen/workspaces/ZenWorkspaceCreation.mjs)
- content/browser/zen-components/ZenWorkspaceBookmarksStorage.js (../../zen/workspaces/ZenWorkspaceBookmarksStorage.js)
- 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)