@@ -44,6 +44,7 @@ import * as Logs from '../../models/logs/logs.js';
4444import * as Trace from '../../models/trace/trace.js' ;
4545import * as Workspace from '../../models/workspace/workspace.js' ;
4646import * as NetworkForward from '../../panels/network/forward/forward.js' ;
47+ import * as Buttons from '../../ui/components/buttons/buttons.js' ;
4748import * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js' ;
4849import * as UI from '../../ui/legacy/legacy.js' ;
4950import * as VisualLogging from '../../ui/visual_logging/visual_logging.js' ;
@@ -156,9 +157,18 @@ const UIStrings = {
156157 throttling : 'Throttling' ,
157158 /**
158159 *@description Text in Network Panel to tell the user to reload the page to capture screenshots.
159- *@example {Ctrl + R} PH1
160+ *@example {Reload page} PH1
161+ *@example {Ctrl + R} PH2
160162 */
161- hitSToReloadAndCaptureFilmstrip : 'Hit {PH1} to reload and capture filmstrip.' ,
163+ reloadAndCaptureFilmstrip : 'Reload and capture filmstrip by using the "{PH1}" button or by hitting {PH2}' ,
164+ /**
165+ * @description A label for a button in the Network panel for reloading the page to capture screenshots.
166+ */
167+ reloadPage : 'Reload page' ,
168+ /**
169+ * @description Text in Network Panel if no filmstrips have been captured
170+ */
171+ noFilmstrips : 'No filmstrips captured' ,
162172 /**
163173 * @description A context menu item that is shown for resources in other panels
164174 * to open them in the Network panel.
@@ -175,11 +185,11 @@ const UIStrings = {
175185 /**
176186 *@description Text in Network Panel that is displayed whilst the recording is in progress.
177187 */
178- recordingFrames : 'Recording frames... ' ,
188+ recordingFrames : 'Currenty recording frames' ,
179189 /**
180190 *@description Text in Network Panel that is displayed when frames are being fetched.
181191 */
182- fetchingFrames : 'Fetching frames... ' ,
192+ fetchingFrames : 'Currently fetching frames' ,
183193 /**
184194 * @description Text of a button in the Network panel's toolbar that open Network Conditions panel in the drawer.
185195 */
@@ -623,14 +633,23 @@ export class NetworkPanel extends UI.Panel.Panel implements
623633 }
624634
625635 private resetFilmStripView ( ) : void {
626- const reloadShortcut =
627- UI . ShortcutRegistry . ShortcutRegistry . instance ( ) . shortcutsForAction ( 'inspector-main.reload' ) [ 0 ] ;
636+ const actionId = 'inspector-main.reload' ;
637+ const reloadShortcut = UI . ShortcutRegistry . ShortcutRegistry . instance ( ) . shortcutsForAction ( actionId ) [ 0 ] ;
638+ const action = UI . ActionRegistry . ActionRegistry . instance ( ) . getAction ( actionId ) ;
628639
629640 if ( this . filmStripView ) {
630641 this . filmStripView . reset ( ) ;
631- if ( reloadShortcut ) {
632- this . filmStripView . setStatusText (
633- i18nString ( UIStrings . hitSToReloadAndCaptureFilmstrip , { PH1 : reloadShortcut . title ( ) } ) ) ;
642+ if ( reloadShortcut && action ) {
643+ const button = UI . UIUtils . createTextButton (
644+ i18nString ( UIStrings . reloadPage ) , ( ) => action . execute ( ) ,
645+ { jslogContext : actionId , variant : Buttons . Button . Variant . TONAL } ) ;
646+ const placeholder = new UI . EmptyWidget . EmptyWidget (
647+ i18nString ( UIStrings . noFilmstrips ) ,
648+ i18nString (
649+ UIStrings . reloadAndCaptureFilmstrip ,
650+ { PH1 : i18nString ( UIStrings . reloadPage ) , PH2 : reloadShortcut . title ( ) } ) ) ;
651+ placeholder . contentElement . appendChild ( button ) ;
652+ this . filmStripView . setStatusPlaceholder ( placeholder ) ;
634653 }
635654 }
636655 }
@@ -947,7 +966,7 @@ export class FilmStripRecorder implements Trace.TracingManager.TracingManagerCli
947966 startRecording ( ) : void {
948967 this . #collectedTraceEvents = [ ] ;
949968 this . filmStripView . reset ( ) ;
950- this . filmStripView . setStatusText ( i18nString ( UIStrings . recordingFrames ) ) ;
969+ this . filmStripView . setStatusPlaceholder ( new UI . EmptyWidget . EmptyWidget ( i18nString ( UIStrings . recordingFrames ) , '' ) ) ;
951970 const tracingManager =
952971 SDK . TargetManager . TargetManager . instance ( ) . scopeTarget ( ) ?. model ( Trace . TracingManager . TracingManager ) ;
953972 if ( this . tracingManager || ! tracingManager ) {
@@ -975,7 +994,7 @@ export class FilmStripRecorder implements Trace.TracingManager.TracingManagerCli
975994 this . resourceTreeModel . suspendReload ( ) ;
976995 }
977996 this . callback = callback ;
978- this . filmStripView . setStatusText ( i18nString ( UIStrings . fetchingFrames ) ) ;
997+ this . filmStripView . setStatusPlaceholder ( new UI . EmptyWidget . EmptyWidget ( i18nString ( UIStrings . fetchingFrames ) , '' ) ) ;
979998 }
980999}
9811000
0 commit comments