Bug 1879397 - Show a "Local recommendations" group label for Yelp suggestions and cache remaining group l10n strings. r=daisuke,fluent-reviewers,bolsson

This adds a "Local recommendations" group label for Yelp suggestions.

It also caches all Suggest group labels to avoid pop-in in the urlbar view. The
MDN and Pocket labels weren't being cached.

Differential Revision: https://phabricator.services.mozilla.com/D201157
This commit is contained in:
Drew Willcoxon
2024-02-09 03:05:01 +00:00
parent aa867485b6
commit 42558afc2e
3 changed files with 48 additions and 5 deletions

View File

@@ -2225,6 +2225,8 @@ export class UrlbarView {
return { id: "urlbar-group-mdn" };
case "pocket":
return { id: "urlbar-group-pocket" };
case "yelp":
return { id: "urlbar-group-local" };
}
}
@@ -2878,11 +2880,19 @@ export class UrlbarView {
if (lazy.UrlbarPrefs.get("groupLabels.enabled")) {
idArgs.push({ id: "urlbar-group-firefox-suggest" });
idArgs.push({ id: "urlbar-group-best-match" });
if (
lazy.UrlbarPrefs.get("quickSuggestEnabled") &&
lazy.UrlbarPrefs.get("addonsFeatureGate")
) {
idArgs.push({ id: "urlbar-group-addon" });
if (lazy.UrlbarPrefs.get("quickSuggestEnabled")) {
if (lazy.UrlbarPrefs.get("addonsFeatureGate")) {
idArgs.push({ id: "urlbar-group-addon" });
}
if (lazy.UrlbarPrefs.get("mdn.featureGate")) {
idArgs.push({ id: "urlbar-group-mdn" });
}
if (lazy.UrlbarPrefs.get("pocketFeatureGate")) {
idArgs.push({ id: "urlbar-group-pocket" });
}
if (lazy.UrlbarPrefs.get("yelpFeatureGate")) {
idArgs.push({ id: "urlbar-group-local" });
}
}
}