Skip to content

Commit 3d4b046

Browse files
eamodiosergiolms
andcommitted
Improves trials and messaging
- Adds incremental feature preview system (graph only) - Extends trial period from 7 to 14 days - Improves clarity around Community vs Pro features Co-authored-by: Sergio <[email protected]>
1 parent 38c5a80 commit 3d4b046

37 files changed

+860
-314
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ GitLens isn’t just for solo developers—it’s designed to enhance team colla
154154

155155
## Cloud Patches `Preview`
156156

157-
Easily and securely share code changes by creating a Cloud Patch from your work-in-progress, commit, or stash, and sharing a link with teammates or other developers. Cloud Patches enable early collaboration for feedback on direction and approach, reducing rework and streamlining your workflow. [Learn more](https://gitkraken.com/solutions/cloud-patches?utm_source=gitlens-extension&utm_medium=in-app-links)
157+
Privately and securely share code changes by creating a Cloud Patch from your work-in-progress, commit, or stash, and sharing a link with specific teammates and other developers. Cloud Patches enable early collaboration for feedback on direction and approach, reducing rework and streamlining your workflow, without adding noise to your repositories. [Learn more](https://gitkraken.com/solutions/cloud-patches?utm_source=gitlens-extension&utm_medium=in-app-links)
158158

159159
## Code Suggest `Preview`
160160

@@ -192,7 +192,7 @@ An x-ray or developer tools Inspect into your code, focused on providing context
192192
Quick access to many GitLens features. Also the home of GitKraken teams and collaboration services (e.g. Cloud Patches, Cloud Workspaces), help, and support.
193193

194194
- **Home** &mdash; Quick access to many features.
195-
- [**Cloud Patches `Preview`**](#cloud-patches-preview) &mdash; Easily and securely share code with your teammates
195+
- [**Cloud Patches `Preview`**](#cloud-patches-preview) &mdash; Privately and securely share code with specific teammates
196196
- [**Cloud Workspaces `Preview`**](#gitkraken-workspaces-preview) &mdash; Easily group and manage multiple repositories together, accessible from anywhere, streamlining your workflow.
197197

198198
### Source Control
@@ -282,7 +282,7 @@ Use the `Generate Commit Message` command from the Source Control view's context
282282

283283
When you're ready to unlock the full potential of GitLens and enjoy all the benefits, consider [upgrading to GitLens Pro](https://gitkraken.dev/register?product=gitlens&source=marketing_page&redirect_uri=vscode%3A%2F%2Feamodio.gitlens%2Flogin&flow=gitlens_web). With GitLens Pro, you'll gain access to [Pro features](https://gitkraken.com/gitlens/pro-features?utm_source=gitlens-extension&utm_medium=in-app-links) on privately-hosted repos.
284284

285-
To learn more about the additional features offered with Pro, visit the [GitLens Community vs GitLens Pro](https://help.gitkraken.com/gitlens/gitlens-community-vs-gitlens-pro/?utm_source=gitlens-extension&utm_medium=in-app-links&utm_campaign=readme&utm_term=ready-for-gitlens-pro) page.
285+
To learn more about the additional features offered with Pro, visit the [GitLens Community vs GitLens Pro](https://help.gitkraken.com/gitlens/gitlens-community-vs-gitlens-pro/?utm_source=gitlens-extension&utm_medium=in-app-links&utm_campaign=readme&utm_term=ready-for-gitlens-pro) page.
286286

287287
# Support and Community
288288

package.json

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

src/@types/global.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ export declare global {
88
export type Mutable<T> = { -readonly [P in keyof T]: T[P] };
99
export type PickMutable<T, K extends keyof T> = Omit<T, K> & { -readonly [P in K]: T[P] };
1010

11+
export type EntriesType<T> = T extends Record<infer K, infer V> ? [K, V] : never;
12+
1113
export type ExcludeSome<T, K extends keyof T, R> = Omit<T, K> & { [P in K]-?: Exclude<T[P], R> };
1214

1315
export type ExtractAll<T, U> = { [K in keyof T]: T[K] extends U ? T[K] : never };

src/commands/quickCommand.steps.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2648,9 +2648,9 @@ export async function* ensureAccessStep<
26482648
const promo = getApplicablePromo(access.subscription.current.state, 'gate');
26492649
const detail = promo?.quickpick.detail;
26502650

2651-
placeholder = 'Pro feature — requires a trial or paid plan for use on privately-hosted repos';
2651+
placeholder = 'Pro feature — requires a trial or GitLens Pro for use on privately-hosted repos';
26522652
if (isSubscriptionPaidPlan(access.subscription.required) && access.subscription.current.account != null) {
2653-
placeholder = 'Pro feature — requires a paid plan for use on privately-hosted repos';
2653+
placeholder = 'Pro feature — requires GitLens Pro for use on privately-hosted repos';
26542654
directives.push(
26552655
createDirectiveQuickPickItem(Directive.RequiresPaidSubscription, true, { detail: detail }),
26562656
createQuickPickSeparator(),

src/commands/resets.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ const resetTypes = [
1313
'ai',
1414
'avatars',
1515
'integrations',
16+
'previews',
1617
'repositoryAccess',
18+
'subscription',
1719
'suppressedWarnings',
1820
'usageTracking',
1921
'workspace',
@@ -73,6 +75,22 @@ export class ResetCommand extends Command {
7375
},
7476
];
7577

78+
if (DEBUG) {
79+
items.push(
80+
createQuickPickSeparator('DEBUG'),
81+
{
82+
label: 'Reset Subscription...',
83+
detail: 'Resets the stored subscription',
84+
item: 'subscription',
85+
},
86+
{
87+
label: 'Reset Feature Previews...',
88+
detail: 'Resets the stored state for feature previews',
89+
item: 'previews',
90+
},
91+
);
92+
}
93+
7694
// create a quick pick with options to clear all the different resets that GitLens supports
7795
const pick = await window.showQuickPick<ResetQuickPickItem>(items, {
7896
title: 'Reset Stored Data',
@@ -102,10 +120,18 @@ export class ResetCommand extends Command {
102120
confirmationMessage = 'Are you sure you want to reset all of the stored integrations?';
103121
confirm.title = 'Reset Integrations';
104122
break;
123+
case 'previews':
124+
confirmationMessage = 'Are you sure you want to reset the stored state for feature previews?';
125+
confirm.title = 'Reset Feature Previews';
126+
break;
105127
case 'repositoryAccess':
106128
confirmationMessage = 'Are you sure you want to reset the repository access cache?';
107129
confirm.title = 'Reset Repository Access';
108130
break;
131+
case 'subscription':
132+
confirmationMessage = 'Are you sure you want to reset the stored subscription?';
133+
confirm.title = 'Reset Subscription';
134+
break;
109135
case 'suppressedWarnings':
110136
confirmationMessage = 'Are you sure you want to reset all of the suppressed warnings?';
111137
confirm.title = 'Reset Suppressed Warnings';
@@ -170,6 +196,18 @@ export class ResetCommand extends Command {
170196
case 'workspace':
171197
await this.container.storage.resetWorkspace();
172198
break;
199+
default:
200+
if (DEBUG) {
201+
switch (reset) {
202+
case 'subscription':
203+
await this.container.storage.delete('premium:subscription');
204+
break;
205+
case 'previews':
206+
await this.container.storage.deleteWithPrefix('plus:preview');
207+
break;
208+
}
209+
}
210+
break;
173211
}
174212
}
175213
}

src/constants.commands.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ export const enum Commands {
150150
PlusShowPlans = 'gitlens.plus.showPlans',
151151
PlusSignUp = 'gitlens.plus.signUp',
152152
PlusStartPreviewTrial = 'gitlens.plus.startPreviewTrial',
153+
PlusContinueFeaturePreview = 'gitlens.plus.continueFeaturePreview',
153154
PlusUpgrade = 'gitlens.plus.upgrade',
154155
PlusValidate = 'gitlens.plus.validate',
155156
PlusSimulateSubscription = 'gitlens.plus.simulateSubscription',

src/constants.context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export type ContextKeys = {
1919
'gitlens:newInstall': boolean;
2020
/** Indicates that this is a new install of GitLens (anywhere for this user -- if synced settings is on) */
2121
'gitlens:newUserInstall': boolean;
22-
'gitlens:plus': SubscriptionPlanId;
22+
'gitlens:plus': Exclude<SubscriptionPlanId, SubscriptionPlanId.Community>;
2323
'gitlens:plus:disallowedRepos': string[];
2424
'gitlens:plus:enabled': boolean;
2525
'gitlens:plus:required': boolean;

src/constants.storage.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { IntegrationId } from './constants.integrations';
44
import type { TrackedUsage, TrackedUsageKeys } from './constants.telemetry';
55
import type { GroupableTreeViewTypes } from './constants.views';
66
import type { Environment } from './container';
7+
import type { FeaturePreviews } from './features';
78
import type { Subscription } from './plus/gk/account/subscription';
89
import type { Integration } from './plus/integrations/integration';
910
import type { DeepLinkServiceState } from './uris/deepLinks/deepLink';
@@ -77,7 +78,9 @@ export type GlobalStorage = {
7778
'launchpadView:groups:expanded': StoredLaunchpadGroup[];
7879
'graph:searchMode': StoredGraphSearchMode;
7980
'views:scm:grouped:welcome:dismissed': boolean;
80-
} & { [key in `confirm:ai:tos:${AIProviders}`]: boolean } & {
81+
} & { [key in `plus:preview:${FeaturePreviews}:usages`]: StoredFeaturePreviewUsagePeriod[] } & {
82+
[key in `confirm:ai:tos:${AIProviders}`]: boolean;
83+
} & {
8184
[key in `provider:authentication:skip:${string}`]: boolean;
8285
} & { [key in `gk:${string}:checkin`]: Stored<StoredGKCheckInResponse> } & {
8386
[key in `gk:${string}:organizations`]: Stored<StoredOrganization[]>;
@@ -309,3 +312,8 @@ export type StoredLaunchpadGroup =
309312
| 'draft'
310313
| 'other'
311314
| 'snoozed';
315+
316+
export interface StoredFeaturePreviewUsagePeriod {
317+
startedOn: string;
318+
expiresOn: string;
319+
}

src/constants.subscription.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
export const proPreviewLengthInDays = 3;
2-
export const proTrialLengthInDays = 7;
1+
export const proFeaturePreviewUsages = 3;
2+
export const proFeaturePreviewUsageDurationInDays = 1;
3+
export const proPreviewLengthInDays = 0;
4+
export const proTrialLengthInDays = 14;
35

46
export type PromoKeys = 'gitlens16' | 'pro50';
57

src/constants.telemetry.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { Commands } from './constants.commands';
55
import type { IntegrationId, SupportedCloudIntegrationIds } from './constants.integrations';
66
import type { SubscriptionState } from './constants.subscription';
77
import type { CustomEditorTypes, TreeViewTypes, WebviewTypes, WebviewViewTypes } from './constants.views';
8+
import type { FeaturePreviews } from './features';
89
import type { GitContributionTiers } from './git/models/contributor';
910
import type { StartWorkType } from './plus/startWork/startWork';
1011
import type { Period } from './plus/webviews/timeline/protocol';
@@ -418,7 +419,8 @@ export type TelemetryEvents = {
418419
| {
419420
action: 'visibility';
420421
visible: boolean;
421-
};
422+
}
423+
| FeaturePreviewActionEventData;
422424
/** Sent when the subscription changes */
423425
'subscription/changed': SubscriptionEventData;
424426

@@ -698,3 +700,10 @@ export type TrackedUsageFeatures =
698700
| `${TreeViewTypes | WebviewViewTypes}View`
699701
| `${CustomEditorTypes}Editor`;
700702
export type TrackedUsageKeys = `${TrackedUsageFeatures}:shown` | CommandExecutionTrackedFeatures | WalkthroughUsageKeys;
703+
704+
export type FeaturePreviewActionsDayEventData = Record<`day.${number}.startedOn`, string>;
705+
export type FeaturePreviewActionEventData = {
706+
action: `start-preview-trial:${FeaturePreviews}`;
707+
startedOn: string;
708+
day: number;
709+
} & FeaturePreviewActionsDayEventData;

0 commit comments

Comments
 (0)