Bug 1934296 - Adding a tab to a collapsed group should expand the group. r=tabbrowser-reviewers,jswinarton

Differential Revision: https://phabricator.services.mozilla.com/D230982
This commit is contained in:
Dão Gottwald
2024-12-03 18:15:28 +00:00
parent 7bfdaa5fc8
commit db518f5774
3 changed files with 11 additions and 0 deletions

View File

@@ -5660,8 +5660,10 @@
return;
}
aGroup.collapsed = false;
this._handleTabMove(aTab, () => aGroup.appendChild(aTab));
this.removeFromMultiSelectedTabs(aTab);
this.tabContainer._notifyBackgroundTab(aTab);
}
/**

View File

@@ -329,6 +329,9 @@
if (tab.hasAttribute("fadein")) {
if (tab._fullyOpen) {
this._updateCloseButtons();
if (tab.group && tab == tab.group.lastChild) {
this._notifyBackgroundTab(tab);
}
} else {
this._handleNewTab(tab);
}

View File

@@ -101,6 +101,7 @@ add_task(async function test_tabGroupUniqueColors() {
add_task(async function test_tabGroupCollapseAndExpand() {
let tab1 = BrowserTestUtils.addTab(gBrowser, "about:blank");
let tab2 = BrowserTestUtils.addTab(gBrowser, "about:blank");
let group = gBrowser.addTabGroup([tab1]);
Assert.ok(!group.collapsed, "group is expanded by default");
@@ -116,6 +117,11 @@ add_task(async function test_tabGroupCollapseAndExpand() {
gBrowser.selectedTab = group.tabs[0];
Assert.ok(!group.collapsed, "group is expanded after selecting tab");
group.collapsed = true;
Assert.ok(group.collapsed, "group is collapsed via API");
gBrowser.moveTabToGroup(tab2, group);
Assert.ok(!group.collapsed, "group is expanded after moving tab into group");
await removeTabGroup(group);
});