Skip to content

Commit 269c52c

Browse files
committed
Fixes walkthrough links
1 parent 2e31a2b commit 269c52c

File tree

4 files changed

+24
-18
lines changed

4 files changed

+24
-18
lines changed

src/commands/walkthroughs.ts

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { TelemetrySources, WalkthroughSteps } from '../constants';
22
import { Commands } from '../constants';
33
import type { Container } from '../container';
44
import { command } from '../system/command';
5-
import { openWalkthrough } from '../system/utils';
5+
import { openWalkthrough as openWalkthroughCore } from '../system/utils';
66
import { Command } from './base';
77

88
@command()
@@ -11,8 +11,10 @@ export class GetStartedCommand extends Command {
1111
super(Commands.GetStarted);
1212
}
1313

14-
execute() {
15-
void openWalkthrough(this.container.context.extension.id, 'welcome', undefined, false);
14+
execute(extensionIdOrsource?: TelemetrySources) {
15+
// If the extensionIdOrsource is the same as the current extension, then it came from the extension content menu in the extension view, so don't pass the source
16+
const source = extensionIdOrsource !== this.container.context.extension.id ? undefined : extensionIdOrsource;
17+
openWalkthrough(this.container, source ? { source: source } : undefined);
1618
}
1719
}
1820

@@ -29,14 +31,18 @@ export class OpenWalkthroughCommand extends Command {
2931
}
3032

3133
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-
});
38-
}
34+
openWalkthrough(this.container, args);
35+
}
36+
}
3937

40-
void openWalkthrough(this.container.context.extension.id, 'welcome', args?.step, false);
38+
function openWalkthrough(container: Container, args?: OpenWalkthroughCommandArgs) {
39+
if (container.telemetry.enabled) {
40+
container.telemetry.sendEvent('walkthrough', {
41+
step: args?.step,
42+
source: args?.source ?? 'commandPalette',
43+
detail: args?.detail,
44+
});
4145
}
46+
47+
void openWalkthroughCore(container.context.extension.id, 'welcome', args?.step, false);
4248
}

src/plus/gk/account/subscriptionService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,7 @@ export class SubscriptionService implements Disposable {
12161216
{ infix: ' more ' },
12171217
)} in your **${effective.name}** trial.`
12181218
: `You have ${pluralize('day', remaining ?? 0)} remaining in your **${effective.name}** 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](${
1219+
} Once your trial ends, you'll need a paid plan for full access to [Pro features](command:gitlens.openWalkthrough?%7B%22step%22%3A%22pro-trial%22,%22source%22%3A%22prompt%22%7D).\n\nYour trial also includes access to our [DevEx platform](${
12201220
urls.platform
12211221
}), unleashing powerful Git visualization & productivity capabilities everywhere you work: IDE, desktop, browser, and terminal.`,
12221222
true,

src/webviews/apps/home/home.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ <h1 class="alert__title">Get Started with GitLens</h1>
172172
<p>Explore all of the powerful features in GitLens</p>
173173
<p class="button-container">
174174
<span class="button-group button-group--single">
175-
<gl-button appearance="secondary" full data-action="command:gitlens.getStarted"
175+
<gl-button appearance="secondary" full data-action="command:gitlens.getStarted?%22home%22"
176176
><code-icon icon="info" slot="prefix"></code-icon> Open Walkthrough</gl-button
177177
>
178178
<gl-tooltip hoist>
@@ -471,7 +471,7 @@ <h2 class="nav-list__title t-eyebrow sticky">Getting Started</h2>
471471
<div class="nav-list__item">
472472
<a
473473
class="nav-list__link"
474-
href="command:gitlens.getStarted"
474+
href="command:gitlens.getStarted?%22home%22"
475475
aria-label="Open GitLens Feature Walkthrough"
476476
><code-icon class="nav-list__icon" icon="info"></code-icon
477477
><gl-tooltip hoist class="nav-list__label" content="Open GitLens Feature Walkthrough"

src/webviews/apps/welcome/welcome.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ <h2 class="sticky">Get Started</h2>
8383
</p>
8484
<p class="button-container">
8585
<span class="button-group button-group--single">
86-
<gl-button appearance="secondary" full href="command:gitlens.getStarted"
86+
<gl-button appearance="secondary" full href="command:gitlens.getStarted?%22welcome%22"
8787
><code-icon icon="info" slot="prefix"></code-icon> Get Started Walkthrough</gl-button
8888
>
8989
</span>
@@ -368,7 +368,7 @@ <h3 class="sticky">
368368
<a
369369
class="muted"
370370
data-org-requires="drafts"
371-
href="command:gitlens.getStarted?%22code-collab%22"
371+
href="command:gitlens.openWalkthrough?%7B%22step%22%3A%22code-collab%22,%22source%22%3A%22welcome%22%7D"
372372
aria-label="Learn more about Code Suggest"
373373
><gl-tooltip hoist content="Learn more about Code Suggest"
374374
><span>Code Suggest</span></gl-tooltip
@@ -556,7 +556,7 @@ <h2 class="sticky">Get Started</h2>
556556
to get started.
557557
</p>
558558
<p>
559-
<gl-button appearance="secondary" full href="command:gitlens.getStarted"
559+
<gl-button appearance="secondary" full href="command:gitlens.getStarted?%22welcome%22"
560560
><code-icon icon="info" slot="prefix"></code-icon> Get Started Walkthrough</gl-button
561561
>
562562
</p>
@@ -626,7 +626,7 @@ <h3 class="t-eyebrow sticky">Popular</h3>
626626
><gl-tooltip hoist content="Show Inspect view"><span>Inspect</span></gl-tooltip>
627627
</a>
628628
<a
629-
href="command:gitlens.openWalkthrough?%7B%22step%22%3A%22code-collab%22,%22source%22%3A%22home%22%7D"
629+
href="command:gitlens.openWalkthrough?%7B%22step%22%3A%22code-collab%22,%22source%22%3A%22welcome%22%7D"
630630
data-requires="repo"
631631
data-org-requires="drafts"
632632
aria-label="Open Code Suggest walkthrough"

0 commit comments

Comments
 (0)