Skip to content

Commit 72674ae

Browse files
authored
Add progress for loading sessions (#7205)
This command can occasional be slow
1 parent 022edaa commit 72674ae

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

src/view/sessionLogView.ts

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,25 @@ export class SessionLogViewManager extends Disposable implements vscode.WebviewP
3939
this._register(vscode.window.registerWebviewPanelSerializer(SessionLogViewManager.viewType, this));
4040

4141
this._register(vscode.commands.registerCommand('codingAgent.openSessionLog', async () => {
42-
const copilotApi = await getCopilotApi(credentialStore);
43-
if (!copilotApi) {
44-
vscode.window.showErrorMessage(vscode.l10n.t('You must be authenticated to view sessions.'));
45-
return;
46-
}
42+
const allSessions = await vscode.window.withProgress({
43+
location: vscode.ProgressLocation.Window,
44+
title: vscode.l10n.t('Loading sessions...')
45+
}, async () => {
46+
const copilotApi = await getCopilotApi(credentialStore);
47+
if (!copilotApi) {
48+
vscode.window.showErrorMessage(vscode.l10n.t('You must be authenticated to view sessions.'));
49+
return;
50+
}
51+
52+
const allSessions = await copilotApi.getAllSessions(undefined);
53+
if (!allSessions?.length) {
54+
vscode.window.showErrorMessage(vscode.l10n.t('No sessions found.'));
55+
return;
56+
}
57+
return allSessions;
58+
});
4759

48-
const allSessions = await copilotApi.getAllSessions(undefined);
49-
if (!allSessions.length) {
50-
vscode.window.showErrorMessage(vscode.l10n.t('No sessions found.'));
60+
if (!allSessions?.length) {
5161
return;
5262
}
5363

0 commit comments

Comments
 (0)