diff --git a/src/browser/components/sessionstore/TabGroupState-sys-mjs.patch b/src/browser/components/sessionstore/TabGroupState-sys-mjs.patch index 0ced48d9aa..7b41d5a43f 100644 --- a/src/browser/components/sessionstore/TabGroupState-sys-mjs.patch +++ b/src/browser/components/sessionstore/TabGroupState-sys-mjs.patch @@ -1,14 +1,16 @@ diff --git a/browser/components/sessionstore/TabGroupState.sys.mjs b/browser/components/sessionstore/TabGroupState.sys.mjs -index 1289549cf33ce6efb620c877bd1ba1c24475d2b0..4c34c923f4b129dd9ea79414d978c6432317340c 100644 +index 1289549cf33ce6efb620c877bd1ba1c24475d2b0..ff128b9dc8cdcb418b8cc2a416026b58f8df4a1f 100644 --- a/browser/components/sessionstore/TabGroupState.sys.mjs +++ b/browser/components/sessionstore/TabGroupState.sys.mjs -@@ -65,6 +65,9 @@ class _TabGroupState { +@@ -65,6 +65,11 @@ class _TabGroupState { */ collect(tabGroup) { return { + pinned: tabGroup.pinned, + essential: tabGroup.essential, + splitView: tabGroup.hasAttribute("split-view-group"), ++ parentGroupId: tabGroup.group?.id, ++ isZenFolder: tabGroup.isZenFolder, id: tabGroup.id, name: tabGroup.label, color: tabGroup.color, diff --git a/src/browser/components/tabbrowser/content/tab-js.patch b/src/browser/components/tabbrowser/content/tab-js.patch index c759abcabb..e960c40b8d 100644 --- a/src/browser/components/tabbrowser/content/tab-js.patch +++ b/src/browser/components/tabbrowser/content/tab-js.patch @@ -1,5 +1,5 @@ diff --git a/browser/components/tabbrowser/content/tab.js b/browser/components/tabbrowser/content/tab.js -index b9381999a77ecacdb95c69494ac8972e9f13d14d..a210b53bb46373f8bab532a00b25301d645641cd 100644 +index b9381999a77ecacdb95c69494ac8972e9f13d14d..7976a3ca5bc45953126e354243d91a2c6d5dccd9 100644 --- a/browser/components/tabbrowser/content/tab.js +++ b/browser/components/tabbrowser/content/tab.js @@ -21,6 +21,7 @@ @@ -52,7 +52,7 @@ index b9381999a77ecacdb95c69494ac8972e9f13d14d..a210b53bb46373f8bab532a00b25301d return; } -@@ -225,11 +228,25 @@ +@@ -225,11 +228,23 @@ } get visible() { @@ -66,13 +66,11 @@ index b9381999a77ecacdb95c69494ac8972e9f13d14d..a210b53bb46373f8bab532a00b25301d + } + // Selected tabs are always visible + if (this.selected || this.multiselected) return true; -+ // Recursively check all parent groups -+ let currentParent = this.group; -+ while (currentParent) { -+ if (currentParent.collapsed && !currentParent.activeTabs?.includes(this)) { -+ return false; ++ if (this.group) { ++ if (this.group.hasAttribute("split-view-group") && this.group?.group?.isZenFolder) { ++ return this.group.group.isTabVisibleInGroup(this); + } -+ currentParent = currentParent.group; ++ return this.group.isTabVisibleInGroup(this); + } + if (this.pinned && !this.hasAttribute("zen-essential") && + gZenWorkspaces.activeWorkspaceElement?.hasCollapsedPinnedTabs && @@ -83,7 +81,7 @@ index b9381999a77ecacdb95c69494ac8972e9f13d14d..a210b53bb46373f8bab532a00b25301d } get hidden() { -@@ -308,7 +325,7 @@ +@@ -308,7 +323,7 @@ return false; } @@ -92,7 +90,7 @@ index b9381999a77ecacdb95c69494ac8972e9f13d14d..a210b53bb46373f8bab532a00b25301d } get lastAccessed() { -@@ -393,7 +410,18 @@ +@@ -393,7 +408,24 @@ } get group() { @@ -100,8 +98,14 @@ index b9381999a77ecacdb95c69494ac8972e9f13d14d..a210b53bb46373f8bab532a00b25301d + if (typeof gBrowser === "undefined") { + return null; + } -+ if (gBrowser.isTabGroup(this.parentElement?.parentElement)) { -+ return this.parentElement.parentElement; ++ if (this._originalGroup && !this.splitView && (this.parentElement.classList.contains("tab-group-active-tabs-container") || this.parentElement.classList.contains("zen-workspace-pinned-active-tabs-section"))) return this._originalGroup; ++ let group = this.parentElement?.parentElement; // FF groups and Split View ++ if (group && gBrowser.isTabGroup(group)) { ++ return this.parentElement.parentElement ++ } ++ group = this.parentElement?.parentElement?.parentElement; // Folders ++ if (group && gBrowser.isTabGroup(group)) { ++ return this.parentElement.parentElement.parentElement + } + if (this.pinned && !this.hasAttribute('zen-essential')) { + let collapsiblePins = gZenWorkspaces.workspaceElement(this.getAttribute('zen-workspace-id'))?.collapsiblePins; @@ -112,7 +116,7 @@ index b9381999a77ecacdb95c69494ac8972e9f13d14d..a210b53bb46373f8bab532a00b25301d } get splitview() { -@@ -475,6 +503,10 @@ +@@ -475,6 +507,10 @@ } } @@ -123,7 +127,7 @@ index b9381999a77ecacdb95c69494ac8972e9f13d14d..a210b53bb46373f8bab532a00b25301d // If the previous target wasn't part of this tab then this is a mouseenter event. if (!this.contains(event.relatedTarget)) { this._mouseenter(); -@@ -504,6 +536,7 @@ +@@ -504,6 +540,7 @@ if (!this.contains(event.relatedTarget)) { this._mouseleave(); } @@ -131,7 +135,7 @@ index b9381999a77ecacdb95c69494ac8972e9f13d14d..a210b53bb46373f8bab532a00b25301d } on_dragstart(event) { -@@ -538,6 +571,8 @@ +@@ -538,6 +575,8 @@ this.style.MozUserFocus = "ignore"; } else if ( event.target.classList.contains("tab-close-button") || @@ -140,7 +144,7 @@ index b9381999a77ecacdb95c69494ac8972e9f13d14d..a210b53bb46373f8bab532a00b25301d event.target.classList.contains("tab-icon-overlay") || event.target.classList.contains("tab-audio-button") ) { -@@ -572,7 +607,7 @@ +@@ -572,7 +611,7 @@ } } else if ( event.altKey && @@ -149,7 +153,7 @@ index b9381999a77ecacdb95c69494ac8972e9f13d14d..a210b53bb46373f8bab532a00b25301d ) { eventMaySelectTab = false; } else if (!this.selected && this.multiselected) { -@@ -597,6 +632,10 @@ +@@ -597,6 +636,10 @@ this.style.MozUserFocus = ""; } @@ -160,7 +164,7 @@ index b9381999a77ecacdb95c69494ac8972e9f13d14d..a210b53bb46373f8bab532a00b25301d on_click(event) { if (event.button != 0) { return; -@@ -620,14 +659,31 @@ +@@ -620,14 +663,31 @@ trigger: "alt_click", }); } @@ -193,7 +197,7 @@ index b9381999a77ecacdb95c69494ac8972e9f13d14d..a210b53bb46373f8bab532a00b25301d gBrowser.multiSelectedTabsCount > 0 && !event.target.classList.contains("tab-close-button") && !event.target.classList.contains("tab-icon-overlay") && -@@ -639,8 +695,9 @@ +@@ -639,8 +699,9 @@ } if ( @@ -205,7 +209,7 @@ index b9381999a77ecacdb95c69494ac8972e9f13d14d..a210b53bb46373f8bab532a00b25301d ) { if (this.activeMediaBlocked) { if (this.multiselected) { -@@ -658,7 +715,7 @@ +@@ -658,7 +719,7 @@ return; } @@ -214,7 +218,7 @@ index b9381999a77ecacdb95c69494ac8972e9f13d14d..a210b53bb46373f8bab532a00b25301d if (this.multiselected) { gBrowser.removeMultiSelectedTabs( lazy.TabMetrics.userTriggeredContext( -@@ -678,6 +735,14 @@ +@@ -678,6 +739,14 @@ // (see tabbrowser-tabs 'click' handler). gBrowser.tabContainer._blockDblClick = true; } @@ -229,7 +233,7 @@ index b9381999a77ecacdb95c69494ac8972e9f13d14d..a210b53bb46373f8bab532a00b25301d } on_dblclick(event) { -@@ -701,6 +766,8 @@ +@@ -701,6 +770,8 @@ animate: true, triggeringEvent: event, }); diff --git a/src/browser/components/tabbrowser/content/tabbrowser-js.patch b/src/browser/components/tabbrowser/content/tabbrowser-js.patch index e2458ba13b..9116979981 100644 --- a/src/browser/components/tabbrowser/content/tabbrowser-js.patch +++ b/src/browser/components/tabbrowser/content/tabbrowser-js.patch @@ -1,5 +1,5 @@ diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js -index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88f4eec282 100644 +index 43fb79a3060e20f671ae6ffc26350c7abf497702..9ac12f77a7fa77fdfbcfdb218a107a44e1693da0 100644 --- a/browser/components/tabbrowser/content/tabbrowser.js +++ b/browser/components/tabbrowser/content/tabbrowser.js @@ -502,6 +502,7 @@ @@ -454,19 +454,18 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 let { groupId } = tabData; const tabGroup = tabGroupWorkingData.get(groupId); // if a tab refers to a tab group we don't know, skip any group -@@ -4564,7 +4692,10 @@ +@@ -4559,7 +4687,9 @@ + + // if this is the first time encountering a tab group, create its + // DOM node once and place it in the tabs bar fragment +- if (!tabGroup.node) { ++ if (tabGroup.stateData.isZenFolder || tabGroup.stateData.splitView) { ++ gZenFolders.createGroup(tabGroup.stateData.id, tabGroupWorkingData, tabsFragment); ++ } else { + tabGroup.node = this._createTabGroup( tabGroup.stateData.id, tabGroup.stateData.color, - tabGroup.stateData.collapsed, -- tabGroup.stateData.name -+ tabGroup.stateData.name, -+ tabGroup.stateData.pinned, -+ tabGroup.stateData.essential, -+ tabGroup.stateData.splitView, - ); - tabsFragment.appendChild(tabGroup.node); - } -@@ -4619,9 +4750,21 @@ +@@ -4619,9 +4749,21 @@ // to remove the old selected tab. if (tabToSelect) { let leftoverTab = this.selectedTab; @@ -488,7 +487,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 if (tabs.length > 1 || !tabs[0].selected) { this._updateTabsAfterInsert(); -@@ -4812,11 +4955,14 @@ +@@ -4812,11 +4954,14 @@ if (ownerTab) { tab.owner = ownerTab; } @@ -504,7 +503,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 if ( !bulkOrderedOpen && ((openerTab && -@@ -4828,7 +4974,7 @@ +@@ -4828,7 +4973,7 @@ let lastRelatedTab = openerTab && this._lastRelatedTabMap.get(openerTab); let previousTab = lastRelatedTab || openerTab || this.selectedTab; @@ -513,7 +512,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 tabGroup = previousTab.group; } if ( -@@ -4844,7 +4990,7 @@ +@@ -4844,7 +4989,7 @@ previousTab.splitview ) + 1; } else if (previousTab.visible) { @@ -522,7 +521,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 } else if (previousTab == FirefoxViewHandler.tab) { elementIndex = 0; } -@@ -4872,14 +5018,14 @@ +@@ -4872,14 +5017,14 @@ } // Ensure index is within bounds. if (tab.pinned) { @@ -541,7 +540,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 if (pinned && !itemAfter?.pinned) { itemAfter = null; -@@ -4896,7 +5042,7 @@ +@@ -4896,7 +5041,7 @@ this.tabContainer._invalidateCachedTabs(); @@ -550,7 +549,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 if ( (this.isTab(itemAfter) && itemAfter.group == tabGroup) || this.isSplitViewWrapper(itemAfter) -@@ -4927,7 +5073,11 @@ +@@ -4927,7 +5072,11 @@ const tabContainer = pinned ? this.tabContainer.pinnedTabsContainer : this.tabContainer; @@ -562,7 +561,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 } if (tab.group?.collapsed) { -@@ -4942,6 +5092,7 @@ +@@ -4942,6 +5091,7 @@ if (pinned) { this._updateTabBarForPinnedTabs(); } @@ -570,7 +569,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 TabBarVisibility.update(); } -@@ -5490,6 +5641,7 @@ +@@ -5490,6 +5640,7 @@ telemetrySource, } = {} ) { @@ -578,7 +577,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 // When 'closeWindowWithLastTab' pref is enabled, closing all tabs // can be considered equivalent to closing the window. if ( -@@ -5579,6 +5731,7 @@ +@@ -5579,6 +5730,7 @@ if (lastToClose) { this.removeTab(lastToClose, aParams); } @@ -586,7 +585,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 } catch (e) { console.error(e); } -@@ -5624,6 +5777,14 @@ +@@ -5624,6 +5776,14 @@ return; } @@ -601,7 +600,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 let isVisibleTab = aTab.visible; // We have to sample the tab width now, since _beginRemoveTab might // end up modifying the DOM in such a way that aTab gets a new -@@ -5631,6 +5792,9 @@ +@@ -5631,6 +5791,9 @@ // state). let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width; let isLastTab = this.#isLastTabInWindow(aTab); @@ -611,7 +610,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 if ( !this._beginRemoveTab(aTab, { closeWindowFastpath: true, -@@ -5642,13 +5806,14 @@ +@@ -5642,13 +5805,14 @@ telemetrySource, }) ) { @@ -627,7 +626,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 let lockTabSizing = !this.tabContainer.verticalMode && !aTab.pinned && -@@ -5679,7 +5844,13 @@ +@@ -5679,7 +5843,13 @@ // We're not animating, so we can cancel the animation stopwatch. Glean.browserTabclose.timeAnim.cancel(aTab._closeTimeAnimTimerId); aTab._closeTimeAnimTimerId = null; @@ -642,7 +641,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 return; } -@@ -5813,7 +5984,7 @@ +@@ -5813,7 +5983,7 @@ closeWindowWithLastTab != null ? closeWindowWithLastTab : !window.toolbar.visible || @@ -651,7 +650,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 if (closeWindow) { // We've already called beforeunload on all the relevant tabs if we get here, -@@ -5837,6 +6008,7 @@ +@@ -5837,6 +6007,7 @@ newTab = true; } @@ -659,7 +658,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 aTab._endRemoveArgs = [closeWindow, newTab]; // swapBrowsersAndCloseOther will take care of closing the window without animation. -@@ -5877,13 +6049,7 @@ +@@ -5877,13 +6048,7 @@ aTab._mouseleave(); if (newTab) { @@ -674,7 +673,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 } else { TabBarVisibility.update(); } -@@ -6016,6 +6182,7 @@ +@@ -6016,6 +6181,7 @@ this.tabs[i]._tPos = i; } @@ -682,7 +681,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 if (!this._windowIsClosing) { // update tab close buttons state this.tabContainer._updateCloseButtons(); -@@ -6201,6 +6368,7 @@ +@@ -6201,6 +6367,7 @@ memory_after: await getTotalMemoryUsage(), time_to_unload_in_ms: timeElapsed, }); @@ -690,7 +689,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 } /** -@@ -6246,6 +6414,7 @@ +@@ -6246,6 +6413,7 @@ } let excludeTabs = new Set(aExcludeTabs); @@ -698,7 +697,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 // If this tab has a successor, it should be selectable, since // hiding or closing a tab removes that tab as a successor. -@@ -6258,15 +6427,22 @@ +@@ -6258,15 +6426,22 @@ !excludeTabs.has(aTab.owner) && Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose") ) { @@ -723,7 +722,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 let tab = this.tabContainer.findNextTab(aTab, { direction: 1, filter: _tab => remainingTabs.includes(_tab), -@@ -6280,7 +6456,7 @@ +@@ -6280,7 +6455,7 @@ } if (tab) { @@ -732,7 +731,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 } // If no qualifying visible tab was found, see if there is a tab in -@@ -6301,7 +6477,7 @@ +@@ -6301,7 +6476,7 @@ }); } @@ -741,7 +740,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 } _blurTab(aTab) { -@@ -6312,7 +6488,7 @@ +@@ -6312,7 +6487,7 @@ * @returns {boolean} * False if swapping isn't permitted, true otherwise. */ @@ -750,7 +749,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 // Do not allow transfering a private tab to a non-private window // and vice versa. if ( -@@ -6366,6 +6542,7 @@ +@@ -6366,6 +6541,7 @@ // fire the beforeunload event in the process. Close the other // window if this was its last tab. if ( @@ -758,7 +757,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 !remoteBrowser._beginRemoveTab(aOtherTab, { adoptedByTab: aOurTab, closeWindowWithLastTab: true, -@@ -6377,7 +6554,7 @@ +@@ -6377,7 +6553,7 @@ // If this is the last tab of the window, hide the window // immediately without animation before the docshell swap, to avoid // about:blank being painted. @@ -767,7 +766,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 if (closeWindow) { let win = aOtherTab.ownerGlobal; win.windowUtils.suppressAnimation(true); -@@ -6511,11 +6688,13 @@ +@@ -6511,11 +6687,13 @@ } // Finish tearing down the tab that's going away. @@ -781,7 +780,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 this.setTabTitle(aOurTab); -@@ -6717,10 +6896,10 @@ +@@ -6717,10 +6895,10 @@ SessionStore.deleteCustomTabValue(aTab, "hiddenBy"); } @@ -794,7 +793,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 aTab.selected || aTab.closing || // Tabs that are sharing the screen, microphone or camera cannot be hidden. -@@ -6780,7 +6959,8 @@ +@@ -6780,7 +6958,8 @@ * @param {object} [aOptions={}] * Key-value pairs that will be serialized into the features string. */ @@ -804,7 +803,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 if (this.tabs.length == 1) { return null; } -@@ -6797,7 +6977,7 @@ +@@ -6797,7 +6976,7 @@ // tell a new window to take the "dropped" tab let args = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray); args.appendElement(aTab.splitview ?? aTab); @@ -813,7 +812,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 private: PrivateBrowsingUtils.isWindowPrivate(window), features: Object.entries(aOptions) .map(([key, value]) => `${key}=${value}`) -@@ -6805,6 +6985,8 @@ +@@ -6805,6 +6984,8 @@ openerWindow: window, args, }); @@ -822,7 +821,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 } /** -@@ -6917,7 +7099,7 @@ +@@ -6917,7 +7098,7 @@ * `true` if element is a `` */ isTabGroup(element) { @@ -831,7 +830,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 } /** -@@ -7002,8 +7184,8 @@ +@@ -7002,8 +7183,8 @@ } // Don't allow mixing pinned and unpinned tabs. @@ -842,7 +841,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 } else { tabIndex = Math.max(tabIndex, this.pinnedTabCount); } -@@ -7049,8 +7231,8 @@ +@@ -7049,8 +7230,8 @@ this.#handleTabMove( element, () => { @@ -853,7 +852,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 neighbor = neighbor.group; } if (neighbor?.splitview) { -@@ -7061,6 +7243,12 @@ +@@ -7061,6 +7242,12 @@ return; } } @@ -866,7 +865,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 if (movingForwards && neighbor) { neighbor.after(element); -@@ -7119,23 +7307,31 @@ +@@ -7119,23 +7306,31 @@ #moveTabNextTo(element, targetElement, moveBefore = false, metricsContext) { if (this.isTabGroupLabel(targetElement)) { targetElement = targetElement.group; @@ -904,7 +903,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 } else if (!element.pinned && targetElement && targetElement.pinned) { // If the caller asks to move an unpinned element next to a pinned // tab, move the unpinned element to be the first unpinned element -@@ -7148,12 +7344,35 @@ +@@ -7148,12 +7343,35 @@ // move the tab group right before the first unpinned tab. // 4. Moving a tab group and the first unpinned tab is grouped: // move the tab group right before the first unpinned tab's tab group. @@ -941,7 +940,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 // We want to include the splitview wrapper if it's the targetElement, but // not in the case where we want to reverse tabs within the same splitview. -@@ -7162,6 +7381,7 @@ +@@ -7162,6 +7380,7 @@ } let getContainer = () => @@ -949,7 +948,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 element.pinned ? this.tabContainer.pinnedTabsContainer : this.tabContainer; -@@ -7170,11 +7390,15 @@ +@@ -7170,11 +7389,15 @@ element, () => { if (moveBefore) { @@ -966,7 +965,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 } }, metricsContext -@@ -7248,11 +7472,15 @@ +@@ -7248,11 +7471,15 @@ * @param {TabMetricsContext} [metricsContext] */ moveTabToExistingGroup(aTab, aGroup, metricsContext) { @@ -985,7 +984,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 } if (aTab.group && aTab.group.id === aGroup.id) { return; -@@ -7324,6 +7552,7 @@ +@@ -7324,6 +7551,7 @@ let state = { tabIndex: tab._tPos, @@ -993,7 +992,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 }; if (tab.visible) { state.elementIndex = tab.elementIndex; -@@ -7355,7 +7584,7 @@ +@@ -7355,7 +7583,7 @@ let changedSplitView = previousTabState.splitViewId != currentTabState.splitViewId; @@ -1002,7 +1001,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 tab.dispatchEvent( new CustomEvent("TabMove", { bubbles: true, -@@ -7402,6 +7631,10 @@ +@@ -7402,6 +7630,10 @@ moveActionCallback(); @@ -1013,7 +1012,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 // Clear tabs cache after moving nodes because the order of tabs may have // changed. this.tabContainer._invalidateCachedTabs(); -@@ -7452,7 +7685,22 @@ +@@ -7452,7 +7684,22 @@ * @returns {object} * The new tab in the current window, null if the tab couldn't be adopted. */ @@ -1037,7 +1036,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 // Swap the dropped tab with a new one we create and then close // it in the other window (making it seem to have moved between // windows). We also ensure that the tab we create to swap into has -@@ -7495,6 +7743,8 @@ +@@ -7495,6 +7742,8 @@ } params.skipLoad = true; let newTab = this.addWebTab("about:blank", params); @@ -1046,7 +1045,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 aTab.container.tabDragAndDrop.finishAnimateTabMove(); -@@ -8205,7 +8455,7 @@ +@@ -8205,7 +8454,7 @@ // preventDefault(). It will still raise the window if appropriate. return; } @@ -1055,7 +1054,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 window.focus(); aEvent.preventDefault(); } -@@ -8222,7 +8472,6 @@ +@@ -8222,7 +8471,6 @@ on_TabGroupCollapse(aEvent) { aEvent.target.tabs.forEach(tab => { @@ -1063,7 +1062,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 }); } -@@ -8556,7 +8805,9 @@ +@@ -8556,7 +8804,9 @@ let filter = this._tabFilters.get(tab); if (filter) { @@ -1073,7 +1072,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 let listener = this._tabListeners.get(tab); if (listener) { -@@ -9359,6 +9610,7 @@ +@@ -9359,6 +9609,7 @@ aWebProgress.isTopLevel ) { this.mTab.setAttribute("busy", "true"); @@ -1081,7 +1080,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 gBrowser._tabAttrModified(this.mTab, ["busy"]); this.mTab._notselectedsinceload = !this.mTab.selected; } -@@ -9439,6 +9691,7 @@ +@@ -9439,6 +9690,7 @@ // known defaults. Note we use the original URL since about:newtab // redirects to a prerendered page. const shouldRemoveFavicon = @@ -1089,7 +1088,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 !this.mBrowser.mIconURL && !ignoreBlank && !(originalLocation.spec in FAVICON_DEFAULTS); -@@ -9613,13 +9866,6 @@ +@@ -9613,13 +9865,6 @@ this.mBrowser.originalURI = aRequest.originalURI; } @@ -1103,7 +1102,7 @@ index 43fb79a3060e20f671ae6ffc26350c7abf497702..146b1559b8430773bd4ec173a8f4fe88 } let userContextId = this.mBrowser.getAttribute("usercontextid") || 0; -@@ -10507,7 +10753,8 @@ var TabContextMenu = { +@@ -10507,7 +10752,8 @@ var TabContextMenu = { ); contextUnpinSelectedTabs.hidden = !this.contextTab.pinned || !this.multiselected; diff --git a/src/browser/components/tabbrowser/content/tabgroup-js.patch b/src/browser/components/tabbrowser/content/tabgroup-js.patch index 60b9eafaea..51c447d113 100644 --- a/src/browser/components/tabbrowser/content/tabgroup-js.patch +++ b/src/browser/components/tabbrowser/content/tabgroup-js.patch @@ -1,5 +1,5 @@ diff --git a/browser/components/tabbrowser/content/tabgroup.js b/browser/components/tabbrowser/content/tabgroup.js -index d1be14df27d76a191eaff05502c030fd68c46738..e9b5e90e39b594a6119081c8d707fb4a064fea9b 100644 +index d1be14df27d76a191eaff05502c030fd68c46738..8efbcb24142acf35f63dbaebf6ca7ecb955c6817 100644 --- a/browser/components/tabbrowser/content/tabgroup.js +++ b/browser/components/tabbrowser/content/tabgroup.js @@ -14,11 +14,11 @@ @@ -117,7 +117,17 @@ index d1be14df27d76a191eaff05502c030fd68c46738..e9b5e90e39b594a6119081c8d707fb4a Services.obs.notifyObservers( this, "browser-tabgroup-removed-from-dom" -@@ -223,7 +251,10 @@ +@@ -203,6 +231,9 @@ + } + for (const mutation of mutations) { + for (const addedNode of mutation.addedNodes) { ++ if (this.isZenFolder) { ++ this.initTabWeight(addedNode); ++ } + if (gBrowser.isTab(addedNode)) { + this.#updateTabAriaHidden(addedNode); + } else if (gBrowser.isSplitViewWrapper(addedNode)) { +@@ -223,7 +254,10 @@ } }); } @@ -129,7 +139,7 @@ index d1be14df27d76a191eaff05502c030fd68c46738..e9b5e90e39b594a6119081c8d707fb4a } get color() { -@@ -317,6 +348,9 @@ +@@ -317,6 +351,9 @@ } set collapsed(val) { @@ -139,7 +149,7 @@ index d1be14df27d76a191eaff05502c030fd68c46738..e9b5e90e39b594a6119081c8d707fb4a if (!!val == this.collapsed) { return; } -@@ -403,7 +437,6 @@ +@@ -403,7 +440,6 @@ tabGroupName, }) .then(result => { @@ -147,7 +157,7 @@ index d1be14df27d76a191eaff05502c030fd68c46738..e9b5e90e39b594a6119081c8d707fb4a }); } -@@ -478,13 +511,68 @@ +@@ -478,13 +514,70 @@ * @returns {MozTabbrowserTab[]} */ get tabs() { @@ -162,9 +172,8 @@ index d1be14df27d76a191eaff05502c030fd68c46738..e9b5e90e39b594a6119081c8d707fb4a + tabsCollect.push(item); + if (gBrowser.isTabGroup(item)) { + tabsCollect.push(...item.tabs); - } - } -- return childrenArray.filter(node => node.matches("tab")); ++ } ++ } + return tabsCollect.filter(node => node.matches("tab")); + } + @@ -190,15 +199,18 @@ index d1be14df27d76a191eaff05502c030fd68c46738..e9b5e90e39b594a6119081c8d707fb4a + result.push(labelContainer); + } + result.push(...item.childGroupsAndTabs); -+ } -+ } + } + } +- return childrenArray.filter(node => node.matches("tab")); + return result; + } + + get group() { -+ if (gBrowser.isTabGroup(this.parentElement?.parentElement)) { -+ return this.parentElement.parentElement; -+ } ++ if (this.hasAttribute("split-view-group") && this._originalGroup) return this._originalGroup; ++ let group = this.parentElement?.parentElement; // FF groups and Split View ++ if (group && gBrowser.isTabGroup(group)) return this.parentElement.parentElement ++ group = this.parentElement?.parentElement?.parentElement; // Folders ++ if (group && gBrowser.isTabGroup(group)) return this.parentElement.parentElement.parentElement + return null; + } + @@ -221,7 +233,7 @@ index d1be14df27d76a191eaff05502c030fd68c46738..e9b5e90e39b594a6119081c8d707fb4a } /** -@@ -592,7 +680,6 @@ +@@ -592,7 +685,6 @@ ); } else { if (tabOrSplitView.pinned) { @@ -229,7 +241,7 @@ index d1be14df27d76a191eaff05502c030fd68c46738..e9b5e90e39b594a6119081c8d707fb4a } let tabToMove = this.ownerGlobal === tabOrSplitView.ownerGlobal -@@ -661,7 +748,7 @@ +@@ -661,7 +753,7 @@ */ on_click(event) { let isToggleElement = @@ -238,7 +250,7 @@ index d1be14df27d76a191eaff05502c030fd68c46738..e9b5e90e39b594a6119081c8d707fb4a event.target === this.#overflowCountLabel; if (isToggleElement && event.button === 0) { event.preventDefault(); -@@ -740,5 +827,6 @@ +@@ -740,5 +832,6 @@ } } diff --git a/src/zen/drag-and-drop/ZenDragAndDrop.js b/src/zen/drag-and-drop/ZenDragAndDrop.js index 0c9d9d4279..1e2f11a11f 100644 --- a/src/zen/drag-and-drop/ZenDragAndDrop.js +++ b/src/zen/drag-and-drop/ZenDragAndDrop.js @@ -635,7 +635,7 @@ } get #dragShiftableItems() { - const separator = gZenWorkspaces.pinnedTabsContainer.querySelector( + const separator = gZenWorkspaces.pinnedTabsContainerWrapper.querySelector( ".pinned-tabs-container-separator" ); // Make sure to always return the separator at the start of the array diff --git a/src/zen/folders/ZenFolder.mjs b/src/zen/folders/ZenFolder.mjs index 0d33826c67..43b4a756cb 100644 --- a/src/zen/folders/ZenFolder.mjs +++ b/src/zen/folders/ZenFolder.mjs @@ -17,8 +17,11 @@ export class nsZenFolder extends MozTabbrowserTabGroup {