File tree Expand file tree Collapse file tree 6 files changed +26
-2
lines changed
client/datascience/interactive-window Expand file tree Collapse file tree 6 files changed +26
-2
lines changed Original file line number Diff line number Diff line change
1
+ Hide progress indicator once ` Interactive Window ` has loaded.
Original file line number Diff line number Diff line change @@ -274,6 +274,17 @@ export class InteractiveWindow extends InteractiveBase implements IInteractiveWi
274
274
}
275
275
return undefined ;
276
276
}
277
+ protected async addSysInfo ( reason : SysInfoReason ) : Promise < void > {
278
+ await super . addSysInfo ( reason ) ;
279
+
280
+ // If `reason == Start`, then this means UI has been updated with the last
281
+ // pience of informaiotn (which was sys info), and now UI can be deemed as having been loaded.
282
+ // Marking a UI as having been loaded is done by sending a message `LoadAllCells`, even though we're not loading any cells.
283
+ // We're merely using existing messages (from NativeEditor).
284
+ if ( reason === SysInfoReason . Start ) {
285
+ this . postMessage ( InteractiveWindowMessages . LoadAllCells , { cells : [ ] } ) . ignoreErrors ( ) ;
286
+ }
287
+ }
277
288
protected async onViewStateChanged ( args : WebViewViewChangeEventArgs ) {
278
289
super . onViewStateChanged ( args ) ;
279
290
this . _onDidChangeViewState . fire ( ) ;
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ export class InteractivePanel extends React.Component<IInteractivePanelProps> {
51
51
fontFamily : this . props . font . family
52
52
} ;
53
53
54
- const progressBar = this . props . busy && ! this . props . testMode ? < Progress /> : undefined ;
54
+ const progressBar = ( this . props . busy || ! this . props . loaded ) && ! this . props . testMode ? < Progress /> : undefined ;
55
55
56
56
// If in test mode, update our count. Use this to determine how many renders a normal update takes.
57
57
if ( this . props . testMode ) {
Original file line number Diff line number Diff line change @@ -183,4 +183,15 @@ export namespace Creation {
183
183
editCellVM : undefined
184
184
} ;
185
185
}
186
+
187
+ export function loaded ( arg : InteractiveReducerArg < { cells : ICell [ ] } > ) : IMainState {
188
+ postActionToExtension ( arg , InteractiveWindowMessages . LoadAllCellsComplete , {
189
+ cells : [ ]
190
+ } ) ;
191
+ return {
192
+ ...arg . prevState ,
193
+ loaded : true ,
194
+ busy : false
195
+ } ;
196
+ }
186
197
}
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ export const reducerMap: Partial<IInteractiveActionMapping> = {
34
34
[ CommonActionType . SUBMIT_INPUT ] : Execution . submitInput ,
35
35
[ InteractiveWindowMessages . ExpandAll ] : Effects . expandAll ,
36
36
[ CommonActionType . EDITOR_LOADED ] : Transfer . started ,
37
+ [ InteractiveWindowMessages . LoadAllCells ] : Creation . loaded ,
37
38
[ CommonActionType . SCROLL ] : Effects . scrolled ,
38
39
[ CommonActionType . CLICK_CELL ] : Effects . clickCell ,
39
40
[ CommonActionType . UNFOCUS_CELL ] : Effects . unfocusCell ,
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ export class NativeEditor extends React.Component<INativeEditorProps> {
79
79
}
80
80
81
81
// Update the state controller with our new state
82
- const progressBar = this . props . busy && ! this . props . testMode ? < Progress /> : undefined ;
82
+ const progressBar = ( this . props . busy || ! this . props . loaded ) && ! this . props . testMode ? < Progress /> : undefined ;
83
83
const addCellLine =
84
84
this . props . cellVMs . length === 0 ? null : (
85
85
< AddCellLine
You can’t perform that action at this time.
0 commit comments