@@ -245,6 +245,8 @@ export class RecorderController extends LitElement {
245245 #selfXssWarningDisabledSetting = Common . Settings . Settings . instance ( ) . createSetting (
246246 'disable-self-xss-warning' , false , Common . Settings . SettingStorageType . SYNCED ) ;
247247
248+ #recordingView?: Components . RecordingView . RecordingView ;
249+
248250 constructor ( ) {
249251 super ( ) ;
250252
@@ -856,8 +858,7 @@ export class RecorderController extends LitElement {
856858 throw new Error ( 'No current recording found' ) ;
857859 }
858860 this . #setCurrentRecording( await this . #storage. updateRecording ( this . currentRecording . storageName , data ) ) ;
859- const recordingView = this . shadowRoot ?. querySelector ( 'devtools-recording-view' ) ;
860- recordingView ?. scrollToBottom ( ) ;
861+ this . #recordingView?. scrollToBottom ( ) ;
861862
862863 await takeScreenshot ( this . currentRecording ) ;
863864 } ) ;
@@ -984,8 +985,9 @@ export class RecorderController extends LitElement {
984985 { keepBreakpoints : true , updateSession : true } ) ;
985986 Host . userMetrics . recordingAssertion ( Host . UserMetrics . RecordingAssertion . ASSERTION_ADDED ) ;
986987 await this . updateComplete ;
987- this . renderRoot . querySelector ( 'devtools-recording-view' )
988- ?. shadowRoot ?. querySelector ( '.section:last-child devtools-step-view:last-of-type' )
988+ // FIXME: call a method on the recording view widget.
989+ await this . #recordingView?. updateComplete ;
990+ this . #recordingView?. contentElement ?. querySelector ( '.section:last-child devtools-step-view:last-of-type' )
989991 ?. shadowRoot ?. querySelector < HTMLElement > ( '.action' )
990992 ?. click ( ) ;
991993 }
@@ -1036,12 +1038,14 @@ export class RecorderController extends LitElement {
10361038 }
10371039
10381040 #onAddBreakpoint = ( event : AddBreakpointEvent ) : void => {
1041+ this . #stepBreakpointIndexes = structuredClone ( this . #stepBreakpointIndexes) ;
10391042 this . #stepBreakpointIndexes. add ( event . index ) ;
10401043 this . recordingPlayer ?. updateBreakpointIndexes ( this . #stepBreakpointIndexes) ;
10411044 this . requestUpdate ( ) ;
10421045 } ;
10431046
10441047 #onRemoveBreakpoint = ( event : RemoveBreakpointEvent ) : void => {
1048+ this . #stepBreakpointIndexes = structuredClone ( this . #stepBreakpointIndexes) ;
10451049 this . #stepBreakpointIndexes. delete ( event . index ) ;
10461050 this . recordingPlayer ?. updateBreakpointIndexes ( this . #stepBreakpointIndexes) ;
10471051 this . requestUpdate ( ) ;
@@ -1084,10 +1088,7 @@ export class RecorderController extends LitElement {
10841088 return ;
10851089
10861090 case Actions . RecorderActions . TOGGLE_CODE_VIEW : {
1087- const view = this . renderRoot . querySelector ( 'devtools-recording-view' ) ;
1088- if ( view ) {
1089- view . showCodeToggle ( ) ;
1090- }
1091+ this . #recordingView?. showCodeToggle ( ) ;
10911092 return ;
10921093 }
10931094 }
@@ -1190,16 +1191,16 @@ export class RecorderController extends LitElement {
11901191 #renderRecordingPage( ) : Lit . TemplateResult {
11911192 // clang-format off
11921193 return html `
1193- < devtools-recording-view
1194- .data = ${
1195- {
1196- recording : this . currentRecording ?. flow ,
1194+ < devtools-widget
1195+ class =" recording-view "
1196+ .widgetConfig = ${ UI . Widget . widgetConfig ( Components . RecordingView . RecordingView , {
1197+ recording : this . currentRecording ?. flow ?? { title : '' , steps : [ ] } ,
11971198 replayState : this . #replayState,
11981199 isRecording : this . isRecording ,
11991200 recordingTogglingInProgress : this . isToggling ,
12001201 currentStep : this . currentStep ,
12011202 currentError : this . recordingError ,
1202- sections : this . sections ,
1203+ sections : this . sections ?? [ ] ,
12031204 settings : this . settings ,
12041205 recorderSettings : this . #recorderSettings,
12051206 lastReplayResult : this . lastReplayResult ,
@@ -1209,27 +1210,27 @@ export class RecorderController extends LitElement {
12091210 extensionConverters : this . extensionConverters ,
12101211 replayExtensions : this . replayExtensions ,
12111212 extensionDescriptor : this . viewDescriptor ,
1212- } as Components . RecordingView . RecordingViewData
1213- }
1214- @networkconditionschanged =${ this . #onNetworkConditionsChanged }
1215- @timeoutchanged =${ this . #onTimeoutChanged }
1216- @requestselectorattribute= ${ (
1217- event : Controllers . SelectorPicker . RequestSelectorAttributeEvent ,
1218- ) => {
1219- event . send ( this . currentRecording ?. flow . selectorAttribute ) ;
1220- } }
1221- @recordingfinished =${ this . #onRecordingFinished }
1222- @stepchanged =${ this . #handleRecordingChanged . bind ( this ) }
1223- @recordingtitlechanged =${ this . #handleRecordingTitleChanged . bind ( this ) }
1224- @addstep =${ this . #handleStepAdded . bind ( this ) }
1225- @removestep =${ this . #handleStepRemoved . bind ( this ) }
1226- @addbreakpoint =${ this . #onAddBreakpoint }
1227- @removebreakpoint =${ this . #onRemoveBreakpoint }
1228- @playrecording =${ this . #onPlayRecording }
1229- @abortreplay =${ this . #onAbortReplay }
1230- @recorderextensionviewclosed =${ this . #onExtensionViewClosed }
1231- @addassertion= ${ this . #handleAddAssertionEvent }
1232- > </ devtools-recording-view >
1213+ } ) }
1214+ @networkconditionschanged = ${ this . #onNetworkConditionsChanged }
1215+ @timeoutchanged =${ this . #onTimeoutChanged }
1216+ @requestselectorattribute =${ (
1217+ event : Controllers . SelectorPicker . RequestSelectorAttributeEvent ,
1218+ ) => {
1219+ event . send ( this . currentRecording ?. flow . selectorAttribute ) ;
1220+ } }
1221+ @recordingfinished= ${ this . #onRecordingFinished }
1222+ @stepchanged =${ this . #handleRecordingChanged . bind ( this ) }
1223+ @recordingtitlechanged =${ this . #handleRecordingTitleChanged . bind ( this ) }
1224+ @addstep =${ this . #handleStepAdded . bind ( this ) }
1225+ @removestep =${ this . #handleStepRemoved . bind ( this ) }
1226+ @addbreakpoint =${ this . #onAddBreakpoint . bind ( this ) }
1227+ @removebreakpoint =${ this . #onRemoveBreakpoint . bind ( this ) }
1228+ @playrecording =${ this . #onPlayRecording . bind ( this ) }
1229+ @abortreplay =${ this . #onAbortReplay . bind ( this ) }
1230+ @recorderextensionviewclosed =${ this . #onExtensionViewClosed . bind ( this ) }
1231+ @addassertion =${ this . #handleAddAssertionEvent . bind ( this ) }
1232+ ${ UI . Widget . widgetRef ( Components . RecordingView . RecordingView , widget => { this . #recordingView = widget ; } ) }
1233+ > </ devtools-widget >
12331234 ` ;
12341235 // clang-format on
12351236 }
@@ -1291,6 +1292,7 @@ export class RecorderController extends LitElement {
12911292 ] ;
12921293
12931294 return html `
1295+ < style > ${ UI . inspectorCommonStyles } </ style >
12941296 < style > ${ recorderControllerStyles } </ style >
12951297 < div class ="wrapper ">
12961298 < div class ="header " jslog =${ VisualLogging . toolbar ( ) } >
0 commit comments