@@ -6,6 +6,7 @@ import '../../ui/legacy/legacy.js';
66
77import * as Common from '../../core/common/common.js' ;
88import * as i18n from '../../core/i18n/i18n.js' ;
9+ import type * as Platform from '../../core/platform/platform.js' ;
910import * as IssuesManager from '../../models/issues_manager/issues_manager.js' ;
1011import * as IssueCounter from '../../ui/components/issue_counter/issue_counter.js' ;
1112import * as UI from '../../ui/legacy/legacy.js' ;
@@ -86,11 +87,15 @@ const UIStrings = {
8687 /**
8788 * @description Label on the issues tab
8889 */
89- onlyThirdpartyCookieIssues : 'Only third-party cookie issues detected so far ' ,
90+ onlyThirdpartyCookieIssues : 'Only third-party cookie issues detected' ,
9091 /**
9192 * @description Label in the issues panel
9293 */
93- noIssuesDetectedSoFar : 'No issues detected so far' ,
94+ noIssues : 'No issues detected' ,
95+ /**
96+ * @description Text that explains the issues panel that is shown if no issues are shown.
97+ */
98+ issuesPanelDescription : 'On this page you can find warnings from the browser.' ,
9499 /**
95100 * @description Category title for the different 'Attribution Reporting API' issues. The
96101 * Attribution Reporting API is a newly proposed web API (see https://github.com/WICG/conversion-measurement-api).
@@ -110,6 +115,9 @@ const UIStrings = {
110115const str_ = i18n . i18n . registerUIStrings ( 'panels/issues/IssuesPane.ts' , UIStrings ) ;
111116const i18nString = i18n . i18n . getLocalizedString . bind ( undefined , str_ ) ;
112117
118+ const ISSUES_PANEL_EXPLANATION_URL =
119+ 'https://developer.chrome.com/docs/devtools/issues' as Platform . DevToolsPath . UrlString ;
120+
113121class IssueCategoryView extends UI . TreeOutline . TreeElement {
114122 #category: IssuesManager . Issue . IssueCategory ;
115123
@@ -177,7 +185,7 @@ export class IssuesPane extends UI.Widget.VBox {
177185 #showThirdPartyCheckbox: UI . Toolbar . ToolbarSettingCheckbox | null ;
178186 #issuesTree: UI . TreeOutline . TreeOutlineInShadow ;
179187 #hiddenIssuesRow: HiddenIssuesRow ;
180- #noIssuesMessageDiv: HTMLDivElement ;
188+ #noIssuesMessageDiv: UI . EmptyWidget . EmptyWidget ;
181189 #issuesManager: IssuesManager . IssuesManager . IssuesManager ;
182190 #aggregator: IssueAggregator ;
183191 #issueViewUpdatePromise: Promise < void > = Promise . resolve ( ) ;
@@ -207,9 +215,9 @@ export class IssuesPane extends UI.Widget.VBox {
207215 this . #hiddenIssuesRow = new HiddenIssuesRow ( ) ;
208216 this . #issuesTree. appendChild ( this . #hiddenIssuesRow) ;
209217
210- this . #noIssuesMessageDiv = document . createElement ( 'div' ) ;
211- this . #noIssuesMessageDiv. classList . add ( 'issues-pane-no-issues' ) ;
212- this . contentElement . appendChild ( this . #noIssuesMessageDiv ) ;
218+ this . #noIssuesMessageDiv = new UI . EmptyWidget . EmptyWidget ( '' , i18nString ( UIStrings . issuesPanelDescription ) ) ;
219+ this . #noIssuesMessageDiv. appendLink ( ISSUES_PANEL_EXPLANATION_URL ) ;
220+ this . #noIssuesMessageDiv . show ( this . contentElement ) ;
213221
214222 this . #issuesManager = IssuesManager . IssuesManager . IssuesManager . instance ( ) ;
215223 this . #aggregator = new IssueAggregator ( this . #issuesManager) ;
@@ -435,7 +443,7 @@ export class IssuesPane extends UI.Widget.VBox {
435443 this . #hiddenIssuesRow. hidden = hiddenIssueCount === 0 ;
436444 this . #hiddenIssuesRow. update ( hiddenIssueCount ) ;
437445 this . #issuesTree. element . hidden = false ;
438- this . #noIssuesMessageDiv. style . display = 'none' ;
446+ this . #noIssuesMessageDiv. hideWidget ( ) ;
439447 const firstChild = this . #issuesTree. firstChild ( ) ;
440448 if ( firstChild ) {
441449 firstChild . select ( /* omitFocus= */ true ) ;
@@ -448,10 +456,9 @@ export class IssuesPane extends UI.Widget.VBox {
448456 }
449457 // We alreay know that issesCount is zero here.
450458 const hasOnlyThirdPartyIssues = this . #issuesManager. numberOfAllStoredIssues ( ) > 0 ;
451- this . #noIssuesMessageDiv. textContent = hasOnlyThirdPartyIssues ?
452- i18nString ( UIStrings . onlyThirdpartyCookieIssues ) :
453- i18nString ( UIStrings . noIssuesDetectedSoFar ) ;
454- this . #noIssuesMessageDiv. style . display = 'flex' ;
459+ this . #noIssuesMessageDiv. header =
460+ hasOnlyThirdPartyIssues ? i18nString ( UIStrings . onlyThirdpartyCookieIssues ) : i18nString ( UIStrings . noIssues ) ;
461+ this . #noIssuesMessageDiv. showWidget ( ) ;
455462 }
456463 }
457464
0 commit comments