Compare commits

...

2 Commits
1.21.6b ... dev

Author SHA1 Message Date
Kristijan Ribarić
61e0790144 gh-14470: Rename all occurances of Workspaces to Spaces in sync (gh-14528) 2026-07-09 01:37:00 +02:00
Andrey Bochkarev
03f251ff4a gh-13870: Remove two spaces cycling (gh-14529) 2026-07-09 01:36:51 +02:00
2 changed files with 5 additions and 27 deletions

View File

@@ -1864,11 +1864,6 @@ class nsZenWorkspaces {
} }
const newTransform = diff * 100; const newTransform = diff * 100;
element.style.transform = `translateX(${newTransform + offsetPixels / 2}%)`; element.style.transform = `translateX(${newTransform + offsetPixels / 2}%)`;
// A special case for two spaces
if (spaceLen === 2 && diff !== 0) {
const side = offsetPixels > 0 ? -100 : 100;
element.style.transform = `translateX(${side + offsetPixels / 2}%)`;
}
} }
// Hide other essentials with different containerTabId // Hide other essentials with different containerTabId
for (const container of otherContainersEssentials) { for (const container of otherContainersEssentials) {
@@ -2099,12 +2094,6 @@ class nsZenWorkspaces {
offset += spaceLen; offset += spaceLen;
} }
offset = offset * 100; offset = offset * 100;
// A special case for two spaces
if (spaceLen === 2 && offset !== 0) {
const currentTransform =
parseFloat(element.style.transform.split("(")[1]) || 0;
offset = currentTransform >= 0 ? 100 : -100;
}
const newTransform = `translateX(${offset}%)`; const newTransform = `translateX(${offset}%)`;
// Only animate the workspace that is coming in, to avoid having multiple workspaces // Only animate the workspace that is coming in, to avoid having multiple workspaces
// animating off-screen at the same time which can cause performance issues. With an off // animating off-screen at the same time which can cause performance issues. With an off
@@ -2181,17 +2170,6 @@ class nsZenWorkspaces {
existingOffset = currentTransform || (isGoingLeft ? -100 : 100); existingOffset = currentTransform || (isGoingLeft ? -100 : 100);
newOffset = 0; newOffset = 0;
} }
if (spaceLen === 2) {
if (containsPrev && !containsNew) {
existingOffset = currentTransform;
newOffset = currentTransform >= 0 ? 100 : -100;
} else {
existingOffset = currentTransform >= 0 ? 100 : -100;
newOffset = 0;
}
}
const newTransform = `translateX(${newOffset}%)`; const newTransform = `translateX(${newOffset}%)`;
let existingTransform = `translateX(${existingOffset}%)`; let existingTransform = `translateX(${existingOffset}%)`;
if (shouldAnimate) { if (shouldAnimate) {

View File

@@ -33,10 +33,10 @@ const RECORD_TYPE_BY_PREFIX = Object.freeze({
* Workspaces engine collection. * Workspaces engine collection.
*/ */
export class ZenWorkspacesRecord extends CryptoWrapper { export class ZenWorkspacesRecord extends CryptoWrapper {
_logName = "Sync.Record.ZenWorkspaces"; _logName = "Sync.Record.ZenSpaces";
} }
ZenWorkspacesRecord.prototype.type = "workspaces"; ZenWorkspacesRecord.prototype.type = "spaces";
function parseRecordId(id) { function parseRecordId(id) {
const sep = id.indexOf("~"); const sep = id.indexOf("~");
@@ -51,7 +51,7 @@ function parseRecordId(id) {
function createRecordId(type, id) { function createRecordId(type, id) {
const prefix = RECORD_ID_PREFIX_BY_TYPE[type]; const prefix = RECORD_ID_PREFIX_BY_TYPE[type];
if (!prefix) { if (!prefix) {
throw new Error(`Unknown Workspaces Sync record type: ${type}`); throw new Error(`Unknown Spaces Sync record type: ${type}`);
} }
return `${prefix}~${id}`; return `${prefix}~${id}`;
} }
@@ -371,11 +371,11 @@ class ZenWorkspacesTracker extends Tracker {
*/ */
export class ZenWorkspacesEngine extends SyncEngine { export class ZenWorkspacesEngine extends SyncEngine {
static get name() { static get name() {
return "Workspaces"; return "Spaces";
} }
constructor(service) { constructor(service) {
super("Workspaces", service); super("Spaces", service);
} }
get _storeObj() { get _storeObj() {