Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@
},
{
"id": "graph",
"title": "Commit Graph",
"title": "Commit Graph (ᴘʀᴏ)",
"order": 50,
"properties": {
"gitlens.graph.layout": {
Expand Down Expand Up @@ -1226,7 +1226,7 @@
},
{
"id": "focus",
"title": "Launchpad (Preview)",
"title": "Launchpad (ᴘʀᴏ)",
"order": 60,
"properties": {
"gitlens.launchpad.ignoredRepositories": {
Expand Down Expand Up @@ -1376,7 +1376,7 @@
},
{
"id": "cloud-patches",
"title": "Cloud Patches (Preview)",
"title": "Cloud Patches (ᴘʀᴇᴠɪᴇᴡ)",
"order": 70,
"properties": {
"gitlens.cloudPatches.enabled": {
Expand Down Expand Up @@ -1542,7 +1542,7 @@
},
{
"id": "launchpad-view",
"title": "Launchpad View",
"title": "Launchpad View (ᴇxᴘᴇʀɪᴍᴇɴᴛᴀʟ)",
"order": 101,
"properties": {
"gitlens.views.launchpad.enabled": {
Expand Down Expand Up @@ -2182,7 +2182,7 @@
},
{
"id": "visual-history",
"title": "Visual File History",
"title": "Visual File History (ᴘʀᴏ)",
"order": 155,
"properties": {
"gitlens.visualHistory.allowMultiple": {
Expand Down Expand Up @@ -2587,7 +2587,7 @@
},
{
"id": "worktrees-view",
"title": "Worktrees View",
"title": "Worktrees View (ᴘʀᴏ)",
"order": 210,
"properties": {
"gitlens.worktrees.promptForLocation": {
Expand Down Expand Up @@ -2897,7 +2897,7 @@
},
{
"id": "cloud-patches-view",
"title": "Cloud Patches View",
"title": "Cloud Patches View (ᴘʀᴇᴠɪᴇᴡ)",
"order": 240,
"properties": {
"gitlens.views.drafts.files.layout": {
Expand Down Expand Up @@ -3017,7 +3017,7 @@
},
{
"id": "workspaces-view",
"title": "GitKraken Workspaces View",
"title": "GitKraken Workspaces View (ᴘʀᴇᴠɪᴇᴡ)",
"order": 260,
"properties": {
"gitlens.views.workspaces.showBranchComparison": {
Expand Down Expand Up @@ -3654,7 +3654,7 @@
},
{
"id": "ai",
"title": "AI (Experimental)",
"title": "AI (ᴇxᴘᴇʀɪᴍᴇɴᴛᴀʟ)",
"order": 1000,
"properties": {
"gitlens.ai.experimental.generateCommitMessage.enabled": {
Expand Down Expand Up @@ -9911,7 +9911,7 @@
},
{
"command": "gitlens.showFocusPage",
"when": "gitlens:enabled"
"when": "false && gitlens:enabled"
},
{
"command": "gitlens.launchpad.split",
Expand Down Expand Up @@ -17590,13 +17590,13 @@
},
{
"view": "gitlens.views.worktrees",
"contents": "Special: 1st seat of Pro is now 50%+ off",
"contents": "Limited-time Sale: Save 33% or more on your 1st seat of Pro.",
"when": "gitlens:plus:required && gitlens:plus:state == 4 && (gitlens:promo == pro50 || !gitlens:promo)"
},
{
"view": "gitlens.views.worktrees",
"contents": "DevEx Days 24 Sale: Save up to 80% on GitLens Pro - lowest price of the year!",
"when": "gitlens:plus:required && gitlens:plus:state == 4 && gitlens:promo == devexdays24"
"contents": "Launchpad Sale: Save 75% or more on GitLens Pro",
"when": "gitlens:plus:required && gitlens:plus:state == 4 && gitlens:promo =~ /(launchpad|launchpad-extended)/"
},
{
"view": "gitlens.views.worktrees",
Expand Down Expand Up @@ -17899,7 +17899,7 @@
{
"id": "launchpad",
"title": "Unblock your team with Launchpad",
"description": "**Launchpad** ᴘʀᴇᴠɪᴇᴡ brings all of your GitHub pull requests into a unified, actionable list to better track work in progress, pending work, reviews, and more. Stay focused and take action on the most important items to keep your team unblocked. [Learn more](https://gitkraken.com/solutions/launchpad?utm_source=gitlens-extension&utm_medium=in-app-links)\n\n[Open Launchpad](command:gitlens.showLaunchpad?%7B%22source%22%3A%22walkthrough%22%7D)",
"description": "**Launchpad** ᴘʀᴏ brings all of your GitHub pull requests into a unified, actionable list to better track work in progress, pending work, reviews, and more. Stay focused and take action on the most important items to keep your team unblocked. [Learn more](https://gitkraken.com/solutions/launchpad?utm_source=gitlens-extension&utm_medium=in-app-links)\n\n[Open Launchpad](command:gitlens.showLaunchpad?%7B%22source%22%3A%22walkthrough%22%7D)",
"media": {
"altText": "Illustrations of Launchpad",
"svg": "walkthroughs/welcome/launchpad-quick.svg"
Expand Down
5 changes: 5 additions & 0 deletions src/commands/quickCommand.buttons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ export const PickCommitToggleQuickInputButton = class extends ToggleQuickInputBu
}
};

export const LearnAboutProQuickInputButton: QuickInputButton = {
iconPath: new ThemeIcon('info'),
tooltip: 'Learn about GitLens Pro',
};

export const MergeQuickInputButton: QuickInputButton = {
iconPath: new ThemeIcon('merge'),
tooltip: 'Merge...',
Expand Down
73 changes: 63 additions & 10 deletions src/commands/quickCommand.steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { ThemeIcon } from 'vscode';
import { GlyphChars, quickPickTitleMaxChars } from '../constants';
import { Commands } from '../constants.commands';
import { Container } from '../container';
import type { PlusFeatures } from '../features';
import type { FeatureAccess, RepoFeatureAccess } from '../features';
import { PlusFeatures } from '../features';
import * as BranchActions from '../git/actions/branch';
import * as CommitActions from '../git/actions/commit';
import * as ContributorActions from '../git/actions/contributor';
Expand Down Expand Up @@ -43,6 +44,7 @@ import type { GitWorktree, WorktreeQuickPickItem } from '../git/models/worktree'
import { createWorktreeQuickPickItem, getWorktreesByBranch, sortWorktrees } from '../git/models/worktree';
import { remoteUrlRegex } from '../git/parsers/remoteParser';
import type { FocusCommandArgs } from '../plus/focus/focus';
import { getApplicablePromo } from '../plus/gk/account/promos';
import { isSubscriptionPaidPlan, isSubscriptionPreviewTrialExpired } from '../plus/gk/account/subscription';
import {
CommitApplyFileChangesCommandQuickPickItem,
Expand Down Expand Up @@ -98,6 +100,7 @@ import {
OpenRemoteResourceCommandQuickPickItem,
} from '../quickpicks/remoteProviderPicker';
import { filterMap, filterMapAsync, intersection, isStringArray } from '../system/array';
import { executeCommand } from '../system/command';
import { configuration } from '../system/configuration';
import { formatPath } from '../system/formatPath';
import { debounce } from '../system/function';
Expand All @@ -106,6 +109,7 @@ import { Logger } from '../system/logger';
import { getSettledValue } from '../system/promise';
import { pad, pluralize, truncate } from '../system/string';
import { openWorkspace } from '../system/utils';
import { getIconPathUris } from '../system/vscode';
import type { ViewsWithRepositoryFolders } from '../views/viewBase';
import type {
AsyncStepResultGenerator,
Expand Down Expand Up @@ -136,6 +140,7 @@ import {
ShowDetailsViewQuickInputButton,
ShowTagsToggleQuickInputButton,
} from './quickCommand.buttons';
import type { OpenWalkthroughCommandArgs } from './walkthroughs';

export function appendReposToTitle<
State extends { repo: Repository } | { repos: Repository[] },
Expand Down Expand Up @@ -2599,11 +2604,11 @@ function getShowRepositoryStatusStepItems<
}

export async function* ensureAccessStep<
State extends PartialStepState & { repo: Repository },
Context extends { repos: Repository[]; title: string },
>(state: State, context: Context, feature: PlusFeatures): AsyncStepResultGenerator<void> {
const access = await Container.instance.git.access(feature, state.repo.path);
if (access.allowed) return undefined;
State extends PartialStepState & { repo?: Repository },
Context extends { title: string },
>(state: State, context: Context, feature: PlusFeatures): AsyncStepResultGenerator<FeatureAccess | RepoFeatureAccess> {
const access = await Container.instance.git.access(feature, state.repo?.path);
if (access.allowed) return access;

const directives: DirectiveQuickPickItem[] = [];
let placeholder: string;
Expand All @@ -2615,13 +2620,28 @@ export async function* ensureAccessStep<
);
placeholder = 'You must verify your email before you can continue';
} else {
if (access.subscription.required == null) return undefined;
if (access.subscription.required == null) return access;

let detail;
const promo = getApplicablePromo(access.subscription.current.state);
if (promo != null) {
// NOTE: Don't add a default case, so that if we add a new promo the build will break without handling it
switch (promo.key) {
case 'pro50':
detail = '$(star-full) Limited-Time Sale: Save 33% or more on your 1st seat of Pro';
break;
case 'launchpad':
case 'launchpad-extended':
detail = `$(rocket) Launchpad Sale: Save 75% or more on GitLens Pro`;
break;
}
}

placeholder = 'Pro feature — requires a trial or paid plan for use on privately-hosted repos';
if (isSubscriptionPaidPlan(access.subscription.required) && access.subscription.current.account != null) {
placeholder = 'Pro feature — requires a paid plan for use on privately-hosted repos';
directives.push(
createDirectiveQuickPickItem(Directive.RequiresPaidSubscription, true),
createDirectiveQuickPickItem(Directive.RequiresPaidSubscription, true, { detail: detail }),
createQuickPickSeparator(),
createDirectiveQuickPickItem(Directive.Cancel),
);
Expand All @@ -2644,12 +2664,45 @@ export async function* ensureAccessStep<
}
}

switch (feature) {
case PlusFeatures.Focus:
directives.splice(
0,
0,
createDirectiveQuickPickItem(Directive.Cancel, undefined, {
label: 'Launchpad prioritizes your pull requests to keep you focused and your team unblocked',
detail: 'Click to learn more about Launchpad',
iconPath: new ThemeIcon('rocket'),
onDidSelect: () =>
void executeCommand<OpenWalkthroughCommandArgs>(Commands.OpenWalkthrough, {
step: 'launchpad',
source: 'launchpad',
detail: 'info',
}),
}),
createQuickPickSeparator(),
);
break;
case PlusFeatures.Worktrees:
directives.splice(
0,
0,
createDirectiveQuickPickItem(Directive.Noop, undefined, {
label: 'Worktrees minimize context switching by allowing simultaneous work on multiple branches',
iconPath: getIconPathUris(Container.instance, 'icon-repo.svg'),
}),
);
break;
}

const step = createPickStep<DirectiveQuickPickItem>({
title: appendReposToTitle(context.title, state, context),
title: context.title,
placeholder: placeholder,
items: directives,
buttons: [],
isConfirmationStep: true,
});

const selection: StepSelection<typeof step> = yield step;
return canPickStepContinue(step, state, selection) ? undefined : StepResultBreak;
return canPickStepContinue(step, state, selection) ? access : StepResultBreak;
}
3 changes: 3 additions & 0 deletions src/constants.telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,3 +466,6 @@ type SubscriptionEventData = {
Record<`previous.subscription.${string}`, string | number | boolean | undefined> &
Record<`previous.subscription.previewTrial.${string}`, string | number | boolean | undefined>
>;

/** Used to provide a "source context" to gk.dev for both tracking and customization purposes */
export type TrackingContext = 'graph' | 'launchpad' | 'visual_file_history' | 'worktrees';
30 changes: 15 additions & 15 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const keys = Object.freeze([
] as const);
export type Keys = (typeof keys)[number];

export type PromoKeys = 'devexdays24' | 'pro50';
export type PromoKeys = 'launchpad' | 'launchpad-extended' | 'pro50';

export const enum Schemes {
File = 'file',
Expand Down Expand Up @@ -152,24 +152,24 @@ export const trackableSchemes = Object.freeze(
]),
);

const utm = 'utm_source=gitlens-extension&utm_medium=in-app-links';
export const urls = Object.freeze({
codeSuggest: 'https://gitkraken.com/solutions/code-suggest?utm_source=gitlens-extension&utm_medium=in-app-links',
cloudPatches: 'https://gitkraken.com/solutions/cloud-patches?utm_source=gitlens-extension&utm_medium=in-app-links',
graph: 'https://gitkraken.com/solutions/commit-graph?utm_source=gitlens-extension&utm_medium=in-app-links',
launchpad: 'https://gitkraken.com/solutions/launchpad?utm_source=gitlens-extension&utm_medium=in-app-links',
platform: 'https://gitkraken.com/devex?utm_source=gitlens-extension&utm_medium=in-app-links',
pricing: 'https://gitkraken.com/gitlens/pricing?utm_source=gitlens-extension&utm_medium=in-app-links',
proFeatures: 'https://gitkraken.com/gitlens/pro-features?utm_source=gitlens-extension&utm_medium=in-app-links',
security: 'https://help.gitkraken.com/gitlens/security?utm_source=gitlens-extension&utm_medium=in-app-links',
workspaces: 'https://gitkraken.com/solutions/workspaces?utm_source=gitlens-extension&utm_medium=in-app-links',
codeSuggest: `https://gitkraken.com/solutions/code-suggest?${utm}`,
cloudPatches: `https://gitkraken.com/solutions/cloud-patches?${utm}`,
graph: `https://gitkraken.com/solutions/commit-graph?${utm}`,
launchpad: `https://gitkraken.com/solutions/launchpad?${utm}`,
platform: `https://gitkraken.com/devex?${utm}`,
pricing: `https://gitkraken.com/gitlens/pricing?${utm}`,
proFeatures: `https://gitkraken.com/gitlens/pro-features?${utm}`,
security: `https://help.gitkraken.com/gitlens/security?${utm}`,
workspaces: `https://gitkraken.com/solutions/workspaces?${utm}`,

cli: 'https://gitkraken.com/cli?utm_source=gitlens-extension&utm_medium=in-app-links',
browserExtension: 'https://gitkraken.com/browser-extension?utm_source=gitlens-extension&utm_medium=in-app-links',
desktop: 'https://gitkraken.com/git-client?utm_source=gitlens-extension&utm_medium=in-app-links',
cli: `https://gitkraken.com/cli?${utm}`,
browserExtension: `https://gitkraken.com/browser-extension?${utm}`,
desktop: `https://gitkraken.com/git-client?${utm}`,

releaseNotes: 'https://help.gitkraken.com/gitlens/gitlens-release-notes-current/',
releaseAnnouncement:
'https://www.gitkraken.com/blog/gitkraken-launches-devex-platform-acquires-codesee?utm_source=gitlens-extension&utm_medium=in-app-links',
releaseAnnouncement: `https://www.gitkraken.com/blog/gitkraken-launches-devex-platform-acquires-codesee?${utm}`,
});

export type WalkthroughSteps =
Expand Down
8 changes: 4 additions & 4 deletions src/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import type { GitHubApi } from './plus/integrations/providers/github/github';
import type { GitLabApi } from './plus/integrations/providers/gitlab/gitlab';
import { RepositoryIdentityService } from './plus/repos/repositoryIdentityService';
import { registerAccountWebviewView } from './plus/webviews/account/registration';
import { registerFocusWebviewCommands, registerFocusWebviewPanel } from './plus/webviews/focus/registration';
import type { GraphWebviewShowingArgs } from './plus/webviews/graph/registration';
import {
registerGraphWebviewCommands,
Expand Down Expand Up @@ -251,9 +250,10 @@ export class Container {
this._disposables.push((this._graphView = registerGraphWebviewView(this._webviews)));
this._disposables.push(new GraphStatusBarController(this));

const focusPanels = registerFocusWebviewPanel(this._webviews);
this._disposables.push(focusPanels);
this._disposables.push(registerFocusWebviewCommands(focusPanels));
// NOTE: Commenting out for now as we are deprecating this
// const focusPanels = registerFocusWebviewPanel(this._webviews);
// this._disposables.push(focusPanels);
// this._disposables.push(registerFocusWebviewCommands(focusPanels));

const timelinePanels = registerTimelineWebviewPanel(this._webviews);
this._disposables.push(timelinePanels);
Expand Down
Loading
Loading