diff --git a/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts b/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts index 7454d382d0c..efc5e92e03f 100644 --- a/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts +++ b/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts @@ -9,7 +9,7 @@ import { Disposable, DisposableStore, disposeIfDisposable, IDisposable, MutableD import { MultiWindowParts, Part } from '../../part.js'; import { EventType as TouchEventType, Gesture, GestureEvent } from '../../../../base/browser/touch.js'; import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; -import { StatusbarAlignment, IStatusbarService, IStatusbarEntry, IStatusbarEntryAccessor, IStatusbarStyleOverride, isStatusbarEntryLocation, IStatusbarEntryLocation, isStatusbarEntryPriority, IStatusbarEntryPriority, IStatusbarEntryOverride } from '../../../services/statusbar/browser/statusbar.js'; +import { StatusbarAlignment, IStatusbarService, IStatusbarEntry, IStatusbarEntryAccessor, IStatusbarStyleOverride, isStatusbarEntryLocation, IStatusbarEntryLocation, isStatusbarEntryPriority, IStatusbarEntryPriority } from '../../../services/statusbar/browser/statusbar.js'; import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js'; import { IAction, Separator, toAction } from '../../../../base/common/actions.js'; import { IThemeService } from '../../../../platform/theme/common/themeService.js'; @@ -76,10 +76,9 @@ export interface IStatusbarEntryContainer extends IDisposable { updateEntryVisibility(id: string, visible: boolean): void; /** - * Allows to override the appearance of an entry with the provided ID. Only a subset - * of properties is allowed to be overridden. + * Allows to override the appearance of an entry with the provided ID. */ - overrideEntry(id: string, override: IStatusbarEntryOverride): IDisposable; + overrideEntry(id: string, override: Partial): IDisposable; /** * Focused the status bar. If one of the status bar entries was focused, focuses it directly. @@ -141,7 +140,7 @@ class StatusbarPart extends Part implements IStatusbarEntryContainer { readonly onWillDispose = this._onWillDispose.event; private readonly onDidOverrideEntry = this._register(new Emitter()); - private readonly entryOverrides = new Map(); + private readonly entryOverrides = new Map>(); private leftItemsContainer: HTMLElement | undefined; private rightItemsContainer: HTMLElement | undefined; @@ -182,7 +181,7 @@ class StatusbarPart extends Part implements IStatusbarEntryContainer { this._register(this.contextService.onDidChangeWorkbenchState(() => this.updateStyles())); } - overrideEntry(id: string, override: IStatusbarEntryOverride): IDisposable { + overrideEntry(id: string, override: Partial): IDisposable { this.entryOverrides.set(id, override); this.onDidOverrideEntry.fire(id); @@ -834,7 +833,7 @@ export class StatusbarService extends MultiWindowParts implements } } - overrideEntry(id: string, override: IStatusbarEntryOverride): IDisposable { + overrideEntry(id: string, override: Partial): IDisposable { const disposables = new DisposableStore(); for (const part of this.parts) { @@ -910,7 +909,7 @@ export class ScopedStatusbarService extends Disposable implements IStatusbarServ this.statusbarEntryContainer.updateEntryVisibility(id, visible); } - overrideEntry(id: string, override: IStatusbarEntryOverride): IDisposable { + overrideEntry(id: string, override: Partial): IDisposable { return this.statusbarEntryContainer.overrideEntry(id, override); } diff --git a/src/vs/workbench/contrib/chat/browser/chatQuotasService.ts b/src/vs/workbench/contrib/chat/browser/chatQuotasService.ts index 7b82ddbb330..87b4eb19f7f 100644 --- a/src/vs/workbench/contrib/chat/browser/chatQuotasService.ts +++ b/src/vs/workbench/contrib/chat/browser/chatQuotasService.ts @@ -261,7 +261,11 @@ export class ChatQuotasStatusBarEntry extends Disposable implements IWorkbenchCo compact: isCopilotStatusVisible })); - this.entry.add(this.statusbarService.overrideEntry(ChatQuotasStatusBarEntry.COPILOT_STATUS_ID, { kind: 'prominent' })); + this.entry.add(this.statusbarService.overrideEntry(ChatQuotasStatusBarEntry.COPILOT_STATUS_ID, { + text: '$(copilot-warning)', + ariaLabel: text, + kind: 'prominent' + })); } } } diff --git a/src/vs/workbench/services/statusbar/browser/statusbar.ts b/src/vs/workbench/services/statusbar/browser/statusbar.ts index 1c589dc4f66..3b3f1f1fe17 100644 --- a/src/vs/workbench/services/statusbar/browser/statusbar.ts +++ b/src/vs/workbench/services/statusbar/browser/statusbar.ts @@ -197,15 +197,3 @@ export interface IStatusbarEntryAccessor extends IDisposable { */ update(properties: IStatusbarEntry): void; } - -/** - * A way to override a status bar entry appearance. Only a subset of - * properties are currently allowed to override. - */ -export interface IStatusbarEntryOverride { - - /** - * The kind of status bar entry. This applies different colors to the entry. - */ - readonly kind?: StatusbarEntryKind; -}