Bug 1949808 - Prevent smart tab topic output from replacing group label if user starts typing r=vazish,tabbrowser-reviewers,dao

adding additional check before populating input

Differential Revision: https://phabricator.services.mozilla.com/D240223
This commit is contained in:
Nick Grato
2025-03-06 15:38:51 +00:00
parent f66d571349
commit 207d8697bf
2 changed files with 34 additions and 28 deletions

View File

@@ -99,7 +99,6 @@
this.tabContainer = document.getElementById("tabbrowser-tabs");
this.tabGroupMenu = document.getElementById("tab-group-editor");
this.tabbox = document.getElementById("tabbrowser-tabbox");
this.tabGroupNameField = document.getElementById("tab-group-name");
this.tabpanels = document.getElementById("tabbrowser-tabpanels");
this.verticalPinnedTabsContainer = document.getElementById(
"vertical-pinned-tabs-container"
@@ -168,11 +167,6 @@
"security.notification_enable_delay",
500
);
XPCOMUtils.defineLazyPreferenceGetter(
this,
"_smartTabGroupsEnabled",
"browser.tabs.groups.smart.enabled"
);
if (AppConstants.MOZ_CRASHREPORTER) {
ChromeUtils.defineESModuleGetters(this, {
@@ -189,7 +183,6 @@
window.addEventListener("activate", this);
window.addEventListener("deactivate", this);
window.addEventListener("TabGroupCreate", this);
window.addEventListener("MlLabelCreate", this);
this.tabContainer.init();
this._setupInitialBrowserAndTab();
@@ -2962,21 +2955,6 @@
return null;
}
if (this._smartTabGroupsEnabled) {
gBrowser.getGroupTitleForTabs(tabs).then(newLabel => {
group.label = newLabel;
if (this.tabGroupMenu.panel.state !== "closed") {
this.tabGroupNameField.value = newLabel;
group.dispatchEvent(
new CustomEvent("MlLabelCreate", {
bubbles: true,
detail: { mlLabel: newLabel },
})
);
}
});
}
group.dispatchEvent(
new CustomEvent("TabGroupCreate", {
bubbles: true,
@@ -6722,11 +6700,6 @@
this.tabGroupMenu.openCreateModal(aEvent.target);
}
break;
case "MlLabelCreate":
if (aEvent.detail.mlLabel) {
this.tabGroupMenu.mlLabel = aEvent.detail.mlLabel;
}
break;
case "activate":
// Intentional fallthrough
case "deactivate":