Bug 1887038 - Clean up whatsNewPanel pref and policies outside Messaging System r=webdriver-reviewers,desktop-theme-reviewers,mkaply,pdahiya,Itiel

Differential Revision: https://phabricator.services.mozilla.com/D207484
This commit is contained in:
Emily McMinn 2024-04-26 15:31:30 +00:00
Родитель 5841439a39
Коммит 19417a7b72
7 изменённых файлов: 15 добавлений и 146 удалений

Просмотреть файл

@ -2598,14 +2598,14 @@ var gProtectionsHandler = {
_createHeroElement(doc, message) {
const messageEl = this._createElement(doc, "div");
messageEl.setAttribute("id", "protections-popup-message");
messageEl.classList.add("whatsNew-hero-message");
messageEl.classList.add("protections-hero-message");
const wrapperEl = this._createElement(doc, "div");
wrapperEl.classList.add("whatsNew-message-body");
wrapperEl.classList.add("protections-popup-message-body");
messageEl.appendChild(wrapperEl);
wrapperEl.appendChild(
this._createElement(doc, "h2", {
classList: "whatsNew-message-title",
classList: "protections-popup-message-title",
content: message.content.title,
})
);

Просмотреть файл

@ -2467,13 +2467,6 @@ export var Policies = {
UserMessaging: {
onBeforeAddons(manager, param) {
if ("WhatsNew" in param) {
PoliciesUtils.setDefaultPref(
"browser.messaging-system.whatsNewPanel.enabled",
param.WhatsNew,
param.Locked
);
}
if ("ExtensionRecommendations" in param) {
PoliciesUtils.setDefaultPref(
"browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons",

Просмотреть файл

@ -657,13 +657,11 @@ const POLICIES_TESTS = [
{
policies: {
UserMessaging: {
WhatsNew: false,
SkipOnboarding: true,
Locked: true,
},
},
lockedPrefs: {
"browser.messaging-system.whatsNewPanel.enabled": false,
"browser.aboutwelcome.enabled": false,
},
},

Просмотреть файл

@ -1657,11 +1657,7 @@ radiogroup:focus-visible > .subviewradio[focused="true"] {
}
}
/* What's New panel */
#customizationui-widget-multiview #PanelUI-whatsNew {
max-width: var(--menu-panel-width);
}
/* Protections panel info message */
#protections-popup {
#info-message-container {
height: 260px;
@ -1703,7 +1699,16 @@ radiogroup:focus-visible > .subviewradio[focused="true"] {
margin: 12px 0;
}
.whatsNew-message-body {
.protections-popup-message-title {
display: grid;
font-size: 1.3em;
font-weight: 600;
line-height: 1.4em;
margin: 14px 0 0;
grid-column-start: 1;
}
.protections-popup-message-body {
/* -10px to compensate for the margin on the container. We can't get rid of that
because it helps position the background image. */
margin: 0 calc(-10px + var(--horizontal-padding)) var(--vertical-section-padding);
@ -1716,129 +1721,6 @@ radiogroup:focus-visible > .subviewradio[focused="true"] {
}
}
panelview {
&[mainview] #PanelUI-whatsNew-content {
height: 43em;
}
/* Hide the What's New header when the panel is a subview */
&:not([mainview]) #PanelUI-whatsNew-title {
display: none;
}
}
#PanelUI-whatsNew {
.panelMenu-toggleWhatsNew-checkbox {
padding-inline-start: 16px;
min-height: 41px;
}
.whatsNew-message {
cursor: pointer;
margin: 0;
padding: 0;
}
/* The following 2 rules show a 1 pixel line separator between What's New
* messages while at the same time ensuring that the first message (which has
* a date header) will not show the separator
*/
.whatsNew-message-body::before {
content: "";
display: block;
height: 1px;
width: 104%;
margin-inline-start: -2%;
background: var(--panel-separator-color);
}
.has-icon::before {
/* the width of the icon + the grid margin */
width: calc(104% + 40px);
}
.whatsNew-message-date + .whatsNew-message-body::before {
display: none;
}
.whatsNew-message-date {
font-size: .85em;
margin: -12px;
margin-top: 0;
margin-inline-start: 0;
padding: 6px 16px;
background: var(--arrowpanel-dimmed);
}
.whatsNew-message-body {
padding: 5px 0 10px;
margin: 10px 16px;
text-align: inherit;
text-decoration: none;
color: inherit;
background: none;
border: none;
cursor: pointer;
}
.whatsNew-message-body.has-icon {
display: grid;
grid-template-columns: auto 32px;
grid-template-rows: 0;
grid-gap: 0 8px;
}
.whatsNew-message-icon {
height: 32px;
width: 32px;
margin: 14px auto;
display: grid;
grid-column-start: 2;
}
.whatsNew-message-subtitle {
margin: 2px 0;
font-size: .8em;
color: #949494;
font-weight: normal;
grid-column-start: 1;
}
.whatsNew-message-content {
display: grid;
margin: 5px 0 10px;
grid-column-start: 1;
}
.text-link {
background: none;
border: 0;
color: #45a1ff;
cursor: pointer;
font-size: .9em;
grid-column-start: 1;
&:hover {
color: #0a84ff;
text-decoration: underline;
&:active {
color: #0060df;
}
}
}
}
#PanelUI-whatsNew .whatsNew-message-title,
#protections-popup-message .whatsNew-message-title {
display: grid;
font-size: 1.3em;
font-weight: 600;
line-height: 1.4em;
margin: 14px 0 0;
grid-column-start: 1;
}
#customizationui-widget-panel {
/* In the next two rules the panel's width is set according to the
* profiler backdrop image when not opened from the overflow panel. */

Просмотреть файл

@ -130,6 +130,7 @@ lazy_static! {
("browser.newtabpage.activity-stream.asrouter.providers.snippets", Pref::new("null")),
("browser.newtabpage.activity-stream.asrouter.providers.message-groups", Pref::new("null")),
// TODO: Remove once minimum supported Firefox release is 126.
("browser.newtabpage.activity-stream.asrouter.providers.whats-new-panel", Pref::new("null")),
("browser.newtabpage.activity-stream.asrouter.providers.messaging-experiments", Pref::new("null")),
("browser.newtabpage.activity-stream.feeds.system.topstories", Pref::new(false)),

Просмотреть файл

@ -12,7 +12,6 @@ user_pref("devtools.console.stdout.chrome", true);
// asrouter expects a plain object or null
user_pref("browser.newtabpage.activity-stream.asrouter.providers.cfr", "null");
user_pref("browser.newtabpage.activity-stream.asrouter.providers.message-groups", "null");
user_pref("browser.newtabpage.activity-stream.asrouter.providers.whats-new-panel", "null");
user_pref("browser.newtabpage.activity-stream.asrouter.providers.messaging-experiments", "null");
user_pref("browser.newtabpage.activity-stream.feeds.system.topstories", false);
user_pref("browser.newtabpage.activity-stream.tippyTop.service.endpoint", "");

Просмотреть файл

@ -28,10 +28,6 @@ pref(
// is required for the system to function.
pref("browser.newtabpage.activity-stream.asrouter.providers.cfr", "null");
pref("browser.newtabpage.activity-stream.asrouter.providers.snippets", "null");
pref(
"browser.newtabpage.activity-stream.asrouter.providers.whats-new-panel",
"null"
);
// The `browser.newtabpage.activity-stream.asrouter.providers.cfr` provider is
// disabled, but belt and braces: disable extension recommendations and feature