Hide chat tips when chat quota is exceeded (#295249)

This commit is contained in:
Copilot
2026-02-13 22:20:02 +00:00
committed by GitHub
parent 9d91c023b7
commit 651ef24e24

View File

@@ -608,6 +608,11 @@ export class ChatTipService extends Disposable implements IChatTipService {
return undefined; return undefined;
} }
// Don't show tips when chat quota is exceeded, the upgrade widget is more relevant
if (this._isChatQuotaExceeded(contextKeyService)) {
return undefined;
}
// Return the already-shown tip for stable rerenders // Return the already-shown tip for stable rerenders
if (this._tipRequestId === 'welcome' && this._shownTip) { if (this._tipRequestId === 'welcome' && this._shownTip) {
return this._createTip(this._shownTip); return this._createTip(this._shownTip);
@@ -722,6 +727,10 @@ export class ChatTipService extends Disposable implements IChatTipService {
return !location || location === ChatAgentLocation.Chat; return !location || location === ChatAgentLocation.Chat;
} }
private _isChatQuotaExceeded(contextKeyService: IContextKeyService): boolean {
return contextKeyService.getContextKeyValue<boolean>(ChatContextKeys.chatQuotaExceeded.key) === true;
}
private _isCopilotEnabled(): boolean { private _isCopilotEnabled(): boolean {
const defaultChatAgent = this._productService.defaultChatAgent; const defaultChatAgent = this._productService.defaultChatAgent;
return !!defaultChatAgent?.chatExtensionId; return !!defaultChatAgent?.chatExtensionId;