Skip to content

Commit 3a3df5d

Browse files
Updates wording
1 parent 6e1ec7e commit 3a3df5d

File tree

2 files changed

+32
-24
lines changed

2 files changed

+32
-24
lines changed

src/plus/ai/aiProviderService.ts

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,43 +1613,51 @@ export class AIProviderService implements Disposable {
16131613
(compareSubscriptionPlans(subscription.plan.actual.id, 'advanced') >= 0 ||
16141614
compareSubscriptionPlans(subscription.plan.effective.id, 'advanced') >= 0);
16151615

1616-
const message = hasAdvancedOrHigher
1617-
? 'Get unlimited AI tokens in GitLens until July 11th!'
1618-
: 'Get unlimited AI tokens and try all GitLens Advanced features for free until July 11th!';
1616+
let body = 'All Access Week - now until July 11th!';
1617+
const detail = hasAdvancedOrHigher ? 'Opt in now to get unlimited GitKraken AI until July 11th!' : 'Opt in now to try all Advanced GitLens features with unlimited GitKraken AI for FREE until July 11th!';
16191618

1620-
const buttonText = hasAdvancedOrHigher
1621-
? 'Get Unlimited AI Tokens'
1622-
: 'Try Advanced for Free';
1619+
if (!usingGkProvider) {
1620+
body += ` ${detail}`;
1621+
}
1622+
1623+
const optInButton: MessageItem = usingGkProvider ? { title: 'Opt in for Unlimited AI' } : { title: 'Opt in and Switch to GitKraken AI' };
1624+
const dismissButton: MessageItem = { title: 'No, Thanks', isCloseAffordance: true };
16231625

16241626
// Show the notification
1625-
const result = await window.showInformationMessage(message, { modal: usingGkProvider }, buttonText);
1627+
const result = await window.showInformationMessage(body, { modal: usingGkProvider, detail: detail }, optInButton, dismissButton);
16261628

16271629
// Mark notification as shown regardless of user action
16281630
void this.container.storage.store(`gk:promo:${userId}:ai:allAccess:notified`, true);
16291631

16301632
// If user clicked the button, trigger the opt-in command
1631-
if (result === buttonText) {
1632-
const optIn = await this.container.subscription.aiAllAccessOptIn({ source: 'notification' });
1633-
if (optIn && !usingGkProvider && isProviderEnabledByOrg('gitkraken')) {
1634-
const gkProvider = new GitKrakenProvider(this.container, this.connection);
1635-
const defaultModel = (await gkProvider.getModels()).find(m => m.default);
1636-
if (defaultModel != null) {
1637-
this._provider = gkProvider;
1638-
this._model = defaultModel;
1639-
if (isPrimaryAIProviderModel(defaultModel)) {
1640-
await configuration.updateEffective('ai.model', 'gitkraken');
1641-
await configuration.updateEffective(`ai.gitkraken.model`, defaultModel.id);
1642-
} else {
1643-
await configuration.updateEffective('ai.model', `gitkraken:${defaultModel.id}` as SupportedAIModels);
1644-
}
1633+
if (result === optInButton) {
1634+
void this.allAccessOptIn(usingGkProvider);
1635+
}
1636+
}
16451637

1646-
this._onDidChangeModel.fire({ model: defaultModel });
1638+
private async allAccessOptIn(usingGkProvider?: boolean): Promise<void> {
1639+
const optIn = await this.container.subscription.aiAllAccessOptIn({ source: 'notification' });
1640+
if (optIn && !usingGkProvider && isProviderEnabledByOrg('gitkraken')) {
1641+
const gkProvider = new GitKrakenProvider(this.container, this.connection);
1642+
const defaultModel = (await gkProvider.getModels()).find(m => m.default);
1643+
if (defaultModel != null) {
1644+
this._provider = gkProvider;
1645+
this._model = defaultModel;
1646+
if (isPrimaryAIProviderModel(defaultModel)) {
1647+
await configuration.updateEffective('ai.model', 'gitkraken');
1648+
await configuration.updateEffective(`ai.gitkraken.model`, defaultModel.id);
1649+
} else {
1650+
await configuration.updateEffective('ai.model', `gitkraken:${defaultModel.id}` as SupportedAIModels);
16471651
}
1652+
1653+
this._onDidChangeModel.fire({ model: defaultModel });
16481654
}
16491655
}
16501656
}
16511657
}
16521658

1659+
1660+
16531661
async function showConfirmAIProviderToS(storage: Storage): Promise<boolean> {
16541662
const confirmed = storage.get(`confirm:ai:tos`, false) || storage.getWorkspace(`confirm:ai:tos`, false);
16551663
if (confirmed) return true;

src/webviews/apps/home/components/ai-all-access-banner.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ export class GlAiAllAccessBanner extends LitElement {
4545
}
4646

4747
private get bodyLabel(): string {
48-
return this.hasAdvancedOrHigher ? 'Join now and get unlimited AI tokens in GitLens until July 11th!' : 'Join now to try all Advanced GitLens features with unlimited AI tokens for FREE!';
48+
return this.hasAdvancedOrHigher ? 'Opt in now to get unlimited GitKraken AI until July 11th!' : 'Opt in now to try all Advanced GitLens features with unlimited GitKraken AI for FREE until July 11th!';
4949

5050
}
5151

5252
private get primaryButtonLabel(): string {
53-
return this.hasAdvancedOrHigher ? 'Get Unlimited AI Tokens' : 'Try Advanced for Free';
53+
return 'Opt In Now';
5454
}
5555

5656
private get hasAdvancedOrHigher(): boolean {

0 commit comments

Comments
 (0)