fix: Adjust last boundary for was-active folder (#9775)

This commit is contained in:
octaviusz
2025-08-06 23:47:50 +03:00
committed by GitHub
parent 0937be6d2e
commit 7afc934919

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 1fcebe3962..d20a98d99a 100644 index 1fcebe3962..16f7783530 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
@@ -289,6 +289,7 @@ @@ -289,6 +289,7 @@
@@ -401,7 +401,19 @@ index 1fcebe3962..d20a98d99a 100644
translate += translate +=
this.arrowScrollbox.scrollbox[scrollDirection] - dragData.scrollPos; this.arrowScrollbox.scrollbox[scrollDirection] - dragData.scrollPos;
} else if (isPinned && this.verticalMode) { } else if (isPinned && this.verticalMode) {
@@ -2384,6 +2456,9 @@ @@ -2377,6 +2449,11 @@
// - for unpinned tabs, between the first and last unpinned tab
let firstBound = firstTab[screenAxis] - firstMovingTabScreen;
let lastBound = endEdge(lastTab) - lastMovingTabScreen;
+ // Hack if last tab is Folder with has-active
+ if (lastTab?.group?.hasAttribute("has-active")) {
+ lastBound += 40;
+ }
+
translate = Math.min(Math.max(translate, firstBound), lastBound);
for (let item of movingTabs) {
@@ -2384,6 +2461,9 @@
// 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;
} }
@@ -411,7 +423,7 @@ index 1fcebe3962..d20a98d99a 100644
item.style.transform = `${translateAxis}(${translate}px)`; item.style.transform = `${translateAxis}(${translate}px)`;
} }
@@ -2521,6 +2596,9 @@ @@ -2521,6 +2601,9 @@
break; break;
} }
let element = tabs[mid]; let element = tabs[mid];
@@ -421,7 +433,7 @@ index 1fcebe3962..d20a98d99a 100644
let elementForSize = isTabGroupLabel(element) let elementForSize = isTabGroupLabel(element)
? element.parentElement ? element.parentElement
: element; : element;
@@ -2604,7 +2682,7 @@ @@ -2604,7 +2687,7 @@
let shouldCreateGroupOnDrop; let shouldCreateGroupOnDrop;
let dropBefore; let dropBefore;
if (dropElement) { if (dropElement) {
@@ -430,7 +442,7 @@ index 1fcebe3962..d20a98d99a 100644
? dropElement.parentElement ? dropElement.parentElement
: dropElement; : dropElement;
@@ -2624,7 +2702,7 @@ @@ -2624,7 +2707,7 @@
? Services.prefs.getIntPref( ? Services.prefs.getIntPref(
"browser.tabs.dragDrop.moveOverThresholdPercent" "browser.tabs.dragDrop.moveOverThresholdPercent"
) / 100 ) / 100
@@ -439,7 +451,7 @@ index 1fcebe3962..d20a98d99a 100644
moveOverThreshold = Math.min(1, Math.max(0, moveOverThreshold)); moveOverThreshold = Math.min(1, Math.max(0, moveOverThreshold));
let shouldMoveOver = overlapPercent > moveOverThreshold; let shouldMoveOver = overlapPercent > moveOverThreshold;
if (logicalForward && shouldMoveOver) { if (logicalForward && shouldMoveOver) {
@@ -2656,23 +2734,6 @@ @@ -2656,23 +2739,6 @@
// If dragging a group over another group, don't make it look like it is // If dragging a group over another group, don't make it look like it is
// possible to drop the dragged group inside the other group. // possible to drop the dragged group inside the other group.
@@ -463,7 +475,7 @@ index 1fcebe3962..d20a98d99a 100644
// Constrain drop direction at the boundary between pinned and // Constrain drop direction at the boundary between pinned and
// unpinned tabs so that they don't mix together. // unpinned tabs so that they don't mix together.
@@ -2686,14 +2747,13 @@ @@ -2686,14 +2752,13 @@
} }
} }
@@ -483,7 +495,7 @@ index 1fcebe3962..d20a98d99a 100644
// When dragging tab(s) over an ungrouped tab, signal to the user // When dragging tab(s) over an ungrouped tab, signal to the user
// that dropping the tab(s) will create a new tab group. // that dropping the tab(s) will create a new tab group.
shouldCreateGroupOnDrop = shouldCreateGroupOnDrop =
@@ -2703,12 +2763,12 @@ @@ -2703,12 +2768,12 @@
overlapPercent > dragOverGroupingThreshold; overlapPercent > dragOverGroupingThreshold;
if (shouldCreateGroupOnDrop) { if (shouldCreateGroupOnDrop) {
@@ -502,7 +514,7 @@ index 1fcebe3962..d20a98d99a 100644
} else { } else {
this.removeAttribute("movingtab-createGroup"); this.removeAttribute("movingtab-createGroup");
document document
@@ -2735,19 +2795,14 @@ @@ -2735,19 +2800,14 @@
dropElement = dropElementGroup; dropElement = dropElementGroup;
colorCode = undefined; colorCode = undefined;
} else if (isTabGroupLabel(dropElement)) { } else if (isTabGroupLabel(dropElement)) {
@@ -530,7 +542,7 @@ index 1fcebe3962..d20a98d99a 100644
} }
this.#setDragOverGroupColor(colorCode); this.#setDragOverGroupColor(colorCode);
this.toggleAttribute("movingtab-ungroup", !colorCode); this.toggleAttribute("movingtab-ungroup", !colorCode);
@@ -2769,15 +2824,24 @@ @@ -2769,15 +2829,24 @@
// 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) {
@@ -556,7 +568,7 @@ index 1fcebe3962..d20a98d99a 100644
} }
item.style.transform = transform; item.style.transform = transform;
} }
@@ -2830,12 +2894,14 @@ @@ -2830,12 +2899,14 @@
); );
} }
@@ -573,7 +585,7 @@ index 1fcebe3962..d20a98d99a 100644
for (let item of this.ariaFocusableItems) { for (let item of this.ariaFocusableItems) {
if (isTabGroupLabel(item)) { if (isTabGroupLabel(item)) {
@@ -2843,6 +2909,18 @@ @@ -2843,6 +2914,18 @@
item = item.parentElement; item = item.parentElement;
} }
item.style.transform = ""; item.style.transform = "";
@@ -592,7 +604,7 @@ index 1fcebe3962..d20a98d99a 100644
item.removeAttribute("dragover-createGroup"); item.removeAttribute("dragover-createGroup");
} }
this.removeAttribute("movingtab-createGroup"); this.removeAttribute("movingtab-createGroup");
@@ -2889,7 +2967,7 @@ @@ -2889,7 +2972,7 @@
let postTransitionCleanup = () => { let postTransitionCleanup = () => {
movingTab._moveTogetherSelectedTabsData.animate = false; movingTab._moveTogetherSelectedTabsData.animate = false;
}; };
@@ -601,7 +613,7 @@ index 1fcebe3962..d20a98d99a 100644
postTransitionCleanup(); postTransitionCleanup();
} else { } else {
let onTransitionEnd = transitionendEvent => { let onTransitionEnd = transitionendEvent => {
@@ -3062,7 +3140,7 @@ @@ -3062,7 +3145,7 @@
} }
_notifyBackgroundTab(aTab) { _notifyBackgroundTab(aTab) {
@@ -610,7 +622,7 @@ index 1fcebe3962..d20a98d99a 100644
return; return;
} }
@@ -3171,7 +3249,10 @@ @@ -3171,7 +3254,10 @@
#getDragTarget(event, { ignoreSides = false } = {}) { #getDragTarget(event, { ignoreSides = false } = {}) {
let { target } = event; let { target } = event;
while (target) { while (target) {
@@ -622,7 +634,7 @@ index 1fcebe3962..d20a98d99a 100644
break; break;
} }
target = target.parentNode; target = target.parentNode;
@@ -3188,6 +3269,9 @@ @@ -3188,6 +3274,9 @@
return null; return null;
} }
} }