Skip to content

Commit 1b63c82

Browse files
authored
chat - rename limited => free (microsoft#249703)
1 parent 35770a1 commit 1b63c82

File tree

10 files changed

+49
-48
lines changed

10 files changed

+49
-48
lines changed

src/vs/workbench/contrib/chat/browser/actions/chatActions.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ export function registerChatActions() {
655655
f1: true,
656656
precondition: ContextKeyExpr.and(
657657
ContextKeyExpr.or(
658-
ChatContextKeys.Entitlement.limited,
658+
ChatContextKeys.Entitlement.free,
659659
ChatContextKeys.Entitlement.pro,
660660
ChatContextKeys.Entitlement.proPlus
661661
),
@@ -699,7 +699,7 @@ export function registerChatActions() {
699699
constructor() {
700700
super({
701701
id: 'workbench.action.chat.configureCodeCompletions',
702-
title: localize2('configureCompletions', "Configure code completions..."),
702+
title: localize2('configureCompletions', "Configure Code Completions..."),
703703
precondition: ContextKeyExpr.and(
704704
ChatContextKeys.Setup.installed,
705705
ChatContextKeys.Setup.disabled.negate()
@@ -750,8 +750,8 @@ export function registerChatActions() {
750750
message = [message, localize('quotaResetDate', "The allowance will reset on {0}.", dateFormatter.value.format(quotaResetDate))].join(' ');
751751
}
752752

753-
const limited = chatEntitlementService.entitlement === ChatEntitlement.Limited;
754-
const upgradeToPro = limited ? localize('upgradeToPro', "Upgrade to Copilot Pro (your first 30 days are free) for:\n- Unlimited code completions\n- Unlimited chat messages\n- Access to premium models") : undefined;
753+
const free = chatEntitlementService.entitlement === ChatEntitlement.Free;
754+
const upgradeToPro = free ? localize('upgradeToPro', "Upgrade to Copilot Pro (your first 30 days are free) for:\n- Unlimited code completions\n- Unlimited chat messages\n- Access to premium models") : undefined;
755755

756756
await dialogService.prompt({
757757
type: 'none',
@@ -762,7 +762,7 @@ export function registerChatActions() {
762762
},
763763
buttons: [
764764
{
765-
label: limited ? localize('upgradePro', "Upgrade to Copilot Pro") : localize('upgradePlan', "Upgrade Copilot Plan"),
765+
label: free ? localize('upgradePro', "Upgrade to Copilot Pro") : localize('upgradePlan', "Upgrade Copilot Plan"),
766766
run: () => {
767767
const commandId = 'workbench.action.chat.upgradePlan';
768768
telemetryService.publicLog2<WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification>('workbenchActionExecuted', { id: commandId, from: 'chat-dialog' });
@@ -895,7 +895,7 @@ export class CopilotTitleBarMenuRendering extends Disposable implements IWorkben
895895
const chatSentiment = chatEntitlementService.sentiment;
896896
const chatQuotaExceeded = chatEntitlementService.quotas.chat?.percentRemaining === 0;
897897
const signedOut = chatEntitlementService.entitlement === ChatEntitlement.Unknown;
898-
const limited = chatEntitlementService.entitlement === ChatEntitlement.Limited;
898+
const free = chatEntitlementService.entitlement === ChatEntitlement.Free;
899899

900900
let primaryActionId = TOGGLE_CHAT_ACTION_ID;
901901
let primaryActionTitle = localize('toggleChat', "Toggle Chat");
@@ -905,7 +905,7 @@ export class CopilotTitleBarMenuRendering extends Disposable implements IWorkben
905905
primaryActionId = CHAT_SETUP_ACTION_ID;
906906
primaryActionTitle = localize('signInToChatSetup', "Sign in to use Copilot...");
907907
primaryActionIcon = Codicon.copilotNotConnected;
908-
} else if (chatQuotaExceeded && limited) {
908+
} else if (chatQuotaExceeded && free) {
909909
primaryActionId = OPEN_CHAT_QUOTA_EXCEEDED_DIALOG;
910910
primaryActionTitle = localize('chatQuotaExceededButton', "Copilot Free plan chat messages quota reached. Click for details.");
911911
primaryActionIcon = Codicon.copilotWarning;

src/vs/workbench/contrib/chat/browser/chat.contribution.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ import { LanguageModelToolsService } from './languageModelToolsService.js';
107107
import './promptSyntax/contributions/createPromptCommand/createPromptCommand.js';
108108
import { ChatViewsWelcomeHandler } from './viewsWelcome/chatViewsWelcomeHandler.js';
109109
import { registerAction2 } from '../../../../platform/actions/common/actions.js';
110+
import product from '../../../../platform/product/common/product.js';
110111

111112
// Register configuration
112113
const configurationRegistry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration);
@@ -441,7 +442,7 @@ configurationRegistry.registerConfiguration({
441442
type: 'string',
442443
enum: ['default', 'modern', 'brand-gh', 'brand-vsc', 'style-glow', 'alt-first', 'input-email', 'account-create'],
443444
description: nls.localize('chat.signInDialogVariant', "Control variations of the sign-in dialog."),
444-
default: 'default',
445+
default: product.quality !== 'stable' ? 'modern' : 'default',
445446
tags: ['onExp', 'experimental']
446447
},
447448
}
@@ -512,11 +513,11 @@ class ChatAgentSettingContribution extends Disposable implements IWorkbenchContr
512513
private registerMaxRequestsSetting(): void {
513514
let lastNode: IConfigurationNode | undefined;
514515
const registerMaxRequestsSetting = () => {
515-
const treatmentId = this.entitlementService.entitlement === ChatEntitlement.Limited ?
516+
const treatmentId = this.entitlementService.entitlement === ChatEntitlement.Free ?
516517
'chatAgentMaxRequestsFree' :
517518
'chatAgentMaxRequestsPro';
518519
this.experimentService.getTreatment<number>(treatmentId).then(value => {
519-
const defaultValue = value ?? (this.entitlementService.entitlement === ChatEntitlement.Limited ? 5 : 15);
520+
const defaultValue = value ?? (this.entitlementService.entitlement === ChatEntitlement.Free ? 5 : 15);
520521
const node: IConfigurationNode = {
521522
id: 'chatSidebar',
522523
title: nls.localize('interactiveSessionConfigurationTitle', "Chat"),

src/vs/workbench/contrib/chat/browser/chatContentParts/chatQuotaExceededPart.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export class ChatQuotaExceededPart extends Disposable implements IChatContentPar
6969
case ChatEntitlement.ProPlus:
7070
button1Label = localize('enableAdditionalUsage', "Manage paid premium requests");
7171
break;
72-
case ChatEntitlement.Limited:
72+
case ChatEntitlement.Free:
7373
button1Label = localize('upgradeToCopilotPro', "Upgrade to Copilot Pro");
7474
break;
7575
default:
@@ -118,7 +118,7 @@ export class ChatQuotaExceededPart extends Disposable implements IChatContentPar
118118
button1.label = button1Label;
119119
button1.element.classList.add('chat-quota-error-button');
120120
this._register(button1.onDidClick(async () => {
121-
const commandId = chatEntitlementService.entitlement === ChatEntitlement.Limited ? 'workbench.action.chat.upgradePlan' : 'workbench.action.chat.manageOverages';
121+
const commandId = chatEntitlementService.entitlement === ChatEntitlement.Free ? 'workbench.action.chat.upgradePlan' : 'workbench.action.chat.manageOverages';
122122
telemetryService.publicLog2<WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification>('workbenchActionExecuted', { id: commandId, from: 'chat-response' });
123123
await commandService.executeCommand(commandId);
124124

src/vs/workbench/contrib/chat/browser/chatInputPart.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
660660
}
661661

662662
// TODO@roblourens This is for an experiment which will be obsolete in a month or two and can then be removed.
663-
if (modelIsEmpty && this.entitlementService.entitlement !== ChatEntitlement.Limited) {
663+
if (modelIsEmpty && this.entitlementService.entitlement !== ChatEntitlement.Free) {
664664
const storageKey = this.getDefaultModeExperimentStorageKey();
665665
const hasSetDefaultMode = this.storageService.getBoolean(storageKey, StorageScope.WORKSPACE, false);
666666
if (!hasSetDefaultMode) {

src/vs/workbench/contrib/chat/browser/chatSetup.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ class ChatSetup {
636636
this.skipDialogOnce = false;
637637

638638
let setupStrategy: ChatSetupStrategy;
639-
if (dialogSkipped || isProUser(this.chatEntitlementService.entitlement) || this.chatEntitlementService.entitlement === ChatEntitlement.Limited) {
639+
if (dialogSkipped || isProUser(this.chatEntitlementService.entitlement) || this.chatEntitlementService.entitlement === ChatEntitlement.Free) {
640640
setupStrategy = ChatSetupStrategy.DefaultSetup; // existing pro/free users setup without a dialog
641641
} else {
642642
setupStrategy = await this.showDialog();
@@ -682,7 +682,7 @@ class ChatSetup {
682682
private async showDialog(): Promise<ChatSetupStrategy> {
683683
let dialogVariant = this.configurationService.getValue<'default' | 'modern' | 'brand-gh' | 'brand-vsc' | 'style-glow' | 'alt-first' | 'input-email' | 'account-create' | unknown>('chat.setup.signInDialogVariant');
684684
if (this.context.state.entitlement !== ChatEntitlement.Unknown && (dialogVariant === 'input-email' || dialogVariant === 'account-create')) {
685-
dialogVariant = 'default'; // fallback to default for users that are signed in already
685+
dialogVariant = this.productService.quality !== 'stable' ? 'modern' : 'default'; // fallback to modern/default for users that are signed in already
686686
}
687687

688688
if (dialogVariant === 'default') {
@@ -1168,14 +1168,14 @@ export class ChatSetupContribution extends Disposable implements IWorkbenchContr
11681168
f1: true,
11691169
precondition: ContextKeyExpr.or(
11701170
ChatContextKeys.Entitlement.canSignUp,
1171-
ChatContextKeys.Entitlement.limited,
1171+
ChatContextKeys.Entitlement.free,
11721172
),
11731173
menu: {
11741174
id: MenuId.ChatTitleBarMenu,
11751175
group: 'a_first',
11761176
order: 1,
11771177
when: ContextKeyExpr.and(
1178-
ChatContextKeys.Entitlement.limited,
1178+
ChatContextKeys.Entitlement.free,
11791179
ContextKeyExpr.or(
11801180
ChatContextKeys.chatQuotaExceeded,
11811181
ChatContextKeys.completionsQuotaExceeded
@@ -1429,8 +1429,8 @@ class ChatSetupController extends Disposable {
14291429
try {
14301430

14311431
if (
1432-
entitlement !== ChatEntitlement.Limited && // User is not signed up to Copilot Free
1433-
!isProUser(entitlement) && // User is not signed up for a Copilot subscription
1432+
entitlement !== ChatEntitlement.Free && // User is not signed up to Copilot Free
1433+
!isProUser(entitlement) && // User is not signed up for a Copilot subscription
14341434
entitlement !== ChatEntitlement.Unavailable // User is eligible for Copilot Free
14351435
) {
14361436
if (!session) {
@@ -1446,7 +1446,7 @@ class ChatSetupController extends Disposable {
14461446
}
14471447
}
14481448

1449-
signUpResult = await this.requests.signUpLimited(session);
1449+
signUpResult = await this.requests.signUpFree(session);
14501450

14511451
if (typeof signUpResult !== 'boolean' /* error */) {
14521452
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: 'failedSignUp', installDuration: watch.elapsed(), signUpErrorCode: signUpResult.errorCode });

src/vs/workbench/contrib/chat/browser/chatStatus.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export class ChatStatusBarEntry extends Disposable implements IWorkbenchContribu
191191
}
192192

193193
// Free Quota Exceeded
194-
else if (this.chatEntitlementService.entitlement === ChatEntitlement.Limited && (chatQuotaExceeded || completionsQuotaExceeded)) {
194+
else if (this.chatEntitlementService.entitlement === ChatEntitlement.Free && (chatQuotaExceeded || completionsQuotaExceeded)) {
195195
let quotaWarning: string;
196196
if (chatQuotaExceeded && !completionsQuotaExceeded) {
197197
quotaWarning = localize('chatQuotaExceededStatus', "Chat quota reached");
@@ -241,8 +241,8 @@ function canUseCopilot(chatEntitlementService: IChatEntitlementService): boolean
241241
const newUser = isNewUser(chatEntitlementService);
242242
const disabled = chatEntitlementService.sentiment.disabled;
243243
const signedOut = chatEntitlementService.entitlement === ChatEntitlement.Unknown;
244-
const limited = chatEntitlementService.entitlement === ChatEntitlement.Limited;
245-
const allFreeQuotaReached = limited && chatEntitlementService.quotas.chat?.percentRemaining === 0 && chatEntitlementService.quotas.completions?.percentRemaining === 0;
244+
const free = chatEntitlementService.entitlement === ChatEntitlement.Free;
245+
const allFreeQuotaReached = free && chatEntitlementService.quotas.chat?.percentRemaining === 0 && chatEntitlementService.quotas.completions?.percentRemaining === 0;
246246

247247
return !newUser && !signedOut && !allFreeQuotaReached && !disabled;
248248
}
@@ -342,7 +342,7 @@ class ChatStatusDashboard extends Disposable {
342342
this.element.appendChild($('div.description', undefined, localize('limitQuota', "Allowance resets {0}.", this.dateFormatter.value.format(new Date(resetDate)))));
343343
}
344344

345-
if (this.chatEntitlementService.entitlement === ChatEntitlement.Limited && (Number(chatQuota?.percentRemaining) <= 25 || Number(completionsQuota?.percentRemaining) <= 25)) {
345+
if (this.chatEntitlementService.entitlement === ChatEntitlement.Free && (Number(chatQuota?.percentRemaining) <= 25 || Number(completionsQuota?.percentRemaining) <= 25)) {
346346
const upgradeProButton = disposables.add(new Button(this.element, { ...defaultButtonStyles, secondary: canUseCopilot(this.chatEntitlementService) /* use secondary color when copilot can still be used */ }));
347347
upgradeProButton.label = localize('upgradeToCopilotPro', "Upgrade to Copilot Pro");
348348
disposables.add(upgradeProButton.onDidClick(() => this.runCommandAndClose('workbench.action.chat.upgradePlan')));

src/vs/workbench/contrib/chat/browser/modelPicker/modelPickerActionItem.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ function getModelPickerActionBarActions(menuService: IMenuService, contextKeySer
6161
additionalActions.push(...menuContributions);
6262
}
6363

64-
// Add upgrade option if entitlement is limited
65-
if (chatEntitlementService.entitlement === ChatEntitlement.Limited) {
64+
// Add upgrade option if entitlement is free
65+
if (chatEntitlementService.entitlement === ChatEntitlement.Free) {
6666
additionalActions.push({
6767
id: 'moreModels',
6868
label: localize('chat.moreModels', "Add Premium Models"),

src/vs/workbench/contrib/chat/common/chatContextKeys.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ export namespace ChatContextKeys {
5858

5959
export const Entitlement = {
6060
signedOut: new RawContextKey<boolean>('chatEntitlementSignedOut', false, true), // True when user is signed out.
61-
canSignUp: new RawContextKey<boolean>('chatPlanCanSignUp', false, true), // True when user can sign up to be a chat limited user.
62-
limited: new RawContextKey<boolean>('chatPlanLimited', false, true), // True when user is a chat limited user.
61+
canSignUp: new RawContextKey<boolean>('chatPlanCanSignUp', false, true), // True when user can sign up to be a chat free user.
62+
free: new RawContextKey<boolean>('chatPlanFree', false, true), // True when user is a chat free user.
6363
pro: new RawContextKey<boolean>('chatPlanPro', false, true), // True when user is a chat pro user.
6464
proPlus: new RawContextKey<boolean>('chatPlanProPlus', false, true), // True when user is a chat pro plus user.
6565
business: new RawContextKey<boolean>('chatPlanBusiness', false, true), // True when user is a chat business user.

0 commit comments

Comments
 (0)