fix: Fixed expanding glance while on a split view, b=no-bug, c=no-component

This commit is contained in:
Mr. M
2025-07-27 08:35:07 +02:00
parent 1518ea71f4
commit 5787c7d664

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
index 96fd8acdc09cc4c9649d1ed7503c2a0bde536613..87fb109037d13183e76184201de600a92b6a07d6 100644
index 96fd8acdc09cc4c9649d1ed7503c2a0bde536613..1033da146ef5a3463f9fb15168060424b64a64ab 100644
--- a/browser/components/tabbrowser/content/tabbrowser.js
+++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -422,15 +422,49 @@
@@ -364,10 +364,10 @@ index 96fd8acdc09cc4c9649d1ed7503c2a0bde536613..87fb109037d13183e76184201de600a9
+ gZenWorkspaces._initialTab._shouldRemove = true;
+ }
+ }
}
+ }
+ else {
+ gZenWorkspaces._tabToRemoveForEmpty = this.selectedTab;
+ }
}
+ this._hasAlreadyInitializedZenSessionStore = true;
if (tabs.length > 1 || !tabs[0].selected) {
@@ -612,10 +612,13 @@ index 96fd8acdc09cc4c9649d1ed7503c2a0bde536613..87fb109037d13183e76184201de600a9
element = element.group;
if (targetElement?.group) {
targetElement = targetElement.group;
@@ -6130,8 +6260,12 @@
@@ -6130,8 +6260,15 @@
}
// Don't allow mixing pinned and unpinned tabs.
+ if (targetElement.group?.hasAttribute("split-view-group")) {
+ targetElement = targetElement.group;
+ }
+ targetElement = gZenGlanceManager.getTabOrGlanceParent(targetElement);
+ if (element.hasAttribute('zen-essential') && !targetElement?.hasAttribute('zen-essential')) {
+ targetElement = this.tabsWithoutGlance[this._numZenEssentials - 1];
@@ -626,7 +629,7 @@ index 96fd8acdc09cc4c9649d1ed7503c2a0bde536613..87fb109037d13183e76184201de600a9
moveBefore = false;
} else if (!element.pinned && targetElement && targetElement.pinned) {
// If the caller asks to move an unpinned element next to a pinned
@@ -6145,7 +6279,7 @@
@@ -6145,7 +6282,7 @@
// 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.
@@ -635,7 +638,7 @@ index 96fd8acdc09cc4c9649d1ed7503c2a0bde536613..87fb109037d13183e76184201de600a9
if (targetElement.group) {
targetElement = targetElement.group;
}
@@ -6153,6 +6287,7 @@
@@ -6153,6 +6290,7 @@
}
let getContainer = () =>
@@ -643,7 +646,7 @@ index 96fd8acdc09cc4c9649d1ed7503c2a0bde536613..87fb109037d13183e76184201de600a9
element.pinned
? this.tabContainer.pinnedTabsContainer
: this.tabContainer;
@@ -6210,7 +6345,7 @@
@@ -6210,7 +6348,7 @@
if (!this.isTab(aTab)) {
throw new Error("Can only move a tab into a tab group");
}
@@ -652,7 +655,7 @@ index 96fd8acdc09cc4c9649d1ed7503c2a0bde536613..87fb109037d13183e76184201de600a9
return;
}
if (aTab.group && aTab.group.id === aGroup.id) {
@@ -6304,6 +6439,10 @@
@@ -6304,6 +6442,10 @@
moveActionCallback();
@@ -663,7 +666,7 @@ index 96fd8acdc09cc4c9649d1ed7503c2a0bde536613..87fb109037d13183e76184201de600a9
// Clear tabs cache after moving nodes because the order of tabs may have
// changed.
this.tabContainer._invalidateCachedTabs();
@@ -7198,7 +7337,7 @@
@@ -7198,7 +7340,7 @@
// preventDefault(). It will still raise the window if appropriate.
break;
}
@@ -672,7 +675,7 @@ index 96fd8acdc09cc4c9649d1ed7503c2a0bde536613..87fb109037d13183e76184201de600a9
window.focus();
aEvent.preventDefault();
break;
@@ -8143,6 +8282,7 @@
@@ -8143,6 +8285,7 @@
aWebProgress.isTopLevel
) {
this.mTab.setAttribute("busy", "true");
@@ -680,7 +683,7 @@ index 96fd8acdc09cc4c9649d1ed7503c2a0bde536613..87fb109037d13183e76184201de600a9
gBrowser._tabAttrModified(this.mTab, ["busy"]);
this.mTab._notselectedsinceload = !this.mTab.selected;
}
@@ -9108,7 +9248,7 @@ var TabContextMenu = {
@@ -9108,7 +9251,7 @@ var TabContextMenu = {
);
contextUnpinSelectedTabs.hidden =
!this.contextTab.pinned || !this.multiselected;
@@ -689,7 +692,7 @@ index 96fd8acdc09cc4c9649d1ed7503c2a0bde536613..87fb109037d13183e76184201de600a9
// Move Tab items
let contextMoveTabOptions = document.getElementById(
"context_moveTabOptions"
@@ -9384,6 +9524,7 @@ var TabContextMenu = {
@@ -9384,6 +9527,7 @@ var TabContextMenu = {
)
);
} else {