Browse Source

Adds basic progress to slow Graph loading

main
Eric Amodio 2 years ago
parent
commit
1c27f96504
1 changed files with 9 additions and 5 deletions
  1. +9
    -5
      src/plus/webviews/graph/graphWebview.ts

+ 9
- 5
src/plus/webviews/graph/graphWebview.ts View File

@ -1,5 +1,5 @@
import type { ColorTheme, ConfigurationChangeEvent, Disposable, Event, StatusBarItem } from 'vscode';
import { EventEmitter, MarkdownString, StatusBarAlignment, ViewColumn, window } from 'vscode';
import { EventEmitter, MarkdownString, ProgressLocation, StatusBarAlignment, ViewColumn, window } from 'vscode';
import { parseCommandContext } from '../../../commands/base';
import { GitActions } from '../../../commands/gitCommands.actions';
import type { GraphColumnConfig } from '../../../configuration';
@ -160,7 +160,9 @@ export class GraphWebview extends WebviewBase {
}
protected override async includeBootstrap(): Promise<State> {
return this.getState();
return window.withProgress({ location: ProgressLocation.Window, title: 'Loading Commit Graph...' }, async () =>
this.getState(),
);
}
protected override registerCommands(): Disposable[] {
@ -371,9 +373,11 @@ export class GraphWebview extends WebviewBase {
private async notifyDidChangeState() {
if (!this.isReady || !this.visible) return false;
return this.notify(DidChangeNotificationType, {
state: await this.getState(),
});
return window.withProgress({ location: ProgressLocation.Window, title: 'Loading Commit Graph...' }, async () =>
this.notify(DidChangeNotificationType, {
state: await this.getState(),
}),
);
}
@debug()

Loading…
Cancel
Save