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
274274 }
275275 return undefined ;
276276 }
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+ }
277288 protected async onViewStateChanged ( args : WebViewViewChangeEventArgs ) {
278289 super . onViewStateChanged ( args ) ;
279290 this . _onDidChangeViewState . fire ( ) ;
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ export class InteractivePanel extends React.Component<IInteractivePanelProps> {
5151 fontFamily : this . props . font . family
5252 } ;
5353
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 ;
5555
5656 // If in test mode, update our count. Use this to determine how many renders a normal update takes.
5757 if ( this . props . testMode ) {
Original file line number Diff line number Diff line change @@ -183,4 +183,15 @@ export namespace Creation {
183183 editCellVM : undefined
184184 } ;
185185 }
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+ }
186197}
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ export const reducerMap: Partial<IInteractiveActionMapping> = {
3434 [ CommonActionType . SUBMIT_INPUT ] : Execution . submitInput ,
3535 [ InteractiveWindowMessages . ExpandAll ] : Effects . expandAll ,
3636 [ CommonActionType . EDITOR_LOADED ] : Transfer . started ,
37+ [ InteractiveWindowMessages . LoadAllCells ] : Creation . loaded ,
3738 [ CommonActionType . SCROLL ] : Effects . scrolled ,
3839 [ CommonActionType . CLICK_CELL ] : Effects . clickCell ,
3940 [ 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> {
7979 }
8080
8181 // 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 ;
8383 const addCellLine =
8484 this . props . cellVMs . length === 0 ? null : (
8585 < AddCellLine
You can’t perform that action at this time.
0 commit comments