Bug 1954648 - Smart Tab Group settings in Preferences->Tabs r=ngrato,fluent-reviewers,settings-reviewers,tabbrowser-reviewers,dwalker,flod

Differential Revision: https://phabricator.services.mozilla.com/D241922
This commit is contained in:
Rolf Rando
2025-03-23 04:03:31 +00:00
parent 7d89ae3c11
commit 6457c1eed4
6 changed files with 34 additions and 7 deletions

View File

@@ -331,7 +331,7 @@
super();
XPCOMUtils.defineLazyPreferenceGetter(
this,
"smartTabGroupsEnabled",
"smartTabGroupsFeatureConfigEnabled",
"browser.tabs.groups.smart.enabled",
false,
this.#onSmartTabGroupsPrefChange.bind(this)
@@ -450,8 +450,17 @@
this.#swatchesContainer.addEventListener("change", this);
}
#onSmartTabGroupsPrefChange(_preName, _prev, latest) {
const icon = latest ? MozTabbrowserTabGroupMenu.AI_ICON : "";
get smartTabGroupsEnabled() {
return (
this.smartTabGroupsUserEnabled &&
this.smartTabGroupsFeatureConfigEnabled
);
}
#onSmartTabGroupsPrefChange(_preName, _prev, _latest) {
const icon = this.smartTabGroupsEnabled
? MozTabbrowserTabGroupMenu.AI_ICON
: "";
this.#suggestionButton.iconSrc = icon;
this.#suggestionsMessage.iconSrc = icon;