no-bug: Make sure to animate when adding the first tab of a folder (gh-13380)

This commit is contained in:
mr. m
2026-04-23 20:23:50 +02:00
committed by GitHub
parent 0dd99a2ec7
commit d1dc4586f6
3 changed files with 28 additions and 16 deletions

View File

@@ -15,7 +15,7 @@
value: true value: true
- name: zen.splitView.drag-over-split-delayMC - name: zen.splitView.drag-over-split-delayMC
value: 350 value: 500
- name: zen.splitView.drag-over-split-threshold - name: zen.splitView.drag-over-split-threshold
value: 40 value: 40

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 2643e1a2aa14ba5cb4a64a92e1c2dfa5f07d242f..4f845f2175464ce24c2de0014ce102c574daf5dc 100644 index 2643e1a2aa14ba5cb4a64a92e1c2dfa5f07d242f..d16fe62c8a67913dd1499b2665a22ff606d98f1e 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
@@ -413,6 +413,7 @@ @@ -413,6 +413,7 @@
@@ -966,7 +966,7 @@ index 2643e1a2aa14ba5cb4a64a92e1c2dfa5f07d242f..4f845f2175464ce24c2de0014ce102c5
} }
}, },
metricsContext metricsContext
@@ -7205,10 +7431,10 @@ @@ -7205,11 +7431,15 @@
* @param {TabMetricsContext} [metricsContext] * @param {TabMetricsContext} [metricsContext]
*/ */
moveTabToExistingGroup(aTab, aGroup, metricsContext) { moveTabToExistingGroup(aTab, aGroup, metricsContext) {
@@ -975,11 +975,17 @@ index 2643e1a2aa14ba5cb4a64a92e1c2dfa5f07d242f..4f845f2175464ce24c2de0014ce102c5
throw new Error("Can only move a tab into a tab group"); throw new Error("Can only move a tab into a tab group");
} }
- if (aTab.pinned) { - if (aTab.pinned) {
- return;
+ if (aTab.pinned != !!aGroup.pinned) { + if (aTab.pinned != !!aGroup.pinned) {
return; + if (aGroup.pinned) {
+ this.pinTab(aTab);
+ } else {
+ this.unpinTab(aTab);
+ }
} }
if (aTab.group && aTab.group.id === aGroup.id) { if (aTab.group && aTab.group.id === aGroup.id) {
@@ -7281,6 +7507,7 @@ return;
@@ -7281,6 +7511,7 @@
let state = { let state = {
tabIndex: tab._tPos, tabIndex: tab._tPos,
@@ -987,7 +993,7 @@ index 2643e1a2aa14ba5cb4a64a92e1c2dfa5f07d242f..4f845f2175464ce24c2de0014ce102c5
}; };
if (tab.visible) { if (tab.visible) {
state.elementIndex = tab.elementIndex; state.elementIndex = tab.elementIndex;
@@ -7312,7 +7539,7 @@ @@ -7312,7 +7543,7 @@
let changedSplitView = let changedSplitView =
previousTabState.splitViewId != currentTabState.splitViewId; previousTabState.splitViewId != currentTabState.splitViewId;
@@ -996,7 +1002,7 @@ index 2643e1a2aa14ba5cb4a64a92e1c2dfa5f07d242f..4f845f2175464ce24c2de0014ce102c5
tab.dispatchEvent( tab.dispatchEvent(
new CustomEvent("TabMove", { new CustomEvent("TabMove", {
bubbles: true, bubbles: true,
@@ -7354,6 +7581,10 @@ @@ -7354,6 +7585,10 @@
moveActionCallback(); moveActionCallback();
@@ -1007,7 +1013,7 @@ index 2643e1a2aa14ba5cb4a64a92e1c2dfa5f07d242f..4f845f2175464ce24c2de0014ce102c5
// Clear tabs cache after moving nodes because the order of tabs may have // Clear tabs cache after moving nodes because the order of tabs may have
// changed. // changed.
this.tabContainer._invalidateCachedTabs(); this.tabContainer._invalidateCachedTabs();
@@ -7404,7 +7635,22 @@ @@ -7404,7 +7639,22 @@
* @returns {object} * @returns {object}
* The new tab in the current window, null if the tab couldn't be adopted. * The new tab in the current window, null if the tab couldn't be adopted.
*/ */
@@ -1031,7 +1037,7 @@ index 2643e1a2aa14ba5cb4a64a92e1c2dfa5f07d242f..4f845f2175464ce24c2de0014ce102c5
// Swap the dropped tab with a new one we create and then close // 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 // 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 // windows). We also ensure that the tab we create to swap into has
@@ -7447,6 +7693,8 @@ @@ -7447,6 +7697,8 @@
} }
params.skipLoad = true; params.skipLoad = true;
let newTab = this.addWebTab("about:blank", params); let newTab = this.addWebTab("about:blank", params);
@@ -1040,7 +1046,7 @@ index 2643e1a2aa14ba5cb4a64a92e1c2dfa5f07d242f..4f845f2175464ce24c2de0014ce102c5
aTab.container.tabDragAndDrop.finishAnimateTabMove(); aTab.container.tabDragAndDrop.finishAnimateTabMove();
@@ -8149,7 +8397,7 @@ @@ -8149,7 +8401,7 @@
// preventDefault(). It will still raise the window if appropriate. // preventDefault(). It will still raise the window if appropriate.
return; return;
} }
@@ -1049,7 +1055,7 @@ index 2643e1a2aa14ba5cb4a64a92e1c2dfa5f07d242f..4f845f2175464ce24c2de0014ce102c5
window.focus(); window.focus();
aEvent.preventDefault(); aEvent.preventDefault();
} }
@@ -8166,7 +8414,6 @@ @@ -8166,7 +8418,6 @@
on_TabGroupCollapse(aEvent) { on_TabGroupCollapse(aEvent) {
aEvent.target.tabs.forEach(tab => { aEvent.target.tabs.forEach(tab => {
@@ -1057,7 +1063,7 @@ index 2643e1a2aa14ba5cb4a64a92e1c2dfa5f07d242f..4f845f2175464ce24c2de0014ce102c5
}); });
} }
@@ -8500,7 +8747,9 @@ @@ -8500,7 +8751,9 @@
let filter = this._tabFilters.get(tab); let filter = this._tabFilters.get(tab);
if (filter) { if (filter) {
@@ -1067,7 +1073,7 @@ index 2643e1a2aa14ba5cb4a64a92e1c2dfa5f07d242f..4f845f2175464ce24c2de0014ce102c5
let listener = this._tabListeners.get(tab); let listener = this._tabListeners.get(tab);
if (listener) { if (listener) {
@@ -9306,6 +9555,7 @@ @@ -9306,6 +9559,7 @@
aWebProgress.isTopLevel aWebProgress.isTopLevel
) { ) {
this.mTab.setAttribute("busy", "true"); this.mTab.setAttribute("busy", "true");
@@ -1075,7 +1081,7 @@ index 2643e1a2aa14ba5cb4a64a92e1c2dfa5f07d242f..4f845f2175464ce24c2de0014ce102c5
gBrowser._tabAttrModified(this.mTab, ["busy"]); gBrowser._tabAttrModified(this.mTab, ["busy"]);
this.mTab._notselectedsinceload = !this.mTab.selected; this.mTab._notselectedsinceload = !this.mTab.selected;
} }
@@ -9386,6 +9636,7 @@ @@ -9386,6 +9640,7 @@
// known defaults. Note we use the original URL since about:newtab // known defaults. Note we use the original URL since about:newtab
// redirects to a prerendered page. // redirects to a prerendered page.
const shouldRemoveFavicon = const shouldRemoveFavicon =
@@ -1083,7 +1089,7 @@ index 2643e1a2aa14ba5cb4a64a92e1c2dfa5f07d242f..4f845f2175464ce24c2de0014ce102c5
!this.mBrowser.mIconURL && !this.mBrowser.mIconURL &&
!ignoreBlank && !ignoreBlank &&
!(originalLocation.spec in FAVICON_DEFAULTS); !(originalLocation.spec in FAVICON_DEFAULTS);
@@ -9560,13 +9811,6 @@ @@ -9560,13 +9815,6 @@
this.mBrowser.originalURI = aRequest.originalURI; this.mBrowser.originalURI = aRequest.originalURI;
} }
@@ -1097,7 +1103,7 @@ index 2643e1a2aa14ba5cb4a64a92e1c2dfa5f07d242f..4f845f2175464ce24c2de0014ce102c5
} }
let userContextId = this.mBrowser.getAttribute("usercontextid") || 0; let userContextId = this.mBrowser.getAttribute("usercontextid") || 0;
@@ -10450,7 +10694,7 @@ var TabContextMenu = { @@ -10450,7 +10698,7 @@ var TabContextMenu = {
); );
contextUnpinSelectedTabs.hidden = contextUnpinSelectedTabs.hidden =
!this.contextTab.pinned || !this.multiselected; !this.contextTab.pinned || !this.multiselected;

View File

@@ -1008,6 +1008,12 @@
} }
handle_drop_transition(dropElement, draggedTab, movingTabs, dropBefore) { handle_drop_transition(dropElement, draggedTab, movingTabs, dropBefore) {
if (
dropElement?.hasAttribute("zen-empty-tab") &&
dropElement.group?.isZenFolder
) {
dropElement = dropElement.group;
}
if (isTabGroupLabel(dropElement)) { if (isTabGroupLabel(dropElement)) {
dropElement = dropElement.group; dropElement = dropElement.group;
} }