status bar - make loading the default (#214135)

This is a more generic progress indicator than `syncing` and looks better.
This commit is contained in:
Benjamin Pasero 2024-06-03 13:41:53 +02:00 committed by GitHub
parent b5bd304ac8
commit 6908956c15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 11 additions and 13 deletions

View file

@ -65,7 +65,7 @@ export interface IProgressNotificationOptions extends IProgressOptions {
readonly secondaryActions?: readonly IAction[];
readonly delay?: number;
readonly priority?: NotificationPriority;
readonly type?: 'syncing' | 'loading';
readonly type?: 'loading' | 'syncing';
}
export interface IProgressDialogOptions extends IProgressOptions {
@ -77,7 +77,7 @@ export interface IProgressDialogOptions extends IProgressOptions {
export interface IProgressWindowOptions extends IProgressOptions {
readonly location: ProgressLocation.Window;
readonly command?: string;
readonly type?: 'syncing' | 'loading';
readonly type?: 'loading' | 'syncing';
}
export interface IProgressCompositeOptions extends IProgressOptions {

View file

@ -283,7 +283,7 @@ class StatusBarCodiconLabel extends SimpleIconLabel {
private progressCodicon = renderIcon(syncing);
private currentText = '';
private currentShowProgress: boolean | 'syncing' | 'loading' = false;
private currentShowProgress: boolean | 'loading' | 'syncing' = false;
constructor(
private readonly container: HTMLElement
@ -291,10 +291,10 @@ class StatusBarCodiconLabel extends SimpleIconLabel {
super(container);
}
set showProgress(showProgress: boolean | 'syncing' | 'loading') {
set showProgress(showProgress: boolean | 'loading' | 'syncing') {
if (this.currentShowProgress !== showProgress) {
this.currentShowProgress = showProgress;
this.progressCodicon = renderIcon(showProgress === 'loading' ? spinningLoading : syncing);
this.progressCodicon = renderIcon(showProgress === 'syncing' ? syncing : spinningLoading);
this.text = this.currentText;
}
}

View file

@ -109,7 +109,7 @@ export class TaskStatusBarContributions extends Disposable implements IWorkbench
}
if (promise && (event.kind === TaskEventKind.Active) && (this._activeTasksCount === 1)) {
this._progressService.withProgress({ location: ProgressLocation.Window, command: 'workbench.action.tasks.showTasks', type: 'loading' }, progress => {
this._progressService.withProgress({ location: ProgressLocation.Window, command: 'workbench.action.tasks.showTasks' }, progress => {
progress.report({ message: nls.localize('building', 'Building...') });
return promise!;
}).then(() => {

View file

@ -114,7 +114,7 @@ registerTerminalAction({
text,
name: text,
ariaLabel: text,
showProgress: 'loading'
showProgress: true
};
const statusbarHandle = statusbarService.addEntry(statusbarEntry, 'recordSession', StatusbarAlignment.LEFT);
store.add(statusbarHandle);

View file

@ -174,9 +174,9 @@ export interface IStatusbarEntry {
/**
* Will enable a spinning icon in front of the text to indicate progress. When `true` is
* specified, `syncing` will be used.
* specified, `loading` will be used.
*/
readonly showProgress?: boolean | 'syncing' | 'loading';
readonly showProgress?: boolean | 'loading' | 'syncing';
/**
* The kind of status bar entry. This applies different colors to the entry.

View file

@ -824,8 +824,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
title: localize('saveParticipants', "Saving '{0}'", this.name),
location: ProgressLocation.Window,
cancellable: true,
delay: this.isDirty() ? 3000 : 5000,
type: 'loading'
delay: this.isDirty() ? 3000 : 5000
}, progress => {
return this.doSaveSequential(versionId, options, progress, saveCancellation);
}, () => {

View file

@ -935,8 +935,7 @@ export class StoredFileWorkingCopy<M extends IStoredFileWorkingCopyModel> extend
title: localize('saveParticipants', "Saving '{0}'", this.name),
location: ProgressLocation.Window,
cancellable: true,
delay: this.isDirty() ? 3000 : 5000,
type: 'loading'
delay: this.isDirty() ? 3000 : 5000
}, progress => {
return this.doSaveSequential(versionId, options, progress, saveCancellation);
}, () => {