Skip to content

Commit f6f44b0

Browse files
ktranDevtools-frontend LUCI CQ
authored andcommitted
[GM3Restyling] Update legacy report view
This affects pages in the Application Panel (Manifest, Storage, Open Window, Service Workers). Screenshot: https://imgur.com/a/tXwkUqX Bug: 325443308 Change-Id: Id1377c0446e7c5df73f3d24a7d014113297b542f Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6357119 Reviewed-by: Kateryna Prokopenko <[email protected]> Commit-Queue: Kim-Anh Tran <[email protected]>
1 parent 2252695 commit f6f44b0

File tree

7 files changed

+51
-55
lines changed

7 files changed

+51
-55
lines changed

front_end/panels/application/AppManifestView.ts

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,12 @@ const UIStrings = {
7474
learnMore: 'Learn more',
7575
/**
7676
*@description Explanation why it is advisable to specify an 'id' field in the manifest.
77-
*@example {Note:} PH1
78-
*@example {id} PH2
79-
*@example {start_url} PH3
80-
*@example {id} PH4
81-
*@example {/index.html} PH5
82-
*@example {(button for copying suggested value into clipboard)} PH6
77+
*@example {/index.html} PH1
78+
*@example {(button for copying suggested value into clipboard)} PH2
8379
*/
8480
appIdNote:
85-
'{PH1} {PH2} is not specified in the manifest, {PH3} is used instead. To specify an App ID that matches the current identity, set the {PH4} field to {PH5} {PH6}.',
86-
/**
87-
*@description Label for reminding the user of something important. Is shown in bold and followed by the actual note to show the user.
88-
*/
89-
note: 'Note:',
81+
'Note: `id` is not specified in the manifest, `start_url` is used instead. To specify an App ID that matches the current identity, set the `id` field to {PH1} {PH2}.',
82+
9083
/**
9184
*@description Tooltip text that appears when hovering over a button which copies the previous text to the clipboard.
9285
*/
@@ -691,14 +684,6 @@ export class AppManifestView extends Common.ObjectWrapper.eventMixin<EventTypes,
691684

692685
if (!stringProperty('id')) {
693686
const suggestedIdNote = appIdField.createChild('div', 'multiline-value');
694-
const noteSpan = document.createElement('b');
695-
noteSpan.textContent = i18nString(UIStrings.note);
696-
const idSpan = document.createElement('code');
697-
idSpan.textContent = 'id';
698-
const idSpan2 = document.createElement('code');
699-
idSpan2.textContent = 'id';
700-
const startUrlSpan = document.createElement('code');
701-
startUrlSpan.textContent = 'start_url';
702687
const suggestedIdSpan = document.createElement('code');
703688
suggestedIdSpan.textContent = recommendedId;
704689

@@ -715,9 +700,8 @@ export class AppManifestView extends Common.ObjectWrapper.eventMixin<EventTypes,
715700
UI.ARIAUtils.alert(i18nString(UIStrings.copiedToClipboard, {PH1: recommendedId}));
716701
Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(recommendedId);
717702
});
718-
suggestedIdNote.appendChild(i18n.i18n.getFormatLocalizedString(
719-
str_, UIStrings.appIdNote,
720-
{PH1: noteSpan, PH2: idSpan, PH3: startUrlSpan, PH4: idSpan2, PH5: suggestedIdSpan, PH6: copyButton}));
703+
suggestedIdNote.appendChild(
704+
i18n.i18n.getFormatLocalizedString(str_, UIStrings.appIdNote, {PH1: suggestedIdSpan, PH2: copyButton}));
721705
}
722706
} else {
723707
this.identitySection.removeField(i18nString(UIStrings.computedAppId));
@@ -910,19 +894,18 @@ export class AppManifestView extends Common.ObjectWrapper.eventMixin<EventTypes,
910894
this.installabilitySection.element.classList.toggle('hidden', !installabilityErrors.length);
911895
const errorMessages = this.getInstallabilityErrorMessages(installabilityErrors);
912896
for (const error of errorMessages) {
913-
const icon = UI.UIUtils.createIconLabel({title: error, iconName: 'warning-filled', color: 'var(--icon-warning)'});
914-
this.installabilitySection.appendRow().appendChild(icon);
897+
const msgElement = document.createTextNode(error);
898+
this.installabilitySection.appendRow().appendChild(msgElement);
915899
}
916900

917901
this.errorsSection.element.classList.toggle('hidden', !errors.length && !imageErrors.length && !warnings.length);
918902
for (const warning of warnings) {
919-
const icon =
920-
UI.UIUtils.createIconLabel({title: warning, iconName: 'warning-filled', color: 'var(--icon-warning)'});
921-
this.errorsSection.appendRow().appendChild(icon);
903+
const msgElement = document.createTextNode(warning);
904+
this.errorsSection.appendRow().appendChild(msgElement);
922905
}
923906
for (const error of imageErrors) {
924-
const icon = UI.UIUtils.createIconLabel({title: error, iconName: 'warning-filled', color: 'var(--icon-warning)'});
925-
this.errorsSection.appendRow().appendChild(icon);
907+
const msgElement = document.createTextNode(error);
908+
this.errorsSection.appendRow().appendChild(msgElement);
926909
}
927910

928911
function stringProperty(name: string): string {

front_end/panels/application/ApplicationPanelSidebar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ const UIStrings = {
187187
/**
188188
*@description Text in App Manifest View of the Application panel
189189
*/
190-
appManifest: 'App Manifest',
190+
appManifest: 'Manifest',
191191
/**
192192
*@description Text in Application Panel Sidebar of the Application panel
193193
*/

front_end/panels/application/appManifestView.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@
1818
}
1919

2020
.inline-icon {
21-
margin-inline: 4px;
2221
width: 16px;
2322
height: 16px;
23+
margin-inline: var(--sys-size-3);
2424

2525
&[name="check-circle"] {
2626
color: var(--icon-checkmark-green);
2727
}
2828
}
2929

3030
.multiline-value {
31+
padding-top: var(--sys-size-5);
3132
white-space: normal;
3233
}
3334

front_end/panels/application/components/protocolHandlersView.css

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
* found in the LICENSE file.
55
*/
66

7+
:host {
8+
display: flex;
9+
flex-direction: column;
10+
}
11+
712
.devtools-link {
813
color: var(--sys-color-primary);
914
text-decoration: underline;
@@ -28,11 +33,10 @@ input.devtools-text-input[type="text"]::placeholder {
2833
}
2934

3035
.protocol-handlers-row {
31-
margin: 10px 0 2px 18px;
36+
margin: var(--sys-size-3) 0;
3237
}
3338

3439
.inline-icon {
35-
margin-inline: 4px;
3640
width: 16px;
3741
height: 16px;
3842

front_end/panels/application/serviceWorkersView.css

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
.service-worker-version {
88
display: flex;
99
/* The status string can be long, allow this line of the report to wrap. */
10+
align-items: center;
1011
flex-wrap: wrap;
1112

1213
devtools-button {
@@ -140,11 +141,6 @@
140141
flex-grow: 0;
141142
}
142143

143-
.service-worker-has-current .service-workers-other-origin {
144-
margin-top: 16px;
145-
border-top: 1px solid var(--sys-color-divider);
146-
}
147-
148144
.devtools-link {
149145
line-height: 14px;
150146
align-self: center;

front_end/panels/application/storageView.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@
88
display: flex;
99
align-items: center;
1010
white-space: normal;
11+
12+
&:has(.quota-override-error:empty) {
13+
margin: 0;
14+
}
1115
}
1216

1317
.clear-storage-button .report-row {
14-
margin: 0 0 0 17px;
1518
display: flex;
1619
}
1720

@@ -49,7 +52,7 @@
4952
}
5053
}
5154

52-
.quota-override-error {
55+
.quota-override-error:not(:empty) {
5356
padding-top: 10px;
5457
color: var(--sys-color-error);
5558
}

front_end/ui/legacy/reportView.css

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
.report-header {
2121
border-bottom: 1px solid var(--sys-color-divider);
22-
padding: 12px 24px;
22+
padding: var(--sys-size-7) var(--sys-size-9);
2323
}
2424

2525
.report-header devtools-toolbar {
@@ -29,7 +29,7 @@
2929
}
3030

3131
.report-title {
32-
font-size: 15px;
32+
font: var(--sys-typescale-headline4);
3333
white-space: nowrap;
3434
overflow: hidden;
3535
text-overflow: ellipsis;
@@ -38,64 +38,73 @@
3838

3939
.report-url,
4040
.report-subtitle {
41-
font-size: 12px;
42-
margin-top: 10px;
41+
font: var(--sys-typescale-body4-regular);
4342
}
4443

4544
.report-section {
4645
display: flex;
47-
padding: 12px;
46+
padding: var(--sys-size-7) var(--sys-size-9) 11px var(--sys-size-9);
4847
border-bottom: 1px solid var(--sys-color-divider);
4948
flex-direction: column;
5049
}
5150

5251
.report-section-header {
53-
margin-left: 18px;
52+
padding-bottom: var(--sys-size-5);
5453
display: flex;
5554
flex-direction: row;
5655
align-items: center;
5756

5857
devtools-button {
5958
flex: 0 0 auto;
6059
}
60+
61+
&:has(.report-section-title:empty) {
62+
padding: 0;
63+
}
6164
}
6265

6366
.report-section-title {
67+
font: var(--sys-typescale-headline5);
6468
flex: 1 1 auto;
6569
text-overflow: ellipsis;
6670
overflow: hidden;
6771
line-height: 16px;
68-
font-weight: bold;
6972
color: var(--sys-color-on-surface);
7073
min-width: var(--sys-size-21);
7174
white-space: nowrap;
7275
}
7376

7477
.report-field {
75-
margin-top: 8px;
7678
display: flex;
77-
line-height: 28px;
79+
padding: var(--sys-size-3) 0;
7880
}
7981

8082
.report-row {
81-
margin: 10px 0 2px 18px;
83+
font: var(--sys-typescale-body4-regular);
84+
margin: var(--sys-size-3) 0;
85+
86+
> dt-checkbox:first-child {
87+
margin-left: calc(var(--sys-size-4) * -1);
88+
}
8289

83-
&:has(dt-checkbox) {
84-
margin-top: 7px;
90+
> devtools-icon:first-child {
91+
/* We have inline icons that would otherwise be mis-aligned */
92+
margin-inline-start: 0;
8593
}
8694
}
8795

8896
.report-field-name {
97+
font: var(--sys-typescale-body5-regular);
8998
color: var(--sys-color-on-surface-subtle);
9099
flex: 0 0 128px;
91-
text-align: right;
92-
padding: 0 6px;
100+
text-align: left;
93101
white-space: pre-wrap;
94102
}
95103

96104
.report-field-value {
105+
font: var(--sys-typescale-body4-regular);
97106
flex: auto;
98-
padding: 0 6px;
107+
padding: 0 var(--sys-size-6);
99108
white-space: pre;
100109
user-select: text;
101110
}

0 commit comments

Comments
 (0)