Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/2 Fixes/11065.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hide progress indicator once `Interactive Window` has loaded.
11 changes: 11 additions & 0 deletions src/client/datascience/interactive-window/interactiveWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,17 @@ export class InteractiveWindow extends InteractiveBase implements IInteractiveWi
}
return undefined;
}
protected async addSysInfo(reason: SysInfoReason): Promise<void> {
await super.addSysInfo(reason);

// If `reason == Start`, then this means UI has been updated with the last
// pience of informaiotn (which was sys info), and now UI can be deemed as having been loaded.
// Marking a UI as having been loaded is done by sending a message `LoadAllCells`, even though we're not loading any cells.
// We're merely using existing messages (from NativeEditor).
if (reason === SysInfoReason.Start) {
this.postMessage(InteractiveWindowMessages.LoadAllCells, { cells: [] }).ignoreErrors();
}
}
protected async onViewStateChanged(args: WebViewViewChangeEventArgs) {
super.onViewStateChanged(args);
this._onDidChangeViewState.fire();
Expand Down
2 changes: 1 addition & 1 deletion src/datascience-ui/history-react/interactivePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class InteractivePanel extends React.Component<IInteractivePanelProps> {
fontFamily: this.props.font.family
};

const progressBar = this.props.busy && !this.props.testMode ? <Progress /> : undefined;
const progressBar = (this.props.busy || !this.props.loaded) && !this.props.testMode ? <Progress /> : undefined;

// If in test mode, update our count. Use this to determine how many renders a normal update takes.
if (this.props.testMode) {
Expand Down
11 changes: 11 additions & 0 deletions src/datascience-ui/history-react/redux/reducers/creation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,15 @@ export namespace Creation {
editCellVM: undefined
};
}

export function loaded(arg: InteractiveReducerArg<{ cells: ICell[] }>): IMainState {
postActionToExtension(arg, InteractiveWindowMessages.LoadAllCellsComplete, {
cells: []
});
return {
...arg.prevState,
loaded: true,
busy: false
};
}
}
1 change: 1 addition & 0 deletions src/datascience-ui/history-react/redux/reducers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const reducerMap: Partial<IInteractiveActionMapping> = {
[CommonActionType.SUBMIT_INPUT]: Execution.submitInput,
[InteractiveWindowMessages.ExpandAll]: Effects.expandAll,
[CommonActionType.EDITOR_LOADED]: Transfer.started,
[InteractiveWindowMessages.LoadAllCells]: Creation.loaded,
[CommonActionType.SCROLL]: Effects.scrolled,
[CommonActionType.CLICK_CELL]: Effects.clickCell,
[CommonActionType.UNFOCUS_CELL]: Effects.unfocusCell,
Expand Down
2 changes: 1 addition & 1 deletion src/datascience-ui/native-editor/nativeEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class NativeEditor extends React.Component<INativeEditorProps> {
}

// Update the state controller with our new state
const progressBar = this.props.busy && !this.props.testMode ? <Progress /> : undefined;
const progressBar = (this.props.busy || !this.props.loaded) && !this.props.testMode ? <Progress /> : undefined;
const addCellLine =
this.props.cellVMs.length === 0 ? null : (
<AddCellLine
Expand Down