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 8bd69d35d1..2ae550c08c 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 e4266a159a0d5c42cc294602d00b8f66131f35d5..88c321f05dabd948d06e155f6e0474669fc15c20 100644 +index e4266a159a0d5c42cc294602d00b8f66131f35d5..b6c96aa0c2b8889ce9d3fe25f10f759eff24b7ff 100644 --- a/browser/components/tabbrowser/content/tab.js +++ b/browser/components/tabbrowser/content/tab.js @@ -21,6 +21,7 @@ @@ -52,7 +52,7 @@ index e4266a159a0d5c42cc294602d00b8f66131f35d5..88c321f05dabd948d06e155f6e047466 return; } -@@ -225,11 +228,23 @@ +@@ -225,11 +228,19 @@ } get visible() { @@ -64,15 +64,11 @@ index e4266a159a0d5c42cc294602d00b8f66131f35d5..88c321f05dabd948d06e155f6e047466 + if (!this.isOpen || this.hidden || this.hasAttribute("zen-empty-tab")) { + return false; + } -+ // 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) { + return false; @@ -81,7 +77,7 @@ index e4266a159a0d5c42cc294602d00b8f66131f35d5..88c321f05dabd948d06e155f6e047466 } get hidden() { -@@ -308,7 +323,7 @@ +@@ -308,7 +319,7 @@ return false; } @@ -90,7 +86,7 @@ index e4266a159a0d5c42cc294602d00b8f66131f35d5..88c321f05dabd948d06e155f6e047466 } get lastAccessed() { -@@ -393,7 +408,18 @@ +@@ -393,7 +404,24 @@ } get group() { @@ -98,8 +94,14 @@ index e4266a159a0d5c42cc294602d00b8f66131f35d5..88c321f05dabd948d06e155f6e047466 + 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; @@ -110,7 +112,7 @@ index e4266a159a0d5c42cc294602d00b8f66131f35d5..88c321f05dabd948d06e155f6e047466 } get splitview() { -@@ -475,6 +501,10 @@ +@@ -475,6 +503,10 @@ } } @@ -121,7 +123,7 @@ index e4266a159a0d5c42cc294602d00b8f66131f35d5..88c321f05dabd948d06e155f6e047466 // 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 +534,7 @@ +@@ -504,6 +536,7 @@ if (!this.contains(event.relatedTarget)) { this._mouseleave(); } @@ -129,7 +131,7 @@ index e4266a159a0d5c42cc294602d00b8f66131f35d5..88c321f05dabd948d06e155f6e047466 } on_dragstart(event) { -@@ -538,6 +569,8 @@ +@@ -538,6 +571,8 @@ this.style.MozUserFocus = "ignore"; } else if ( event.target.classList.contains("tab-close-button") || @@ -138,7 +140,7 @@ index e4266a159a0d5c42cc294602d00b8f66131f35d5..88c321f05dabd948d06e155f6e047466 event.target.classList.contains("tab-icon-overlay") || event.target.classList.contains("tab-audio-button") ) { -@@ -592,16 +625,21 @@ +@@ -592,16 +627,21 @@ this.style.MozUserFocus = ""; } @@ -161,7 +163,7 @@ index e4266a159a0d5c42cc294602d00b8f66131f35d5..88c321f05dabd948d06e155f6e047466 gBrowser.multiSelectedTabsCount > 0 && !event.target.classList.contains("tab-close-button") && !event.target.classList.contains("tab-icon-overlay") && -@@ -613,8 +651,9 @@ +@@ -613,8 +653,9 @@ } if ( @@ -173,7 +175,7 @@ index e4266a159a0d5c42cc294602d00b8f66131f35d5..88c321f05dabd948d06e155f6e047466 ) { if (this.activeMediaBlocked) { if (this.multiselected) { -@@ -632,7 +671,7 @@ +@@ -632,7 +673,7 @@ return; } @@ -182,7 +184,7 @@ index e4266a159a0d5c42cc294602d00b8f66131f35d5..88c321f05dabd948d06e155f6e047466 if (this.multiselected) { gBrowser.removeMultiSelectedTabs( lazy.TabMetrics.userTriggeredContext( -@@ -652,6 +691,14 @@ +@@ -652,6 +693,14 @@ // (see tabbrowser-tabs 'click' handler). gBrowser.tabContainer._blockDblClick = true; } @@ -197,7 +199,7 @@ index e4266a159a0d5c42cc294602d00b8f66131f35d5..88c321f05dabd948d06e155f6e047466 } on_dblclick(event) { -@@ -675,6 +722,8 @@ +@@ -675,6 +724,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 f3d858c99c..9435c0aadc 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 d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81a655e998 100644 +index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..2419eca89e5adbc65e93bd5cbf5d6f2f0d4a710a 100644 --- a/browser/components/tabbrowser/content/tabbrowser.js +++ b/browser/components/tabbrowser/content/tabbrowser.js @@ -413,6 +413,7 @@ @@ -445,19 +445,32 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 let { groupId } = tabData; const tabGroup = tabGroupWorkingData.get(groupId); // if a tab refers to a tab group we don't know, skip any group -@@ -4471,7 +4599,10 @@ - tabGroup.stateData.id, - tabGroup.stateData.color, - tabGroup.stateData.collapsed, +@@ -4467,13 +4595,17 @@ + // 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) { +- 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); +- ); +- tabsFragment.appendChild(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 ++ ); ++ tabsFragment.appendChild(tabGroup.node); ++ } } -@@ -4526,9 +4657,23 @@ + } + } else { +@@ -4526,9 +4658,23 @@ // to remove the old selected tab. if (tabToSelect) { let leftoverTab = this.selectedTab; @@ -481,7 +494,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 if (tabs.length > 1 || !tabs[0].selected) { this._updateTabsAfterInsert(); -@@ -4719,11 +4864,14 @@ +@@ -4719,11 +4865,14 @@ if (ownerTab) { tab.owner = ownerTab; } @@ -497,7 +510,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 if ( !bulkOrderedOpen && ((openerTab && -@@ -4735,7 +4883,7 @@ +@@ -4735,7 +4884,7 @@ let lastRelatedTab = openerTab && this._lastRelatedTabMap.get(openerTab); let previousTab = lastRelatedTab || openerTab || this.selectedTab; @@ -506,7 +519,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 tabGroup = previousTab.group; } if ( -@@ -4751,7 +4899,7 @@ +@@ -4751,7 +4900,7 @@ previousTab.splitview ) + 1; } else if (previousTab.visible) { @@ -515,7 +528,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 } else if (previousTab == FirefoxViewHandler.tab) { elementIndex = 0; } -@@ -4779,14 +4927,14 @@ +@@ -4779,14 +4928,14 @@ } // Ensure index is within bounds. if (tab.pinned) { @@ -534,7 +547,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 if (pinned && !itemAfter?.pinned) { itemAfter = null; -@@ -4803,7 +4951,7 @@ +@@ -4803,7 +4952,7 @@ this.tabContainer._invalidateCachedTabs(); @@ -543,7 +556,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 if ( (this.isTab(itemAfter) && itemAfter.group == tabGroup) || this.isSplitViewWrapper(itemAfter) -@@ -4834,7 +4982,11 @@ +@@ -4834,7 +4983,11 @@ const tabContainer = pinned ? this.tabContainer.pinnedTabsContainer : this.tabContainer; @@ -555,7 +568,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 } if (tab.group?.collapsed) { -@@ -4849,6 +5001,7 @@ +@@ -4849,6 +5002,7 @@ if (pinned) { this._updateTabBarForPinnedTabs(); } @@ -563,7 +576,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 TabBarVisibility.update(); } -@@ -5397,6 +5550,7 @@ +@@ -5397,6 +5551,7 @@ telemetrySource, } = {} ) { @@ -571,7 +584,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 // When 'closeWindowWithLastTab' pref is enabled, closing all tabs // can be considered equivalent to closing the window. if ( -@@ -5486,6 +5640,7 @@ +@@ -5486,6 +5641,7 @@ if (lastToClose) { this.removeTab(lastToClose, aParams); } @@ -579,7 +592,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 } catch (e) { console.error(e); } -@@ -5531,6 +5686,13 @@ +@@ -5531,6 +5687,13 @@ return; } @@ -593,7 +606,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 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 -@@ -5538,6 +5700,9 @@ +@@ -5538,6 +5701,9 @@ // state). let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width; let isLastTab = this.#isLastTabInWindow(aTab); @@ -603,7 +616,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 if ( !this._beginRemoveTab(aTab, { closeWindowFastpath: true, -@@ -5549,13 +5714,14 @@ +@@ -5549,13 +5715,14 @@ telemetrySource, }) ) { @@ -619,7 +632,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 let lockTabSizing = !this.tabContainer.verticalMode && !aTab.pinned && -@@ -5586,7 +5752,13 @@ +@@ -5586,7 +5753,13 @@ // We're not animating, so we can cancel the animation stopwatch. Glean.browserTabclose.timeAnim.cancel(aTab._closeTimeAnimTimerId); aTab._closeTimeAnimTimerId = null; @@ -634,7 +647,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 return; } -@@ -5720,7 +5892,7 @@ +@@ -5720,7 +5893,7 @@ closeWindowWithLastTab != null ? closeWindowWithLastTab : !window.toolbar.visible || @@ -643,7 +656,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 if (closeWindow) { // We've already called beforeunload on all the relevant tabs if we get here, -@@ -5744,6 +5916,7 @@ +@@ -5744,6 +5917,7 @@ newTab = true; } @@ -651,7 +664,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 aTab._endRemoveArgs = [closeWindow, newTab]; // swapBrowsersAndCloseOther will take care of closing the window without animation. -@@ -5784,13 +5957,7 @@ +@@ -5784,13 +5958,7 @@ aTab._mouseleave(); if (newTab) { @@ -666,7 +679,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 } else { TabBarVisibility.update(); } -@@ -5923,6 +6090,7 @@ +@@ -5923,6 +6091,7 @@ this.tabs[i]._tPos = i; } @@ -674,7 +687,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 if (!this._windowIsClosing) { // update tab close buttons state this.tabContainer._updateCloseButtons(); -@@ -6153,6 +6321,7 @@ +@@ -6153,6 +6322,7 @@ } let excludeTabs = new Set(aExcludeTabs); @@ -682,7 +695,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 // If this tab has a successor, it should be selectable, since // hiding or closing a tab removes that tab as a successor. -@@ -6165,15 +6334,22 @@ +@@ -6165,15 +6335,22 @@ !excludeTabs.has(aTab.owner) && Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose") ) { @@ -707,7 +720,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 let tab = this.tabContainer.findNextTab(aTab, { direction: 1, filter: _tab => remainingTabs.includes(_tab), -@@ -6187,7 +6363,7 @@ +@@ -6187,7 +6364,7 @@ } if (tab) { @@ -716,7 +729,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 } // If no qualifying visible tab was found, see if there is a tab in -@@ -6208,7 +6384,7 @@ +@@ -6208,7 +6385,7 @@ }); } @@ -725,7 +738,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 } _blurTab(aTab) { -@@ -6219,7 +6395,7 @@ +@@ -6219,7 +6396,7 @@ * @returns {boolean} * False if swapping isn't permitted, true otherwise. */ @@ -734,7 +747,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 // Do not allow transfering a private tab to a non-private window // and vice versa. if ( -@@ -6273,6 +6449,7 @@ +@@ -6273,6 +6450,7 @@ // fire the beforeunload event in the process. Close the other // window if this was its last tab. if ( @@ -742,7 +755,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 !remoteBrowser._beginRemoveTab(aOtherTab, { adoptedByTab: aOurTab, closeWindowWithLastTab: true, -@@ -6284,7 +6461,7 @@ +@@ -6284,7 +6462,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. @@ -751,7 +764,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 if (closeWindow) { let win = aOtherTab.ownerGlobal; win.windowUtils.suppressAnimation(true); -@@ -6412,11 +6589,13 @@ +@@ -6412,11 +6590,13 @@ } // Finish tearing down the tab that's going away. @@ -765,7 +778,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 this.setTabTitle(aOurTab); -@@ -6618,10 +6797,10 @@ +@@ -6618,10 +6798,10 @@ SessionStore.deleteCustomTabValue(aTab, "hiddenBy"); } @@ -778,7 +791,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 aTab.selected || aTab.closing || // Tabs that are sharing the screen, microphone or camera cannot be hidden. -@@ -6681,7 +6860,8 @@ +@@ -6681,7 +6861,8 @@ * @param {object} [aOptions={}] * Key-value pairs that will be serialized into the features string. */ @@ -788,7 +801,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 if (this.tabs.length == 1) { return null; } -@@ -6698,7 +6878,7 @@ +@@ -6698,7 +6879,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); @@ -797,7 +810,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 private: PrivateBrowsingUtils.isWindowPrivate(window), features: Object.entries(aOptions) .map(([key, value]) => `${key}=${value}`) -@@ -6706,6 +6886,8 @@ +@@ -6706,6 +6887,8 @@ openerWindow: window, args, }); @@ -806,7 +819,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 } /** -@@ -6818,7 +7000,7 @@ +@@ -6818,7 +7001,7 @@ * `true` if element is a `` */ isTabGroup(element) { @@ -815,7 +828,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 } /** -@@ -6903,8 +7085,8 @@ +@@ -6903,8 +7086,8 @@ } // Don't allow mixing pinned and unpinned tabs. @@ -826,7 +839,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 } else { tabIndex = Math.max(tabIndex, this.pinnedTabCount); } -@@ -6933,13 +7115,19 @@ +@@ -6933,13 +7116,19 @@ this.#handleTabMove( element, () => { @@ -848,7 +861,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 let useAfter = false; if (this.isTab(element)) { useAfter = neighbor && tabIndex > element._tPos; -@@ -7004,23 +7192,31 @@ +@@ -7004,23 +7193,31 @@ #moveTabNextTo(element, targetElement, moveBefore = false, metricsContext) { if (this.isTabGroupLabel(targetElement)) { targetElement = targetElement.group; @@ -886,7 +899,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 } 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 -@@ -7033,12 +7229,35 @@ +@@ -7033,12 +7230,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. @@ -923,7 +936,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 // 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. -@@ -7047,6 +7266,7 @@ +@@ -7047,6 +7267,7 @@ } let getContainer = () => @@ -931,7 +944,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 element.pinned ? this.tabContainer.pinnedTabsContainer : this.tabContainer; -@@ -7055,11 +7275,15 @@ +@@ -7055,11 +7276,15 @@ element, () => { if (moveBefore) { @@ -948,7 +961,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 } }, metricsContext -@@ -7133,10 +7357,10 @@ +@@ -7133,10 +7358,10 @@ * @param {TabMetricsContext} [metricsContext] */ moveTabToExistingGroup(aTab, aGroup, metricsContext) { @@ -961,7 +974,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 return; } if (aTab.group && aTab.group.id === aGroup.id) { -@@ -7209,6 +7433,7 @@ +@@ -7209,6 +7434,7 @@ let state = { tabIndex: tab._tPos, @@ -969,7 +982,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 }; if (tab.visible) { state.elementIndex = tab.elementIndex; -@@ -7240,7 +7465,7 @@ +@@ -7240,7 +7466,7 @@ let changedSplitView = previousTabState.splitViewId != currentTabState.splitViewId; @@ -978,7 +991,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 tab.dispatchEvent( new CustomEvent("TabMove", { bubbles: true, -@@ -7281,6 +7506,10 @@ +@@ -7281,6 +7507,10 @@ moveActionCallback(); @@ -989,7 +1002,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 // Clear tabs cache after moving nodes because the order of tabs may have // changed. this.tabContainer._invalidateCachedTabs(); -@@ -7331,7 +7560,22 @@ +@@ -7331,7 +7561,22 @@ * @returns {object} * The new tab in the current window, null if the tab couldn't be adopted. */ @@ -1013,7 +1026,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 // 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 -@@ -7374,6 +7618,8 @@ +@@ -7374,6 +7619,8 @@ } params.skipLoad = true; let newTab = this.addWebTab("about:blank", params); @@ -1022,7 +1035,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 aTab.container.tabDragAndDrop.finishAnimateTabMove(); -@@ -8076,7 +8322,7 @@ +@@ -8076,7 +8323,7 @@ // preventDefault(). It will still raise the window if appropriate. return; } @@ -1031,7 +1044,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 window.focus(); aEvent.preventDefault(); } -@@ -8093,7 +8339,6 @@ +@@ -8093,7 +8340,6 @@ on_TabGroupCollapse(aEvent) { aEvent.target.tabs.forEach(tab => { @@ -1039,7 +1052,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 }); } -@@ -8427,7 +8672,9 @@ +@@ -8427,7 +8673,9 @@ let filter = this._tabFilters.get(tab); if (filter) { @@ -1049,7 +1062,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 let listener = this._tabListeners.get(tab); if (listener) { -@@ -9233,6 +9480,7 @@ +@@ -9233,6 +9481,7 @@ aWebProgress.isTopLevel ) { this.mTab.setAttribute("busy", "true"); @@ -1057,7 +1070,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 gBrowser._tabAttrModified(this.mTab, ["busy"]); this.mTab._notselectedsinceload = !this.mTab.selected; } -@@ -9313,6 +9561,7 @@ +@@ -9313,6 +9562,7 @@ // known defaults. Note we use the original URL since about:newtab // redirects to a prerendered page. const shouldRemoveFavicon = @@ -1065,7 +1078,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 !this.mBrowser.mIconURL && !ignoreBlank && !(originalLocation.spec in FAVICON_DEFAULTS); -@@ -9487,13 +9736,6 @@ +@@ -9487,13 +9737,6 @@ this.mBrowser.originalURI = aRequest.originalURI; } @@ -1079,7 +1092,7 @@ index d88bc0e5570c8fd428a84fdf5af0f6bab1e2a636..d9491b680bf8839038dadc0c6ee52f81 } let userContextId = this.mBrowser.getAttribute("usercontextid") || 0; -@@ -10379,7 +10621,7 @@ var TabContextMenu = { +@@ -10379,7 +10622,7 @@ 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 4517ac2610..7ecc09c0a1 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 3ca119e8dc72fac652c98505211864483d98add2..026b524be51170882e788a701095b938d6923f3e 100644 +index 3ca119e8dc72fac652c98505211864483d98add2..ddb0df1db0c822c2222ae44c28045f8831f0c7d4 100644 --- a/browser/components/tabbrowser/content/tabgroup.js +++ b/browser/components/tabbrowser/content/tabgroup.js @@ -14,11 +14,11 @@ @@ -111,7 +111,17 @@ index 3ca119e8dc72fac652c98505211864483d98add2..026b524be51170882e788a701095b938 Services.obs.notifyObservers( this, "browser-tabgroup-removed-from-dom" -@@ -223,7 +248,10 @@ +@@ -203,6 +228,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 +251,10 @@ } }); } @@ -123,7 +133,7 @@ index 3ca119e8dc72fac652c98505211864483d98add2..026b524be51170882e788a701095b938 } get color() { -@@ -317,6 +345,9 @@ +@@ -317,6 +348,9 @@ } set collapsed(val) { @@ -133,7 +143,7 @@ index 3ca119e8dc72fac652c98505211864483d98add2..026b524be51170882e788a701095b938 if (!!val == this.collapsed) { return; } -@@ -403,7 +434,6 @@ +@@ -403,7 +437,6 @@ tabGroupName, }) .then(result => { @@ -141,7 +151,7 @@ index 3ca119e8dc72fac652c98505211864483d98add2..026b524be51170882e788a701095b938 }); } -@@ -478,13 +508,65 @@ +@@ -478,13 +511,67 @@ * @returns {MozTabbrowserTab[]} */ get tabs() { @@ -156,8 +166,9 @@ index 3ca119e8dc72fac652c98505211864483d98add2..026b524be51170882e788a701095b938 + 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")); + } + @@ -183,16 +194,17 @@ index 3ca119e8dc72fac652c98505211864483d98add2..026b524be51170882e788a701095b938 + 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; + } + @@ -212,7 +224,7 @@ index 3ca119e8dc72fac652c98505211864483d98add2..026b524be51170882e788a701095b938 } /** -@@ -592,7 +674,6 @@ +@@ -592,7 +679,6 @@ ); } else { if (tabOrSplitView.pinned) { @@ -220,7 +232,7 @@ index 3ca119e8dc72fac652c98505211864483d98add2..026b524be51170882e788a701095b938 } let tabToMove = this.ownerGlobal === tabOrSplitView.ownerGlobal -@@ -661,7 +742,7 @@ +@@ -661,7 +747,7 @@ */ on_click(event) { let isToggleElement = @@ -229,7 +241,7 @@ index 3ca119e8dc72fac652c98505211864483d98add2..026b524be51170882e788a701095b938 event.target === this.#overflowCountLabel; if (isToggleElement && event.button === 0) { event.preventDefault(); -@@ -740,5 +821,6 @@ +@@ -740,5 +826,6 @@ } } diff --git a/src/zen/drag-and-drop/ZenDragAndDrop.js b/src/zen/drag-and-drop/ZenDragAndDrop.js index 0e87be0be6..c6cc2dabec 100644 --- a/src/zen/drag-and-drop/ZenDragAndDrop.js +++ b/src/zen/drag-and-drop/ZenDragAndDrop.js @@ -628,7 +628,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 {