feat: Improved pinned tabs collapse impl and disable window sync for tests, b=no-bug, c=tabs, common, workspaces
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/components/tabbrowser/content/tab.js b/browser/components/tabbrowser/content/tab.js
|
||||
index 2dacb325190b6ae42ebeb3e9f0e862dc690ecdca..160e277d64eaac8408aed90eaf62606479424001 100644
|
||||
index 2dacb325190b6ae42ebeb3e9f0e862dc690ecdca..1cc31b04e0165f7ae6ffc377da08f8d83bee7390 100644
|
||||
--- a/browser/components/tabbrowser/content/tab.js
|
||||
+++ b/browser/components/tabbrowser/content/tab.js
|
||||
@@ -21,6 +21,7 @@
|
||||
@@ -98,7 +98,7 @@ index 2dacb325190b6ae42ebeb3e9f0e862dc690ecdca..160e277d64eaac8408aed90eaf626064
|
||||
+ if (gBrowser.isTabGroup(this.parentElement?.parentElement)) {
|
||||
+ return this.parentElement.parentElement;
|
||||
+ }
|
||||
+ if (this.pinned) {
|
||||
+ if (this.pinned && !this.hasAttribute('zen-essential')) {
|
||||
+ let collapsiblePins = gZenWorkspaces.workspaceElement(this.getAttribute('zen-workspace-id'))?.collapsiblePins;
|
||||
+ if (collapsiblePins?.collapsed) {
|
||||
+ return collapsiblePins;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
|
||||
index 6b6c04599fe80983d13d2069ca62b99d8ad70271..6d5ae983446bc778f3075d79f8ff14748dd7756f 100644
|
||||
index 6b6c04599fe80983d13d2069ca62b99d8ad70271..ebe4818a71b37e8b7cd2937f72cc60f202dadef8 100644
|
||||
--- a/browser/components/tabbrowser/content/tabs.js
|
||||
+++ b/browser/components/tabbrowser/content/tabs.js
|
||||
@@ -235,7 +235,7 @@
|
||||
@@ -146,7 +146,7 @@ index 6b6c04599fe80983d13d2069ca62b99d8ad70271..6d5ae983446bc778f3075d79f8ff1474
|
||||
- }
|
||||
- }
|
||||
- for (let child of unpinnedChildren) {
|
||||
+ for (let child of [...gZenWorkspaces.getCurrentEssentialsContainer().children, ...this.pinnedTabsContainer.children, ...children]) {
|
||||
+ for (let child of [...gZenWorkspaces.getCurrentEssentialsContainer().children, ...(gZenWorkspaces.activeWorkspaceElement?.hasCollapsedPinnedTabs ? [] : this.pinnedTabsContainer.children), ...children]) {
|
||||
if (isTab(child) && child.visible) {
|
||||
child.elementIndex = elementIndex++;
|
||||
focusableItems.push(child);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
diff --git a/testing/profiles/mochitest/user.js b/testing/profiles/mochitest/user.js
|
||||
index a4068ac3f61161d014c49d54ae7a3bf886868f1b..7771d8c99aa20105b1382437881cdc02b17688c2 100644
|
||||
index a4068ac3f61161d014c49d54ae7a3bf886868f1b..b755e8004bc19817c83668603ecf0127000b709f 100644
|
||||
--- a/testing/profiles/mochitest/user.js
|
||||
+++ b/testing/profiles/mochitest/user.js
|
||||
@@ -41,3 +41,7 @@ user_pref("places.history.floodingPrevention.enabled", false);
|
||||
@@ -41,3 +41,8 @@ user_pref("places.history.floodingPrevention.enabled", false);
|
||||
// permission, and we can open it and wait for the user to give permission, then
|
||||
// don't do that.
|
||||
user_pref("geo.prompt.open_system_prefs", false);
|
||||
@@ -10,3 +10,4 @@ index a4068ac3f61161d014c49d54ae7a3bf886868f1b..7771d8c99aa20105b1382437881cdc02
|
||||
+user_pref("zen.welcome-screen.seen", true);
|
||||
+user_pref("zen.watermark.enabled", false);
|
||||
+user_pref("zen.testing.enabled", true);
|
||||
+user_pref("zen.window-sync.enabled", true);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
diff --git a/testing/profiles/profileserver/user.js b/testing/profiles/profileserver/user.js
|
||||
index 19ff7d474f6d22d2d386764e2e6942ce6a324470..9334d609a69f05762cfb3a667e01c4da8beb66dd 100644
|
||||
index 19ff7d474f6d22d2d386764e2e6942ce6a324470..1ebee9ead3c73f74ab73a5303a98ec172f94edd2 100644
|
||||
--- a/testing/profiles/profileserver/user.js
|
||||
+++ b/testing/profiles/profileserver/user.js
|
||||
@@ -8,3 +8,11 @@
|
||||
@@ -8,3 +8,12 @@
|
||||
user_pref("dom.timeout.enable_budget_timer_throttling", false);
|
||||
// Turn off update
|
||||
user_pref("app.update.disabledForTesting", true);
|
||||
@@ -13,4 +13,5 @@ index 19ff7d474f6d22d2d386764e2e6942ce6a324470..9334d609a69f05762cfb3a667e01c4da
|
||||
+user_pref("zen.watermark.enabled", false);
|
||||
+user_pref("zen.urlbar.replace-newtab", false);
|
||||
+user_pref("zen.testing.enabled", true);
|
||||
+user_pref("zen.window-sync.enabled", true);
|
||||
+user_pref("zen.testing.profiling.enabled", true);
|
||||
|
||||
@@ -225,16 +225,19 @@
|
||||
--toolbar-field-color: var(--toolbox-textcolor) !important;
|
||||
|
||||
&[zen-private-window='true'] {
|
||||
--zen-main-browser-background: linear-gradient(130deg, rgb(10, 6, 11) 0%, rgb(19, 7, 22) 100%);
|
||||
--zen-main-browser-background: linear-gradient(130deg,
|
||||
color-mix(in srgb, rgb(10, 6, 11) 80%, var(--zen-themed-toolbar-bg-transparent)) 0%,
|
||||
color-mix(in srgb, rgb(19, 7, 22) 80%, var(--zen-themed-toolbar-bg-transparent)) 100%
|
||||
);
|
||||
--zen-main-browser-background-toolbar: var(--zen-main-browser-background);
|
||||
--zen-primary-color: light-dark(rgb(93, 42, 107), rgb(110, 48, 125)) !important;
|
||||
--toolbox-textcolor: currentColor !important;
|
||||
}
|
||||
|
||||
&[zen-unsynced-window='true'] {
|
||||
--zen-main-browser-background: linear-gradient(130deg, light-dark(rgb(240, 230, 200), rgb(30, 25, 20)) 0%, light-dark(rgb(220, 200, 150), rgb(50, 45, 40)) 100%);
|
||||
--zen-main-browser-background: color-mix(in srgb, light-dark(rgb(196, 202, 229), rgb(8, 9, 40)) 60%, var(--zen-themed-toolbar-bg-transparent));
|
||||
--zen-main-browser-background-toolbar: var(--zen-main-browser-background);
|
||||
--zen-primary-color: light-dark(rgb(200, 100, 20), rgb(220, 120, 30)) !important;
|
||||
--zen-primary-color: light-dark(rgb(100, 115, 255), rgb(80, 90, 200)) !important;
|
||||
--toolbox-textcolor: currentColor !important;
|
||||
}
|
||||
|
||||
|
||||
@@ -250,7 +250,14 @@ export class nsZenSessionManager {
|
||||
// guarantee that all tabs, groups, folders and split view data
|
||||
// are properly synced across all windows.
|
||||
this.log(`Restoring Zen session data into ${initialState.windows?.length || 0} windows`);
|
||||
for (const winData of initialState.windows) {
|
||||
for (let i = 0; i < initialState.windows.length; i++) {
|
||||
let winData = initialState.windows[i];
|
||||
if (winData.isZenUnsynced) {
|
||||
// We don't wan't to restore any unsynced windows with the sidebar data.
|
||||
this.log('Skipping restore of unsynced window');
|
||||
delete initialState.windows[i];
|
||||
continue;
|
||||
}
|
||||
this.#restoreWindowData(winData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ class nsZenCollapsiblePins extends nsZenFolder {
|
||||
this.#spaceElement.removeAttribute('collapsedpinnedtabs');
|
||||
}
|
||||
super.collapsed = value;
|
||||
gBrowser.tabContainer._invalidateCachedVisibleTabs();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +49,7 @@ export class nsZenWorkspace extends MozXULElement {
|
||||
<image class="zen-current-workspace-indicator-chevron" />
|
||||
<hbox class="zen-current-workspace-indicator-icon" />
|
||||
</stack>
|
||||
<label class="zen-current-workspace-indicator-name" flex="1" />
|
||||
<label class="zen-current-workspace-indicator-name" />
|
||||
<toolbarbutton class="toolbarbutton-1 chromeclass-toolbar-additional zen-workspaces-actions" context="zenWorkspaceMoreActions" />
|
||||
</vbox>
|
||||
<arrowscrollbox orient="vertical" class="workspace-arrowscrollbox">
|
||||
|
||||
@@ -2384,7 +2384,9 @@ class nsZenWorkspaces {
|
||||
return;
|
||||
}
|
||||
if (!this.currentWindowIsSyncing) {
|
||||
name = this.isPrivateWindow ? 'Private ' + name : 'Temporary';
|
||||
containerTabId = parseInt(gBrowser.selectedTab.getAttribute('usercontextid')) || 0;
|
||||
let label = ContextualIdentityService.getUserContextLabel(containerTabId) || 'Default';
|
||||
name = this.isPrivateWindow ? 'Private ' + name : label;
|
||||
}
|
||||
// get extra tabs remaning (e.g. on new profiles) and just move them to the new workspace
|
||||
const extraTabs = Array.from(gBrowser.tabContainer.arrowScrollbox.children).filter(
|
||||
|
||||
@@ -206,6 +206,7 @@
|
||||
fill-opacity: 0.6;
|
||||
-moz-context-properties: fill-opacity, fill;
|
||||
fill: currentColor;
|
||||
font-size: 18px;
|
||||
|
||||
&[zen-emoji-open='true']::before {
|
||||
border: 1px dashed light-dark(rgba(0, 0, 0, .5), rgba(255, 255, 255, .5));
|
||||
@@ -238,6 +239,11 @@
|
||||
|
||||
:root[zen-unsynced-window] & {
|
||||
pointer-events: none;
|
||||
background: color-mix(in srgb, currentColor 20%, transparent);
|
||||
padding: 4px 8px;
|
||||
border-radius: 99px;
|
||||
font-size: 10px;
|
||||
margin-inline-start: -6px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,6 +271,7 @@
|
||||
display: flex;
|
||||
font-size: 10px;
|
||||
min-height: 22px;
|
||||
padding: 6px 8px;
|
||||
}
|
||||
|
||||
.toolbarbutton-icon {
|
||||
@@ -390,7 +397,7 @@ zen-workspace {
|
||||
height: 16px;
|
||||
transition: transform 0.2s, opacity 0.2s;
|
||||
transform: rotate(90deg);
|
||||
padding: 2px;
|
||||
padding: 1px;
|
||||
|
||||
.zen-current-workspace-indicator-stack[no-icon='true'] & {
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user