Skip to content

Commit f13705e

Browse files
committed
Updates content & urls
1 parent caa1c7c commit f13705e

File tree

13 files changed

+254
-124
lines changed

13 files changed

+254
-124
lines changed

package.json

Lines changed: 7 additions & 7 deletions
Large diffs are not rendered by default.

src/commands/walkthroughs.ts

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,42 @@
1-
import type { WalkthroughSteps } from '../constants';
1+
import type { TelemetrySources, WalkthroughSteps } from '../constants';
22
import { Commands } from '../constants';
33
import type { Container } from '../container';
44
import { command } from '../system/command';
55
import { openWalkthrough } from '../system/utils';
66
import { Command } from './base';
77

8-
export type GetStartedCommandArgs = WalkthroughSteps | undefined;
9-
108
@command()
119
export class GetStartedCommand extends Command {
1210
constructor(private readonly container: Container) {
1311
super(Commands.GetStarted);
1412
}
1513

16-
execute(stepId?: WalkthroughSteps) {
17-
const extensionId = this.container.context.extension.id;
18-
// If the walkthroughId param is the same as the extension id, then this was run from the extensions view gear menu
19-
if (stepId === extensionId) {
20-
stepId = undefined;
14+
execute() {
15+
void openWalkthrough(this.container.context.extension.id, 'welcome', undefined, false);
16+
}
17+
}
18+
19+
export type OpenWalkthroughCommandArgs = {
20+
step?: WalkthroughSteps | undefined;
21+
source: TelemetrySources;
22+
detail?: string;
23+
};
24+
25+
@command()
26+
export class OpenWalkthroughCommand extends Command {
27+
constructor(private readonly container: Container) {
28+
super(Commands.OpenWalkthrough);
29+
}
30+
31+
execute(args?: OpenWalkthroughCommandArgs) {
32+
if (this.container.telemetry.enabled) {
33+
this.container.telemetry.sendEvent('walkthrough', {
34+
step: args?.step,
35+
source: args?.source ?? 'commandPalette',
36+
detail: args?.detail,
37+
});
2138
}
2239

23-
void openWalkthrough(extensionId, 'welcome', stepId, false);
40+
void openWalkthrough(this.container.context.extension.id, 'welcome', args?.step, false);
2441
}
2542
}

src/constants.ts

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const previewBadge = 'ᴘʀᴇᴠɪᴇᴡ';
1515
export const proBadge = 'ᴘʀᴏ';
1616
export const proBadgeSuperscript = 'ᴾᴿᴼ';
1717

18-
export const ImageMimetypes: Record<string, string> = {
18+
export const ImageMimetypes: Record<string, string> = Object.freeze({
1919
'.png': 'image/png',
2020
'.gif': 'image/gif',
2121
'.jpg': 'image/jpeg',
@@ -25,7 +25,21 @@ export const ImageMimetypes: Record<string, string> = {
2525
'.tif': 'image/tiff',
2626
'.tiff': 'image/tiff',
2727
'.bmp': 'image/bmp',
28-
};
28+
});
29+
30+
export const urls = Object.freeze({
31+
codeSuggest: 'https://gitkraken.com/solutions/code-suggest?utm_source=gitlens-extension&utm_medium=in-app-links',
32+
cloudPatches: 'https://gitkraken.com/solutions/cloud-patches?utm_source=gitlens-extension&utm_medium=in-app-links',
33+
launchpad: 'https://gitkraken.com/solutions/launchpad?utm_source=gitlens-extension&utm_medium=in-app-links',
34+
platform: 'https://gitkraken.com/devex?utm_source=gitlens-extension&utm_medium=in-app-links',
35+
proFeatures: 'https://gitkraken.com/gitlens/pro-features?utm_source=gitlens-extension&utm_medium=in-app-links',
36+
security: 'https://help.gitkraken.com/gitlens/security?utm_source=gitlens-extension&utm_medium=in-app-links',
37+
workspaces: 'https://gitkraken.com/solutions/workspaces?utm_source=gitlens-extension&utm_medium=in-app-links',
38+
cli: 'https://gitkraken.com/cli?utm_source=gitlens-extension&utm_medium=in-app-links',
39+
browserExtension: 'https://gitkraken.com/browser-extension?utm_source=gitlens-extension&utm_medium=in-app-links',
40+
desktop: 'https://gitkraken.com/git-client?utm_source=gitlens-extension&utm_medium=in-app-links',
41+
gkdev: 'https://gitkraken.dev?utm_source=gitlens-extension&utm_medium=in-app-links',
42+
});
2943

3044
export const enum CharCode {
3145
/**
@@ -217,6 +231,7 @@ export const enum Commands {
217231
OpenRevisionFile = 'gitlens.openRevisionFile',
218232
OpenRevisionFileInDiffLeft = 'gitlens.openRevisionFileInDiffLeft',
219233
OpenRevisionFileInDiffRight = 'gitlens.openRevisionFileInDiffRight',
234+
OpenWalkthrough = 'gitlens.openWalkthrough',
220235
OpenWorkingFile = 'gitlens.openWorkingFile',
221236
OpenWorkingFileInDiffLeft = 'gitlens.openWorkingFileInDiffLeft',
222237
OpenWorkingFileInDiffRight = 'gitlens.openWorkingFileInDiffRight',
@@ -841,7 +856,20 @@ export type TelemetryEvents =
841856
| 'repository/visibility'
842857
| 'subscription'
843858
| 'subscription/changed'
844-
| 'usage/track';
859+
| 'usage/track'
860+
| 'walkthrough';
861+
862+
export type TelemetrySources =
863+
| 'cloud-patches'
864+
| 'commandPalette'
865+
| 'home'
866+
| 'launchpad'
867+
| 'launchpad-indicator'
868+
| 'notification'
869+
| 'prompt'
870+
| 'trial-indicator'
871+
| 'walkthrough'
872+
| 'welcome';
845873

846874
export type AIProviders = 'anthropic' | 'gemini' | 'openai';
847875
export type AIModels<Provider extends AIProviders = AIProviders> = Provider extends 'openai'

src/plus/focus/focusIndicator.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { ConfigurationChangeEvent, StatusBarItem } from 'vscode';
22
import { Disposable, MarkdownString, StatusBarAlignment, ThemeColor, window } from 'vscode';
3-
import type { GetStartedCommandArgs } from '../../commands/walkthroughs';
3+
import type { OpenWalkthroughCommandArgs } from '../../commands/walkthroughs';
44
import type { Colors } from '../../constants';
55
import { Commands, previewBadge } from '../../constants';
66
import type { Container } from '../../container';
@@ -465,7 +465,11 @@ export class FocusIndicator implements Disposable {
465465
this.storeFirstInteractionIfNeeded();
466466
switch (action) {
467467
case 'info': {
468-
void executeCommand<GetStartedCommandArgs>(Commands.GetStarted, 'launchpad');
468+
void executeCommand<OpenWalkthroughCommandArgs>(Commands.OpenWalkthrough, {
469+
step: 'launchpad',
470+
source: 'launchpad-indicator',
471+
detail: 'info',
472+
});
469473
break;
470474
}
471475
case 'hide': {

src/plus/gk/account/subscriptionService.ts

Lines changed: 80 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ import {
2121
window,
2222
} from 'vscode';
2323
import { getPlatform } from '@env/platform';
24-
import type { CoreColors } from '../../../constants';
25-
import { Commands } from '../../../constants';
24+
import type { OpenWalkthroughCommandArgs } from '../../../commands/walkthroughs';
25+
import type { CoreColors, TelemetrySources } from '../../../constants';
26+
import { Commands, urls } from '../../../constants';
2627
import type { Container } from '../../../container';
2728
import { AccountValidationError } from '../../../errors';
2829
import type { RepositoriesChangeEvent } from '../../../git/gitProviderService';
@@ -40,7 +41,6 @@ import { Logger } from '../../../system/logger';
4041
import { getLogScope, setLogScopeExit } from '../../../system/logger.scope';
4142
import { flatten } from '../../../system/object';
4243
import { pluralize } from '../../../system/string';
43-
import { openWalkthrough } from '../../../system/utils';
4444
import { satisfies } from '../../../system/version';
4545
import type { GKCheckInResponse } from '../checkin';
4646
import { getSubscriptionFromCheckIn } from '../checkin';
@@ -209,22 +209,46 @@ export class SubscriptionService implements Disposable {
209209
}
210210

211211
@debug()
212-
async learnAboutPreviewOrTrial() {
212+
async learnAboutPro(source: TelemetrySources, detail?: string): Promise<void> {
213213
const subscription = await this.getSubscription();
214-
if (subscription.state === SubscriptionState.FreeInPreviewTrial) {
215-
void openWalkthrough(
216-
this.container.context.extension.id,
217-
'gitlens.welcome',
218-
'gitlens.welcome.preview',
219-
false,
220-
);
221-
} else if (subscription.state === SubscriptionState.FreePlusInTrial) {
222-
void openWalkthrough(
223-
this.container.context.extension.id,
224-
'gitlens.welcome',
225-
'gitlens.welcome.trial',
226-
false,
227-
);
214+
switch (subscription.state) {
215+
case SubscriptionState.Free:
216+
case SubscriptionState.FreeInPreviewTrial:
217+
case SubscriptionState.FreePreviewTrialExpired:
218+
void executeCommand<OpenWalkthroughCommandArgs>(Commands.OpenWalkthrough, {
219+
step: 'pro-features',
220+
source: source,
221+
detail: detail,
222+
});
223+
break;
224+
case SubscriptionState.FreePlusInTrial:
225+
void executeCommand<OpenWalkthroughCommandArgs>(Commands.OpenWalkthrough, {
226+
step: 'pro-trial',
227+
source: source,
228+
detail: detail,
229+
});
230+
break;
231+
case SubscriptionState.FreePlusTrialExpired:
232+
void executeCommand<OpenWalkthroughCommandArgs>(Commands.OpenWalkthrough, {
233+
step: 'pro-upgrade',
234+
source: source,
235+
detail: detail,
236+
});
237+
break;
238+
case SubscriptionState.FreePlusTrialReactivationEligible:
239+
void executeCommand<OpenWalkthroughCommandArgs>(Commands.OpenWalkthrough, {
240+
step: 'pro-reactivate',
241+
source: source,
242+
detail: detail,
243+
});
244+
break;
245+
case SubscriptionState.Paid:
246+
void executeCommand<OpenWalkthroughCommandArgs>(Commands.OpenWalkthrough, {
247+
step: 'pro-paid',
248+
source: source,
249+
detail: detail,
250+
});
251+
break;
228252
}
229253
}
230254

@@ -245,19 +269,33 @@ export class SubscriptionService implements Disposable {
245269
} = this._subscription;
246270

247271
if (account?.verified === false) {
248-
const confirm: MessageItem = { title: 'Resend Verification' };
249-
const cancel: MessageItem = { title: 'Cancel', isCloseAffordance: true };
272+
const days = getSubscriptionTimeRemaining(this._subscription, 'days') ?? 7;
273+
274+
const verify: MessageItem = { title: 'Resend Email' };
275+
const learn: MessageItem = { title: 'See Pro Features' };
276+
const confirm: MessageItem = { title: 'Continue', isCloseAffordance: true };
250277
const result = await window.showInformationMessage(
251-
`You must verify your email before you can access ${effective.name}.`,
278+
`Welcome to your ${
279+
effective.name
280+
} Trial.\n\nYou must first verify your email. Once verified, you will have full access to Pro features for ${
281+
days < 1 ? '<1 more day' : pluralize('day', days, { infix: ' more ' })
282+
}.`,
283+
{
284+
modal: true,
285+
detail: 'Your trial also includes access to our DevEx platform, unleashing powerful Git visualization & productivity capabilities everywhere you work: IDE, desktop, browser, and terminal.',
286+
},
287+
verify,
288+
learn,
252289
confirm,
253-
cancel,
254290
);
255291

256-
if (result === confirm) {
292+
if (result === verify) {
257293
void this.resendVerification();
294+
} else if (result === learn) {
295+
void this.learnAboutPro('prompt', 'trial-started-verify-email');
258296
}
259297
} else if (isSubscriptionPaid(this._subscription)) {
260-
const learn: MessageItem = { title: 'Learn More' };
298+
const learn: MessageItem = { title: 'See Pro Features' };
261299
const confirm: MessageItem = { title: 'Continue', isCloseAffordance: true };
262300
const result = await window.showInformationMessage(
263301
`You are now on the ${actual.name} plan and have full access to Pro features.`,
@@ -270,12 +308,12 @@ export class SubscriptionService implements Disposable {
270308
);
271309

272310
if (result === learn) {
273-
void env.openExternal(Uri.parse('https://www.gitkraken.com/suite'));
311+
void this.learnAboutPro('prompt', 'upgraded');
274312
}
275313
} else if (isSubscriptionTrial(this._subscription)) {
276314
const days = getSubscriptionTimeRemaining(this._subscription, 'days') ?? 0;
277315

278-
const learn: MessageItem = { title: 'Learn More' };
316+
const learn: MessageItem = { title: 'See Pro Features' };
279317
const confirm: MessageItem = { title: 'Continue', isCloseAffordance: true };
280318
const result = await window.showInformationMessage(
281319
`Welcome to your ${effective.name} Trial.\n\nYou now have full access to Pro features for ${
@@ -290,11 +328,11 @@ export class SubscriptionService implements Disposable {
290328
);
291329

292330
if (result === learn) {
293-
void this.learnAboutPreviewOrTrial();
331+
void this.learnAboutPro('prompt', 'trial-started');
294332
}
295333
} else {
296334
const upgrade: MessageItem = { title: 'Upgrade to Pro' };
297-
const learn: MessageItem = { title: 'Learn More' };
335+
const learn: MessageItem = { title: 'See Pro Features' };
298336
const confirm: MessageItem = { title: 'Continue', isCloseAffordance: true };
299337
const result = await window.showInformationMessage(
300338
`You are now on the ${actual.name} plan.`,
@@ -307,10 +345,10 @@ export class SubscriptionService implements Disposable {
307345
confirm,
308346
);
309347

310-
if (result === learn) {
311-
void env.openExternal(Uri.parse('https://www.gitkraken.com/suite'));
312-
} else if (result === upgrade) {
348+
if (result === upgrade) {
313349
void this.purchase();
350+
} else if (result === learn) {
351+
void this.learnAboutPro('prompt', 'trial-ended');
314352
}
315353
}
316354
}
@@ -536,8 +574,8 @@ export class SubscriptionService implements Disposable {
536574

537575
if (!silent) {
538576
setTimeout(async () => {
539-
const confirm: MessageItem = { title: 'OK' };
540-
const learn: MessageItem = { title: 'Learn More' };
577+
const confirm: MessageItem = { title: 'Continue' };
578+
const learn: MessageItem = { title: 'See Pro Features' };
541579
const result = await window.showInformationMessage(
542580
`You can now preview local Pro features for ${
543581
days < 1 ? '1 day' : pluralize('day', days)
@@ -547,7 +585,7 @@ export class SubscriptionService implements Disposable {
547585
);
548586

549587
if (result === learn) {
550-
void this.learnAboutPreviewOrTrial();
588+
void this.learnAboutPro('notification', 'preview-started');
551589
}
552590
}, 1);
553591
}
@@ -1172,14 +1210,15 @@ export class SubscriptionService implements Disposable {
11721210
this._statusBarSubscription.tooltip = new MarkdownString(
11731211
`${
11741212
isReactivatedTrial
1175-
? `[See what's new](https://help.gitkraken.com/gitlens/gitlens-release-notes-current/) with
1176-
${pluralize('day', remaining ?? 0, {
1177-
infix: ' more ',
1178-
})}
1179-
in your **${effective.name}** trial.`
1213+
? `[See what's new](https://help.gitkraken.com/gitlens/gitlens-release-notes-current/) with ${pluralize(
1214+
'day',
1215+
remaining ?? 0,
1216+
{ infix: ' more ' },
1217+
)} in your **${effective.name}** trial.`
11801218
: `You have ${pluralize('day', remaining ?? 0)} remaining in your **${effective.name}** trial.`
1181-
} Once your trial ends, you'll need a paid plan for full access to Pro features.\n\nTry our
1182-
[other developer tools](https://www.gitkraken.com/suite) also included in your trial.`,
1219+
} Once your trial ends, you'll need a paid plan for full access to [Pro features](command:gitlens.openWalkthrough?{"source": "trial-indicator" }).\n\nYour trial also includes access to our [DevEx platform](${
1220+
urls.platform
1221+
}), unleashing powerful Git visualization & productivity capabilities everywhere you work: IDE, desktop, browser, and terminal.`,
11831222
true,
11841223
);
11851224
}

src/plus/utils.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import type { MessageItem } from 'vscode';
2-
import { env, Uri, window } from 'vscode';
2+
import { window } from 'vscode';
3+
import { urls } from '../constants';
34
import type { Container } from '../container';
5+
import { openUrl } from '../system/utils';
46
import { isSubscriptionPaidPlan, isSubscriptionPreviewTrialExpired } from './gk/account/subscription';
57

68
export async function ensurePaidPlan(
@@ -158,12 +160,12 @@ export async function confirmDraftStorage(container: Container): Promise<boolean
158160
}
159161

160162
if (result === security) {
161-
void env.openExternal(Uri.parse('https://help.gitkraken.com/gitlens/security'));
163+
void openUrl(urls.security);
162164
continue;
163165
}
164166

165167
if (result === moreInfo) {
166-
void env.openExternal(Uri.parse('https://www.gitkraken.com/solutions/cloud-patches'));
168+
void openUrl(urls.cloudPatches);
167169
continue;
168170
}
169171

src/views/draftsView.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { CancellationToken, TreeViewVisibilityChangeEvent } from 'vscode';
22
import { Disposable, TreeItem, TreeItemCollapsibleState, window } from 'vscode';
3-
import type { GetStartedCommandArgs } from '../commands/walkthroughs';
3+
import type { OpenWalkthroughCommandArgs } from '../commands/walkthroughs';
44
import type { DraftsViewConfig } from '../config';
55
import { Commands, previewBadge } from '../constants';
66
import type { Container } from '../container';
@@ -119,7 +119,12 @@ export class DraftsView extends ViewBase<'drafts', DraftsViewNode, DraftsViewCon
119119
return [
120120
registerViewCommand(
121121
this.getQualifiedCommand('info'),
122-
() => executeCommand<GetStartedCommandArgs>(Commands.GetStarted, 'code-collab'),
122+
() =>
123+
executeCommand<OpenWalkthroughCommandArgs>(Commands.OpenWalkthrough, {
124+
step: 'code-collab',
125+
source: 'cloud-patches',
126+
detail: 'info',
127+
}),
123128
this,
124129
),
125130
registerViewCommand(

0 commit comments

Comments
 (0)