Small fixes to split view groups

This commit is contained in:
mr. M 2025-03-29 20:39:42 +01:00
parent 0c6fe6f77c
commit 00d8f60a02
No known key found for this signature in database
GPG key ID: CBD57A2AEDBDA1FB
3 changed files with 28 additions and 17 deletions

View file

@ -225,6 +225,9 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
this._hasAnimated = true; this._hasAnimated = true;
for (const tab of gBrowser.tabs) { for (const tab of gBrowser.tabs) {
tab.style.removeProperty('transform'); tab.style.removeProperty('transform');
if (tab.group) {
tab.group.style.removeProperty('transform');
}
} }
// Add a min width to all the browser elements to prevent them from resizing // Add a min width to all the browser elements to prevent them from resizing
for (const browser of gBrowser.browsers) { for (const browser of gBrowser.browsers) {
@ -998,6 +1001,10 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
} }
} }
} }
if (this._sessionRestoring) {
return;
}
this.activateSplitView(splitData); this.activateSplitView(splitData);
} }

View file

@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
index 5f406ea5d09273c9b70b84eee24c6267f88692f8..25076e5fdbe5a60cc0f35640652ba8525a55b093 100644 index 5f406ea5d09273c9b70b84eee24c6267f88692f8..82926278b2f71b8251b06bde6f62bcdc885cb760 100644
--- a/browser/components/tabbrowser/content/tabbrowser.js --- a/browser/components/tabbrowser/content/tabbrowser.js
+++ b/browser/components/tabbrowser/content/tabbrowser.js +++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -424,11 +424,67 @@ @@ -424,11 +424,67 @@
@ -22,7 +22,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..25076e5fdbe5a60cc0f35640652ba852
+ get _numVisiblePinTabsWithoutCollapsed() { + get _numVisiblePinTabsWithoutCollapsed() {
+ let i = 0; + let i = 0;
+ for (let item of this.tabContainer.ariaFocusableItems) { + for (let item of this.tabContainer.ariaFocusableItems) {
+ if (!!item?.classList?.contains("tab-group-label")) { + if (!!item?.classList?.contains("tab-group-label") && item.closest("tab-group").pinned) {
+ i += 1; + i += 1;
+ continue; + continue;
+ } + }

View file

@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
index 0fbdbf3aefc467880e6b0bae2615cb145735cb0f..40593b305688d24a0b702714a91af551c7f833f9 100644 index 0fbdbf3aefc467880e6b0bae2615cb145735cb0f..bf956639f7d17d6d652f3b2d6cb174904b5b5da9 100644
--- a/browser/components/tabbrowser/content/tabs.js --- a/browser/components/tabbrowser/content/tabs.js
+++ b/browser/components/tabbrowser/content/tabs.js +++ b/browser/components/tabbrowser/content/tabs.js
@@ -93,7 +93,7 @@ @@ -93,7 +93,7 @@
@ -448,7 +448,17 @@ index 0fbdbf3aefc467880e6b0bae2615cb145735cb0f..40593b305688d24a0b702714a91af551
) { ) {
return this.#rtlMode ? -shiftSize : shiftSize; return this.#rtlMode ? -shiftSize : shiftSize;
} }
@@ -2507,6 +2553,10 @@ @@ -2485,6 +2531,9 @@
break;
}
let element = tabs[mid];
+ if (element?.group?.hasAttribute("split-view-group")) {
+ element = element.group.labelElement;
+ }
let elementForSize = isTabGroupLabel(element)
? element.parentElement
: element;
@@ -2507,6 +2556,10 @@
if (!dropElement) { if (!dropElement) {
dropElement = this.ariaFocusableItems[oldDropElementIndex]; dropElement = this.ariaFocusableItems[oldDropElementIndex];
} }
@ -459,7 +469,7 @@ index 0fbdbf3aefc467880e6b0bae2615cb145735cb0f..40593b305688d24a0b702714a91af551
let newDropElementIndex = dropElement let newDropElementIndex = dropElement
? dropElement.elementIndex ? dropElement.elementIndex
: oldDropElementIndex; : oldDropElementIndex;
@@ -2566,12 +2616,12 @@ @@ -2566,12 +2619,12 @@
} }
} }
@ -474,7 +484,7 @@ index 0fbdbf3aefc467880e6b0bae2615cb145735cb0f..40593b305688d24a0b702714a91af551
dropElement != draggedTab && dropElement != draggedTab &&
isTab(dropElement) && isTab(dropElement) &&
!dropElement?.group && !dropElement?.group &&
@@ -2639,7 +2689,7 @@ @@ -2639,7 +2692,7 @@
// Shift background tabs to leave a gap where the dragged tab // Shift background tabs to leave a gap where the dragged tab
// would currently be dropped. // would currently be dropped.
for (let item of tabs) { for (let item of tabs) {
@ -483,7 +493,7 @@ index 0fbdbf3aefc467880e6b0bae2615cb145735cb0f..40593b305688d24a0b702714a91af551
continue; continue;
} }
@@ -2648,8 +2698,15 @@ @@ -2648,6 +2701,9 @@
if (isTabGroupLabel(item)) { if (isTabGroupLabel(item)) {
// Shift the `.tab-group-label-container` to shift the label element. // Shift the `.tab-group-label-container` to shift the label element.
item = item.parentElement; item = item.parentElement;
@ -491,15 +501,9 @@ index 0fbdbf3aefc467880e6b0bae2615cb145735cb0f..40593b305688d24a0b702714a91af551
+ item = item.parentElement; + item = item.parentElement;
+ } + }
} }
+ if (item.group?.hasAttribute("split-view-group")) {
+ item.group.style.transform = transform;
+ } else {
item.style.transform = transform; item.style.transform = transform;
+ }
} }
} @@ -2697,8 +2753,9 @@
@@ -2697,8 +2754,9 @@
); );
} }
@ -511,7 +515,7 @@ index 0fbdbf3aefc467880e6b0bae2615cb145735cb0f..40593b305688d24a0b702714a91af551
return; return;
} }
@@ -2711,6 +2769,12 @@ @@ -2711,6 +2768,12 @@
item = item.parentElement; item = item.parentElement;
} }
item.style.transform = ""; item.style.transform = "";
@ -524,7 +528,7 @@ index 0fbdbf3aefc467880e6b0bae2615cb145735cb0f..40593b305688d24a0b702714a91af551
item.removeAttribute("dragover-createGroup"); item.removeAttribute("dragover-createGroup");
} }
this.removeAttribute("movingtab-createGroup"); this.removeAttribute("movingtab-createGroup");
@@ -2754,7 +2818,7 @@ @@ -2754,7 +2817,7 @@
let postTransitionCleanup = () => { let postTransitionCleanup = () => {
movingTab._moveTogetherSelectedTabsData.animate = false; movingTab._moveTogetherSelectedTabsData.animate = false;
}; };
@ -533,7 +537,7 @@ index 0fbdbf3aefc467880e6b0bae2615cb145735cb0f..40593b305688d24a0b702714a91af551
postTransitionCleanup(); postTransitionCleanup();
} else { } else {
let onTransitionEnd = transitionendEvent => { let onTransitionEnd = transitionendEvent => {
@@ -2924,7 +2988,7 @@ @@ -2924,7 +2987,7 @@
} }
_notifyBackgroundTab(aTab) { _notifyBackgroundTab(aTab) {