Refactor Zen Workspaces preferences and hide default container indicator

This commit is contained in:
mauro-balades 2024-09-11 23:44:47 +02:00
parent af98bb7758
commit 6d3b20062e
8 changed files with 46 additions and 11 deletions

View file

@ -1,19 +1,30 @@
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
index ef857bd81f2cd7c163ecc74ac1cf81a0b63ce838..24cf982dced9abdb412fac4abbf1428b983d16ff 100644
index ef857bd81f2cd7c163ecc74ac1cf81a0b63ce838..a9e4da68d8de456a757158a311296792a7781e8f 100644
--- a/browser/components/tabbrowser/content/tabbrowser.js
+++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -2704,6 +2704,10 @@
@@ -2704,6 +2704,11 @@
);
}
+ let hasZenDefaultUserContextId = false;
+ if (typeof ZenWorkspaces !== "undefined") {
+ userContextId = ZenWorkspaces.getContextIdIfNeeded(userContextId);
+ [userContextId, hasZenDefaultUserContextId] = ZenWorkspaces.getContextIdIfNeeded(userContextId);
+ }
+
if (!UserInteraction.running("browser.tabs.opening", window)) {
UserInteraction.start("browser.tabs.opening", "initting", window);
}
@@ -3248,6 +3252,11 @@
@@ -2771,6 +2776,9 @@
noInitialLabel,
skipBackgroundNotify,
});
+ if (hasZenDefaultUserContextId) {
+ t.setAttribute("zenDefaultUserContextId", "true");
+ }
if (insertTab) {
// insert the tab into the tab container in the correct position
this._insertTabAtIndex(t, {
@@ -3248,6 +3256,14 @@
) {
tabWasReused = true;
tab = this.selectedTab;
@ -21,22 +32,28 @@ index ef857bd81f2cd7c163ecc74ac1cf81a0b63ce838..24cf982dced9abdb412fac4abbf1428b
+ if (tabData.zenWorkspace) {
+ tab.setAttribute("zen-workspace-id", tabData.zenWorkspace);
+ }
+ if (tabData.zenDefaultUserContextId) {
+ tab.setAttribute("zenDefaultUserContextId", "true");
+ }
+
if (!tabData.pinned) {
this.unpinTab(tab);
} else {
@@ -3297,6 +3306,10 @@
@@ -3297,6 +3313,13 @@
preferredRemoteType,
});
+ if (tabData.zenWorkspace) {
+ tab.setAttribute("zen-workspace-id", tabData.zenWorkspace);
+ }
+ if (tabData.zenDefaultUserContextId) {
+ tab.setAttribute("zenDefaultUserContextId", "true");
+ }
+
if (select) {
tabToSelect = tab;
}
@@ -4184,6 +4197,7 @@
@@ -4184,6 +4207,7 @@
isLastTab ||
aTab.pinned ||
aTab.hidden ||