Skip to content

Commit a7b2b45

Browse files
sergeibbbd13
authored andcommitted
Remove "Learn about Launchpad" from menus
(#3837, #4390)
1 parent 403af48 commit a7b2b45

File tree

4 files changed

+42
-37
lines changed

4 files changed

+42
-37
lines changed

contributions.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8847,21 +8847,21 @@
88478847
"menus": {
88488848
"gitlens/views/grouped/launchpad": [
88498849
{
8850-
"when": "gitlens:views:scm:grouped:view == launchpad",
8850+
"when": "gitlens:views:scm:grouped:view == launchpad && gitlens:walkthroughSupported",
88518851
"group": "2_gitlens_actions",
88528852
"order": 1
88538853
}
88548854
],
88558855
"view/item/context": [
88568856
{
8857-
"when": "viewItem == gitlens:views:launchpad",
8857+
"when": "viewItem == gitlens:views:launchpad && gitlens:walkthroughSupported",
88588858
"group": "8_info",
88598859
"order": 1
88608860
}
88618861
],
88628862
"view/title": [
88638863
{
8864-
"when": "view == gitlens.views.launchpad",
8864+
"when": "view == gitlens.views.launchpad && gitlens:walkthroughSupported",
88658865
"group": "8_info",
88668866
"order": 1
88678867
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15516,7 +15516,7 @@
1551615516
"gitlens/views/grouped/launchpad": [
1551715517
{
1551815518
"command": "gitlens.views.launchpad.info",
15519-
"when": "gitlens:views:scm:grouped:view == launchpad",
15519+
"when": "gitlens:views:scm:grouped:view == launchpad && gitlens:walkthroughSupported",
1552015520
"group": "2_gitlens_actions@1"
1552115521
},
1552215522
{
@@ -19008,7 +19008,7 @@
1900819008
},
1900919009
{
1901019010
"command": "gitlens.views.launchpad.info",
19011-
"when": "viewItem == gitlens:views:launchpad",
19011+
"when": "viewItem == gitlens:views:launchpad && gitlens:walkthroughSupported",
1901219012
"group": "8_info@1"
1901319013
},
1901419014
{
@@ -21103,7 +21103,7 @@
2110321103
},
2110421104
{
2110521105
"command": "gitlens.views.launchpad.info",
21106-
"when": "view == gitlens.views.launchpad",
21106+
"when": "view == gitlens.views.launchpad && gitlens:walkthroughSupported",
2110721107
"group": "8_info@1"
2110821108
},
2110921109
{

src/commands/quickCommand.steps.ts

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ import { first, map } from '../system/iterable';
110110
import { Logger } from '../system/logger';
111111
import { getSettledValue } from '../system/promise';
112112
import { pad, pluralize, truncate } from '../system/string';
113+
import { isWalkthroughSupported } from '../telemetry/walkthroughStateProvider';
113114
import type { ViewsWithRepositoryFolders } from '../views/viewBase';
114115
import type {
115116
AsyncStepResultGenerator,
@@ -2795,21 +2796,23 @@ export async function* ensureAccessStep<
27952796

27962797
switch (feature) {
27972798
case 'launchpad':
2798-
directives.splice(
2799-
0,
2800-
0,
2801-
createDirectiveQuickPickItem(Directive.Cancel, undefined, {
2802-
label: 'Launchpad prioritizes your pull requests to keep you focused and your team unblocked',
2803-
detail: 'Click to learn more about Launchpad',
2804-
iconPath: new ThemeIcon('rocket'),
2805-
onDidSelect: () =>
2806-
void executeCommand<OpenWalkthroughCommandArgs>('gitlens.openWalkthrough', {
2807-
step: 'accelerate-pr-reviews',
2808-
source: { source: 'launchpad', detail: 'info' },
2809-
}),
2810-
}),
2811-
createQuickPickSeparator(),
2812-
);
2799+
if (isWalkthroughSupported()) {
2800+
directives.splice(
2801+
0,
2802+
0,
2803+
createDirectiveQuickPickItem(Directive.Cancel, undefined, {
2804+
label: 'Launchpad prioritizes your pull requests to keep you focused and your team unblocked',
2805+
detail: 'Click to learn more about Launchpad',
2806+
iconPath: new ThemeIcon('rocket'),
2807+
onDidSelect: () =>
2808+
void executeCommand<OpenWalkthroughCommandArgs>('gitlens.openWalkthrough', {
2809+
step: 'accelerate-pr-reviews',
2810+
source: { source: 'launchpad', detail: 'info' },
2811+
}),
2812+
}),
2813+
createQuickPickSeparator(),
2814+
);
2815+
}
28132816
break;
28142817
case 'startWork':
28152818
directives.splice(

src/plus/launchpad/launchpad.ts

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import { getScopedCounter } from '../../system/counter';
5353
import { fromNow } from '../../system/date';
5454
import { some } from '../../system/iterable';
5555
import { interpolate, pluralize } from '../../system/string';
56+
import { isWalkthroughSupported } from '../../telemetry/walkthroughStateProvider';
5657
import { ProviderBuildStatusState, ProviderPullRequestReviewState } from '../integrations/providers/models';
5758
import type { LaunchpadCategorizedResult, LaunchpadItem } from './launchpadProvider';
5859
import {
@@ -1175,21 +1176,22 @@ export class LaunchpadCommand extends QuickCommand<State> {
11751176
context: Context,
11761177
): AsyncStepResultGenerator<{ connected: boolean | IntegrationIds; resume: () => void | undefined }> {
11771178
const hasConnectedIntegration = some(context.connectedIntegrations.values(), c => c);
1178-
const confirmations: (QuickPickItemOfT<IntegrationIds> | DirectiveQuickPickItem)[] = !hasConnectedIntegration
1179-
? [
1180-
createDirectiveQuickPickItem(Directive.Cancel, undefined, {
1181-
label: 'Launchpad prioritizes your pull requests to keep you focused and your team unblocked',
1182-
detail: 'Click to learn more about Launchpad',
1183-
iconPath: new ThemeIcon('rocket'),
1184-
onDidSelect: () =>
1185-
void executeCommand<OpenWalkthroughCommandArgs>('gitlens.openWalkthrough', {
1186-
step: 'accelerate-pr-reviews',
1187-
source: { source: 'launchpad', detail: 'info' },
1188-
}),
1189-
}),
1190-
createQuickPickSeparator(),
1191-
]
1192-
: [];
1179+
const confirmations: (QuickPickItemOfT<IntegrationIds> | DirectiveQuickPickItem)[] =
1180+
!hasConnectedIntegration && isWalkthroughSupported()
1181+
? [
1182+
createDirectiveQuickPickItem(Directive.Cancel, undefined, {
1183+
label: 'Launchpad prioritizes your pull requests to keep you focused and your team unblocked',
1184+
detail: 'Click to learn more about Launchpad',
1185+
iconPath: new ThemeIcon('rocket'),
1186+
onDidSelect: () =>
1187+
void executeCommand<OpenWalkthroughCommandArgs>('gitlens.openWalkthrough', {
1188+
step: 'accelerate-pr-reviews',
1189+
source: { source: 'launchpad', detail: 'info' },
1190+
}),
1191+
}),
1192+
createQuickPickSeparator(),
1193+
]
1194+
: [];
11931195

11941196
for (const integration of supportedLaunchpadIntegrations) {
11951197
if (context.connectedIntegrations.get(integration)) {
@@ -1249,7 +1251,7 @@ export class LaunchpadCommand extends QuickCommand<State> {
12491251
const step = this.createConfirmStep(
12501252
`${this.title} \u00a0\u2022\u00a0 Connect an ${hasConnectedIntegration ? 'Additional ' : ''}Integration`,
12511253
[
1252-
...(hasConnectedIntegration
1254+
...(hasConnectedIntegration || !isWalkthroughSupported()
12531255
? []
12541256
: [
12551257
createDirectiveQuickPickItem(Directive.Cancel, undefined, {

0 commit comments

Comments
 (0)