Skip to content

Commit ead7900

Browse files
committed
Bug 1982318 - Add "uploaded profiles" section to about:logging with the ability to delete profiles r=padenot,fluent-reviewers,julienw,bolsson
Differential Revision: https://phabricator.services.mozilla.com/D260806
1 parent f4dedc7 commit ead7900

File tree

5 files changed

+384
-2
lines changed

5 files changed

+384
-2
lines changed

toolkit/content/aboutLogging/aboutLogging.css

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44

55
@import url("chrome://global/skin/in-content/common.css");
66

7+
:host {
8+
/* Local variables with fallbacks for mobile compatibility.
9+
* Bug 1986645: We should ship these variables in Android and remove here. */
10+
--aboutlogging-text-color-deemphasized: var(--text-color-deemphasized, color-mix(in srgb, currentColor 69%, transparent));
11+
--aboutlogging-box-background: var(--background-color-box, light-dark(#fff, #23222b));
12+
--aboutlogging-box-border-color: var(--in-content-box-border-color, color-mix(in srgb, currentColor 41%, transparent));
13+
--aboutlogging-border-radius-small: var(--border-radius-small, 4px);
14+
}
15+
716
[hidden] {
817
/* This page uses the hidden attribute a lot, so let's make sure we don't
918
* override it by mistake. */
@@ -25,7 +34,9 @@
2534
background-color: var(--background-color-success);
2635
color: var(--text-color);
2736
text-align: center;
28-
border-radius: var(--border-radius-small);
37+
/* Bug 1986645: Border radius tokens are not shipped in Android, so we use a variable with fallback */
38+
/* stylelint-disable-next-line stylelint-plugin-mozilla/use-border-radius-tokens */
39+
border-radius: var(--aboutlogging-border-radius-small);
2940
padding: var(--space-medium);
3041
opacity: 0;
3142
transition:
@@ -122,7 +133,7 @@ input[type="text"] {
122133

123134
#some-elements-unavailable {
124135
background-color: var(--in-content-box-info-background);
125-
border-color: var(--in-content-box-border-color);
136+
border-color: var(--aboutlogging-box-border-color);
126137
}
127138

128139
.button-with-icon {
@@ -133,3 +144,55 @@ input[type="text"] {
133144
-moz-context-properties: fill;
134145
fill: currentColor;
135146
}
147+
148+
/* Uploaded Profiles section styles */
149+
#uploaded-profiles-section {
150+
margin-bottom: 2em;
151+
}
152+
153+
.uploaded-profile-item {
154+
display: flex;
155+
justify-content: space-between;
156+
align-items: center;
157+
padding: 1em;
158+
margin-bottom: 0.5em;
159+
border: 1px solid var(--aboutlogging-box-border-color);
160+
/* Bug 1986645: Border radius tokens are not shipped in Android, so we use a variable with fallback */
161+
/* stylelint-disable-next-line stylelint-plugin-mozilla/use-border-radius-tokens */
162+
border-radius: var(--aboutlogging-border-radius-small);
163+
background-color: var(--aboutlogging-box-background);
164+
}
165+
166+
.uploaded-profile-info {
167+
flex: 1;
168+
}
169+
170+
.uploaded-profile-name {
171+
font-weight: 600;
172+
margin-bottom: 0.25em;
173+
}
174+
175+
.uploaded-profile-details {
176+
display: flex;
177+
gap: 1em;
178+
font-size: 0.9em;
179+
color: var(--aboutlogging-text-color-deemphasized);
180+
}
181+
182+
.uploaded-profile-actions {
183+
margin-inline-start: 1em;
184+
}
185+
186+
.delete-profile-button {
187+
/* moz-button doesn't have proper styles for Android and it doesn't appear
188+
* clickable there. Making this look like a clickable element. This will be
189+
* overwritten by moz-button on desktop. */
190+
color: LinkText;
191+
}
192+
193+
#no-uploaded-profiles {
194+
color: var(--aboutlogging-text-color-deemphasized);
195+
font-style: italic;
196+
text-align: center;
197+
padding: 2em;
198+
}

toolkit/content/aboutLogging/aboutLogging.mjs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,21 @@ function init() {
612612
$("#buttons-disabled").hidden = false;
613613
toggleLoggingButton.disabled = true;
614614
}
615+
616+
// Initialize the uploaded profiles manager if profile uploading is enabled
617+
const shouldUpload = Services.prefs.getBoolPref(
618+
"toolkit.aboutLogging.uploadProfileToCloud",
619+
false
620+
);
621+
if (shouldUpload) {
622+
import("chrome://global/content/aboutLogging/uploadedProfilesManager.mjs")
623+
.then(({ UploadedProfilesManager }) => {
624+
new UploadedProfilesManager();
625+
})
626+
.catch(error => {
627+
console.error("Error initializing uploaded profiles manager:", error);
628+
});
629+
}
615630
}
616631

617632
function maybeEnsureButtonInNavbar() {

0 commit comments

Comments
 (0)