Skip to content

Commit 9ef881c

Browse files
ktranDevtools-frontend LUCI CQ
authored andcommitted
[GM3Restyling] Update Framework ignore listing settings page
Drive-by: Update padding in cards component Before: https://i.imgur.com/aP6glij.png After: https://i.imgur.com/r6csaJ5.png Bug: 368238837 Change-Id: I16833b9a1fbc331cc8514ee37dbbe63a8c205baf Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5945585 Reviewed-by: Kateryna Prokopenko <[email protected]> Commit-Queue: Kim-Anh Tran <[email protected]>
1 parent fde766b commit 9ef881c

File tree

9 files changed

+82
-75
lines changed

9 files changed

+82
-75
lines changed

config/gni/devtools_grd_files.gni

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,7 @@ grd_files_release_sources = [
675675
"front_end/third_party/web-vitals/web-vitals.js",
676676
"front_end/ui/components/adorners/adorners.js",
677677
"front_end/ui/components/buttons/buttons.js",
678+
"front_end/ui/components/cards/cards.js",
678679
"front_end/ui/components/chrome_link/chrome_link.js",
679680
"front_end/ui/components/code_highlighter/code_highlighter.js",
680681
"front_end/ui/components/data_grid/data_grid.js",
@@ -2133,6 +2134,8 @@ grd_files_debug_sources = [
21332134
"front_end/ui/components/adorners/adorner.css.js",
21342135
"front_end/ui/components/buttons/Button.js",
21352136
"front_end/ui/components/buttons/button.css.legacy.js",
2137+
"front_end/ui/components/cards/Card.js",
2138+
"front_end/ui/components/cards/card.css.js",
21362139
"front_end/ui/components/chrome_link/ChromeLink.js",
21372140
"front_end/ui/components/chrome_link/chromeLink.css.js",
21382141
"front_end/ui/components/code_highlighter/CodeHighlighter.js",

front_end/panels/settings/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ devtools_module("settings") {
3030
"../../core/host:bundle",
3131
"../../core/i18n:bundle",
3232
"../../core/root:bundle",
33+
"../../ui/components/cards:bundle",
3334
"../../ui/components/icon_button:bundle",
3435
"../../ui/components/legacy_wrapper:bundle",
3536
"../../ui/components/switch:bundle",

front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,23 @@ import * as Host from '../../core/host/host.js';
77
import * as i18n from '../../core/i18n/i18n.js';
88
import type * as Platform from '../../core/platform/platform.js';
99
import * as Buttons from '../../ui/components/buttons/buttons.js';
10+
import * as Cards from '../../ui/components/cards/cards.js';
1011
import * as UI from '../../ui/legacy/legacy.js';
1112
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
1213

1314
import frameworkIgnoreListSettingsTabStyles from './frameworkIgnoreListSettingsTab.css.js';
15+
import settingsScreenStyles from './settingsScreen.css.js';
1416

1517
const UIStrings = {
1618
/**
17-
*@description Header text content in Framework Ignore List Settings Tab of the Settings
19+
*@description Header text content in Framework Ignore List Settings Tab of the Settings for enabling or disabling ignore listing
1820
*/
19-
frameworkIgnoreList: 'Framework ignore list',
21+
frameworkIgnoreList: 'Ignore listing',
2022
/**
21-
*@description Text in Framework Ignore List Settings Tab of the Settings
23+
*@description Checkbox label in Framework Ignore List Settings Tab of the Settings
2224
*/
23-
debuggerWillSkipThroughThe:
24-
'Debugger won\'t step through these scripts or break on exceptions that only affect them and Performance panel will collapse flamechart items that match.',
25+
ignoreListingDescription:
26+
'If enabled, DevTools’ debugger will skip over ignore-listed scripts and won’t stop on exceptions thrown by them',
2527
/**
2628
*@description Text in Framework Ignore List Settings Tab of the Settings
2729
*/
@@ -45,11 +47,11 @@ const UIStrings = {
4547
/**
4648
*@description Text in Framework Ignore List Settings Tab of the Settings
4749
*/
48-
generalExclusionRules: 'General exclusion rules:',
50+
generalExclusionRules: 'General exclusion rules',
4951
/**
5052
*@description Text in Framework Ignore List Settings Tab of the Settings
5153
*/
52-
customExclusionRules: 'Custom exclusion rules:',
54+
customExclusionRules: 'Custom exclusion rules',
5355
/**
5456
*@description Text of the add pattern button in Framework Ignore List Settings Tab of the Settings
5557
*/
@@ -96,27 +98,29 @@ export class FrameworkIgnoreListSettingsTab extends UI.Widget.VBox implements
9698

9799
constructor() {
98100
super(true);
99-
100101
this.element.setAttribute('jslog', `${VisualLogging.pane('blackbox')}`);
101102

102-
const header = this.contentElement.createChild('div', 'header');
103-
header.textContent = i18nString(UIStrings.frameworkIgnoreList);
104-
UI.ARIAUtils.markAsHeading(header, 1);
105-
106-
this.contentElement.createChild('div', 'intro').textContent = i18nString(UIStrings.debuggerWillSkipThroughThe);
103+
const settingsContent =
104+
this.contentElement.createChild('div', 'settings-card-container-wrapper').createChild('div');
105+
settingsContent.classList.add('settings-card-container', 'ignore-list-settings');
107106

107+
const ignoreListingDescription = document.createElement('span');
108+
ignoreListingDescription.textContent = i18nString(UIStrings.ignoreListingDescription);
108109
const enabledSetting =
109110
Common.Settings.Settings.instance().moduleSetting('enable-ignore-listing') as Common.Settings.Setting<boolean>;
110-
const enableIgnoreListing = this.contentElement.createChild('div', 'ignore-list-global-enable');
111+
const enableIgnoreListing = this.contentElement.createChild('div');
111112
enableIgnoreListing.appendChild(
112113
UI.SettingsUI.createSettingCheckbox(i18nString(UIStrings.enableIgnoreListing), enabledSetting, true));
113114
UI.Tooltip.Tooltip.install(enableIgnoreListing, i18nString(UIStrings.enableIgnoreListingTooltip));
114115

115-
const ignoreListOptions = this.contentElement.createChild('div', 'ignore-list-options');
116-
117-
const generalExclusionGroup = this.createSettingGroup(i18nString(UIStrings.generalExclusionRules));
118-
ignoreListOptions.appendChild(generalExclusionGroup);
116+
const enableIgnoreListingCard = new Cards.Card.Card();
117+
enableIgnoreListingCard.data = {
118+
heading: i18nString(UIStrings.frameworkIgnoreList),
119+
content: [ignoreListingDescription, enableIgnoreListing],
120+
};
121+
settingsContent.appendChild(enableIgnoreListingCard);
119122

123+
const generalExclusionGroup = this.createSettingGroup();
120124
const ignoreListContentScripts = generalExclusionGroup.createChild('div', 'ignore-list-option');
121125
ignoreListContentScripts.appendChild(UI.SettingsUI.createSettingCheckbox(
122126
i18nString(UIStrings.ignoreListContentScripts),
@@ -147,8 +151,22 @@ export class FrameworkIgnoreListSettingsTab extends UI.Widget.VBox implements
147151
i18nString(UIStrings.ignoreListAnonymousScripts),
148152
Common.Settings.Settings.instance().moduleSetting('skip-anonymous-scripts'), true));
149153

150-
const customExclusionGroup = this.createSettingGroup(i18nString(UIStrings.customExclusionRules));
151-
ignoreListOptions.appendChild(customExclusionGroup);
154+
const generalExclusionGroupCard = new Cards.Card.Card();
155+
generalExclusionGroupCard.data = {
156+
heading: i18nString(UIStrings.generalExclusionRules),
157+
content: [generalExclusionGroup],
158+
};
159+
generalExclusionGroupCard.classList.add('ignore-list-options');
160+
settingsContent.appendChild(generalExclusionGroupCard);
161+
162+
const customExclusionGroup = this.createSettingGroup();
163+
const customExclusionGroupCard = new Cards.Card.Card();
164+
customExclusionGroupCard.classList.add('ignore-list-options');
165+
customExclusionGroupCard.data = {
166+
heading: i18nString(UIStrings.customExclusionRules),
167+
content: [customExclusionGroup],
168+
};
169+
settingsContent.appendChild(customExclusionGroupCard);
152170

153171
this.list = new UI.ListWidget.ListWidget(this);
154172
this.list.element.classList.add('ignore-list');
@@ -174,17 +192,17 @@ export class FrameworkIgnoreListSettingsTab extends UI.Widget.VBox implements
174192
function enabledChanged(): void {
175193
const enabled = enabledSetting.get();
176194
if (enabled) {
177-
ignoreListOptions.classList.remove('ignore-listing-disabled');
195+
settingsContent.classList.remove('ignore-listing-disabled');
178196
} else {
179-
ignoreListOptions.classList.add('ignore-listing-disabled');
197+
settingsContent.classList.add('ignore-listing-disabled');
180198
}
181199
}
182200
}
183201

184202
override wasShown(): void {
185203
super.wasShown();
186204
this.list.registerCSSFiles([frameworkIgnoreListSettingsTabStyles]);
187-
this.registerCSSFiles([frameworkIgnoreListSettingsTabStyles]);
205+
this.registerCSSFiles([frameworkIgnoreListSettingsTabStyles, settingsScreenStyles]);
188206
this.settingUpdated();
189207
}
190208

@@ -200,14 +218,10 @@ export class FrameworkIgnoreListSettingsTab extends UI.Widget.VBox implements
200218
this.list.addNewItem(this.setting.getAsArray().length, {pattern: '', disabled: false});
201219
}
202220

203-
private createSettingGroup(title: string): Element {
221+
private createSettingGroup(): HTMLElement {
204222
const group = document.createElement('div');
205223
group.classList.add('ignore-list-option-group');
206224
UI.ARIAUtils.markAsGroup(group);
207-
const groupTitle = group.createChild('div', 'ignore-list-option-group-title');
208-
UI.ARIAUtils.markAsHeading(groupTitle, 2);
209-
UI.ARIAUtils.setLabel(group, title);
210-
groupTitle.textContent = title;
211225
return group;
212226
}
213227

front_end/panels/settings/frameworkIgnoreListSettingsTab.css

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,8 @@
44
* found in the LICENSE file.
55
*/
66

7-
:host {
8-
overflow: hidden;
9-
}
10-
11-
.header {
12-
padding: 0 0 6px;
13-
border-bottom: 1px solid var(--sys-color-divider);
14-
font-size: 18px;
15-
font-weight: normal;
16-
flex: none;
17-
}
18-
19-
.intro {
20-
margin-top: 10px;
21-
}
22-
237
.ignore-list-option {
248
flex: none;
25-
padding: 3px 6px;
26-
min-height: 30px;
279
}
2810

2911
.ignore-list-option devtools-button {
@@ -32,31 +14,16 @@
3214
margin-left: var(--sys-size-2);
3315
}
3416

35-
.ignore-list-option-group {
36-
margin-top: 13px;
37-
margin-bottom: 3px;
38-
margin-left: 8px;
39-
flex-shrink: 0;
40-
}
41-
4217
.add-button {
4318
margin: 10px 2px;
4419
align-self: flex-start;
4520
flex: none;
4621
}
4722

4823
.ignore-list {
49-
max-width: 500px;
5024
flex: 0 1 auto;
5125
}
5226

53-
.ignore-list-global-enable {
54-
padding: 3px 0;
55-
color: var(--sys-color-token-subtle);
56-
font-size: 120%;
57-
margin-top: 17px;
58-
}
59-
6027
.ignore-list-item {
6128
padding: 3px 5px;
6229
height: 30px;
@@ -68,7 +35,6 @@
6835

6936
.ignore-list-pattern {
7037
flex: auto;
71-
min-width: 100px;
7238
}
7339

7440
.ignore-list-item > [is="dt-checkbox"] {
@@ -97,13 +63,7 @@
9763
text-align: inherit;
9864
}
9965

100-
.ignore-list-options {
101-
margin-left: 22px;
102-
display: flex;
103-
flex-direction: column;
104-
}
105-
106-
.ignore-list-options.ignore-listing-disabled {
66+
.ignore-listing-disabled .ignore-list-options {
10767
opacity: 30%;
10868
}
10969

front_end/panels/settings/settingsScreen.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,30 @@ label {
144144
border-top: 1px solid var(--sys-color-divider);
145145
}
146146

147+
.settings-card-container-wrapper {
148+
padding-top: var(--sys-size-8);
149+
overflow: auto;
150+
scrollbar-width: thin;
151+
}
152+
153+
@media (max-width: 1000px) {
154+
.settings-card-container-wrapper {
155+
position: absolute;
156+
top: var(--sys-size-8);
157+
left: 0;
158+
right: 0;
159+
bottom: 0;
160+
overflow: auto;
161+
}
162+
}
163+
164+
.settings-card-container {
165+
display: flex;
166+
flex-direction: column;
167+
align-items: center;
168+
gap: var(--sys-size-11);
169+
}
170+
147171
.settings-tab.settings-content {
148172
margin: 0;
149173
padding: 0;

front_end/ui/components/cards/Card.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class Card extends HTMLElement {
4444
// clang-format off
4545
LitHtml.render(html`
4646
<div class="card">
47-
<div role="heading" class="heading">${this.#heading}</div>
47+
<div role="heading" aria-level="2" class="heading">${this.#heading}</div>
4848
<slot name="content" class='content-container'></slot>
4949
</div>
5050
`, this.#shadow, {

front_end/ui/components/cards/card.css

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@
33
* Use of this source code is governed by a BSD-style license that can be
44
* found in the LICENSE file.
55
*/
6+
:host {
7+
max-width: var(--sys-size-37);
8+
width: 100%;
9+
}
610

711
.card {
8-
margin: var(--sys-size-9);
9-
width: auto;
12+
min-width: var(--sys-size-31);
13+
max-width: var(--sys-size-37);
14+
margin: var(--sys-size-3);
1015
}
1116

1217
.heading {

front_end/ui/legacy/tabbedPane.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@
241241
}
242242

243243
.tabbed-pane-shadow.vertical-tab-layout .tabbed-pane-content {
244-
padding: var(--sys-size-10);
244+
padding-top: var(--sys-size-10);
245245
overflow-x: hidden;
246246
}
247247

test/e2e/helpers/settings-helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ export const setIgnoreListPattern = async (pattern: string) => {
8686

8787
export const toggleIgnoreListing = async (enable: boolean) => {
8888
await openSettingsTab('Ignore list');
89-
const enabledPattern = '.ignore-list-options:not(.ignore-listing-disabled)';
90-
const disabledPattern = '.ignore-list-options.ignore-listing-disabled';
89+
const enabledPattern = '.ignore-list-settings:not(.ignore-listing-disabled)';
90+
const disabledPattern = '.ignore-list-settings.ignore-listing-disabled';
9191
await waitFor(enable ? disabledPattern : enabledPattern);
9292
await click('[title="Enable ignore listing"]');
9393
await waitFor(enable ? enabledPattern : disabledPattern);

0 commit comments

Comments
 (0)