fix: Fixed ungrouping a folder not updating the last saved group, b=no-bug, c=no-component

This commit is contained in:
mr. m
2025-08-25 01:07:06 +02:00
parent 1e8fad2fda
commit 61aeceb467

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabgroup.js b/browser/components/tabbrowser/content/tabgroup.js
index caea196b22b4689f55780a528661d87b52f4e728..9c1e141b6b2121d32f30c82862b597146f664b34 100644
index caea196b22b4689f55780a528661d87b52f4e728..c107c803d0820a209c0859745dcc8370294eb7b2 100644
--- a/browser/components/tabbrowser/content/tabgroup.js
+++ b/browser/components/tabbrowser/content/tabgroup.js
@@ -13,10 +13,12 @@
@@ -18,7 +18,7 @@ index caea196b22b4689f55780a528661d87b52f4e728..9c1e141b6b2121d32f30c82862b59714
<vbox class="tab-group-overflow-count-container" pack="center">
<label class="tab-group-overflow-count" role="button" />
</vbox>
@@ -57,20 +59,26 @@
@@ -57,20 +59,28 @@
}
connectedCallback() {
@@ -30,6 +30,8 @@ index caea196b22b4689f55780a528661d87b52f4e728..9c1e141b6b2121d32f30c82862b59714
+ detail: this,
+ })
+ );
+ } else if (!this.group) {
+ this._lastGroup = null;
+ }
// Always set the mutation observer to listen for tab change events, even
// if we are already initialized.
@@ -49,7 +51,7 @@ index caea196b22b4689f55780a528661d87b52f4e728..9c1e141b6b2121d32f30c82862b59714
this._initialized = true;
this.saveOnWindowClose = true;
@@ -97,11 +105,14 @@
@@ -97,11 +107,14 @@
this.#labelElement.container = gBrowser.tabContainer;
this.#labelElement.group = this;
@@ -69,7 +71,7 @@ index caea196b22b4689f55780a528661d87b52f4e728..9c1e141b6b2121d32f30c82862b59714
this.#updateLabelAriaAttributes();
this.#updateCollapsedAriaAttributes();
@@ -127,6 +138,8 @@
@@ -127,6 +140,8 @@
// mounts after getting created by `Tabbrowser.adoptTabGroup`.
this.#wasCreatedByAdoption = false;
}
@@ -78,7 +80,7 @@ index caea196b22b4689f55780a528661d87b52f4e728..9c1e141b6b2121d32f30c82862b59714
resetDefaultGroupName = () => {
this.#defaultGroupName = "";
@@ -197,7 +210,10 @@
@@ -197,7 +212,10 @@
}
});
}
@@ -90,7 +92,7 @@ index caea196b22b4689f55780a528661d87b52f4e728..9c1e141b6b2121d32f30c82862b59714
}
get color() {
@@ -338,12 +354,61 @@
@@ -338,12 +356,61 @@
tabGroupName,
})
.then(result => {
@@ -154,7 +156,7 @@ index caea196b22b4689f55780a528661d87b52f4e728..9c1e141b6b2121d32f30c82862b59714
}
/**
@@ -373,7 +438,7 @@
@@ -373,7 +440,7 @@
*/
addTabs(tabs, metricsContext) {
for (let tab of tabs) {
@@ -163,7 +165,7 @@ index caea196b22b4689f55780a528661d87b52f4e728..9c1e141b6b2121d32f30c82862b59714
tab.ownerGlobal.gBrowser.unpinTab(tab);
}
let tabToMove =
@@ -437,7 +502,7 @@
@@ -437,7 +504,7 @@
*/
on_click(event) {
let isToggleElement =
@@ -172,7 +174,7 @@ index caea196b22b4689f55780a528661d87b52f4e728..9c1e141b6b2121d32f30c82862b59714
event.target === this.#overflowCountLabel;
if (isToggleElement && event.button === 0) {
event.preventDefault();
@@ -470,5 +535,6 @@
@@ -470,5 +537,6 @@
}
}