From 7afc9349190cf3ee757fe8c96d3742c9badbfb0a Mon Sep 17 00:00:00 2001 From: octaviusz <50177704+octaviusz@users.noreply.github.com> Date: Wed, 6 Aug 2025 23:47:50 +0300 Subject: [PATCH] fix: Adjust last boundary for was-active folder (#9775) --- .../tabbrowser/content/tabs-js.patch | 44 ++++++++++++------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/src/browser/components/tabbrowser/content/tabs-js.patch b/src/browser/components/tabbrowser/content/tabs-js.patch index 4f133a2fe..f26356b8d 100644 --- a/src/browser/components/tabbrowser/content/tabs-js.patch +++ b/src/browser/components/tabbrowser/content/tabs-js.patch @@ -1,5 +1,5 @@ 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 +++ b/browser/components/tabbrowser/content/tabs.js @@ -289,6 +289,7 @@ @@ -401,7 +401,19 @@ index 1fcebe3962..d20a98d99a 100644 translate += this.arrowScrollbox.scrollbox[scrollDirection] - dragData.scrollPos; } 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. item = item.parentElement; } @@ -411,7 +423,7 @@ index 1fcebe3962..d20a98d99a 100644 item.style.transform = `${translateAxis}(${translate}px)`; } -@@ -2521,6 +2596,9 @@ +@@ -2521,6 +2601,9 @@ break; } let element = tabs[mid]; @@ -421,7 +433,7 @@ index 1fcebe3962..d20a98d99a 100644 let elementForSize = isTabGroupLabel(element) ? element.parentElement : element; -@@ -2604,7 +2682,7 @@ +@@ -2604,7 +2687,7 @@ let shouldCreateGroupOnDrop; let dropBefore; if (dropElement) { @@ -430,7 +442,7 @@ index 1fcebe3962..d20a98d99a 100644 ? dropElement.parentElement : dropElement; -@@ -2624,7 +2702,7 @@ +@@ -2624,7 +2707,7 @@ ? Services.prefs.getIntPref( "browser.tabs.dragDrop.moveOverThresholdPercent" ) / 100 @@ -439,7 +451,7 @@ index 1fcebe3962..d20a98d99a 100644 moveOverThreshold = Math.min(1, Math.max(0, moveOverThreshold)); let shouldMoveOver = overlapPercent > moveOverThreshold; 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 // 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 // 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 // that dropping the tab(s) will create a new tab group. shouldCreateGroupOnDrop = -@@ -2703,12 +2763,12 @@ +@@ -2703,12 +2768,12 @@ overlapPercent > dragOverGroupingThreshold; if (shouldCreateGroupOnDrop) { @@ -502,7 +514,7 @@ index 1fcebe3962..d20a98d99a 100644 } else { this.removeAttribute("movingtab-createGroup"); document -@@ -2735,19 +2795,14 @@ +@@ -2735,19 +2800,14 @@ dropElement = dropElementGroup; colorCode = undefined; } else if (isTabGroupLabel(dropElement)) { @@ -530,7 +542,7 @@ index 1fcebe3962..d20a98d99a 100644 } this.#setDragOverGroupColor(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 // would currently be dropped. for (let item of tabs) { @@ -556,7 +568,7 @@ index 1fcebe3962..d20a98d99a 100644 } 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) { if (isTabGroupLabel(item)) { -@@ -2843,6 +2909,18 @@ +@@ -2843,6 +2914,18 @@ item = item.parentElement; } item.style.transform = ""; @@ -592,7 +604,7 @@ index 1fcebe3962..d20a98d99a 100644 item.removeAttribute("dragover-createGroup"); } this.removeAttribute("movingtab-createGroup"); -@@ -2889,7 +2967,7 @@ +@@ -2889,7 +2972,7 @@ let postTransitionCleanup = () => { movingTab._moveTogetherSelectedTabsData.animate = false; }; @@ -601,7 +613,7 @@ index 1fcebe3962..d20a98d99a 100644 postTransitionCleanup(); } else { let onTransitionEnd = transitionendEvent => { -@@ -3062,7 +3140,7 @@ +@@ -3062,7 +3145,7 @@ } _notifyBackgroundTab(aTab) { @@ -610,7 +622,7 @@ index 1fcebe3962..d20a98d99a 100644 return; } -@@ -3171,7 +3249,10 @@ +@@ -3171,7 +3254,10 @@ #getDragTarget(event, { ignoreSides = false } = {}) { let { target } = event; while (target) { @@ -622,7 +634,7 @@ index 1fcebe3962..d20a98d99a 100644 break; } target = target.parentNode; -@@ -3188,6 +3269,9 @@ +@@ -3188,6 +3274,9 @@ return null; } }