mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 12:19:20 +00:00
* Chat: "Pick Model" appears with empty picker if aborting chat setup (fix #272829) * Update src/vs/workbench/contrib/chat/browser/modelPicker/modelPickerActionItem.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -84,7 +84,7 @@ function getModelPickerActionBarActionProvider(commandService: ICommandService,
|
||||
id: 'manageModels',
|
||||
label: localize('chat.manageModels', "Manage Models..."),
|
||||
enabled: true,
|
||||
tooltip: localize('chat.manageModels.tooltip', "Manage language models"),
|
||||
tooltip: localize('chat.manageModels.tooltip', "Manage Language Models"),
|
||||
class: undefined,
|
||||
run: () => {
|
||||
const commandId = ManageModelsAction.ID;
|
||||
@@ -93,16 +93,17 @@ function getModelPickerActionBarActionProvider(commandService: ICommandService,
|
||||
});
|
||||
}
|
||||
|
||||
// Add sign-in / upgrade option if entitlement is anonymous / free
|
||||
if (chatEntitlementService.anonymous || chatEntitlementService.entitlement === ChatEntitlement.Free) {
|
||||
// Add sign-in / upgrade option if entitlement is anonymous / free / new user
|
||||
const isNewOrAnonymousUser = !chatEntitlementService.sentiment.installed || chatEntitlementService.entitlement === ChatEntitlement.Available || chatEntitlementService.anonymous;
|
||||
if (isNewOrAnonymousUser || chatEntitlementService.entitlement === ChatEntitlement.Free) {
|
||||
additionalActions.push({
|
||||
id: 'moreModels',
|
||||
label: localize('chat.moreModels', "Add Premium Models"),
|
||||
label: isNewOrAnonymousUser ? localize('chat.moreModels', "Add Language Models") : localize('chat.morePremiumModels', "Add Premium Models"),
|
||||
enabled: true,
|
||||
tooltip: localize('chat.moreModels.tooltip', "Add premium models"),
|
||||
tooltip: isNewOrAnonymousUser ? localize('chat.moreModels.tooltip', "Add Language Models") : localize('chat.morePremiumModels.tooltip', "Add Premium Models"),
|
||||
class: undefined,
|
||||
run: () => {
|
||||
const commandId = chatEntitlementService.anonymous ? 'workbench.action.chat.triggerSetup' : 'workbench.action.chat.upgradePlan';
|
||||
const commandId = isNewOrAnonymousUser ? 'workbench.action.chat.triggerSetup' : 'workbench.action.chat.upgradePlan';
|
||||
commandService.executeCommand(commandId);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user