@@ -7,21 +7,23 @@ import * as Host from '../../core/host/host.js';
77import * as i18n from '../../core/i18n/i18n.js' ;
88import type * as Platform from '../../core/platform/platform.js' ;
99import * as Buttons from '../../ui/components/buttons/buttons.js' ;
10+ import * as Cards from '../../ui/components/cards/cards.js' ;
1011import * as UI from '../../ui/legacy/legacy.js' ;
1112import * as VisualLogging from '../../ui/visual_logging/visual_logging.js' ;
1213
1314import frameworkIgnoreListSettingsTabStyles from './frameworkIgnoreListSettingsTab.css.js' ;
15+ import settingsScreenStyles from './settingsScreen.css.js' ;
1416
1517const 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
0 commit comments