From 77ef2fcde3b3acce901ba98d8877ba602699304a Mon Sep 17 00:00:00 2001 From: Sergei Shmakov Date: Mon, 9 Jun 2025 15:28:30 +0200 Subject: [PATCH 1/9] Removes Walkthroug from Home on Cursor (#3837, #4390) --- src/container.ts | 10 ++++++---- src/system/-webview/cursor.ts | 9 +++++++++ src/telemetry/walkthroughStateProvider.ts | 5 +++++ src/webviews/home/homeWebview.ts | 23 ++++++++++++++--------- 4 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 src/system/-webview/cursor.ts diff --git a/src/container.ts b/src/container.ts index 7469d3546e791..9f41b6e4975e3 100644 --- a/src/container.ts +++ b/src/container.ts @@ -59,7 +59,7 @@ import { log } from './system/decorators/log'; import { Logger } from './system/logger'; import { TelemetryService } from './telemetry/telemetry'; import { UsageTracker } from './telemetry/usageTracker'; -import { WalkthroughStateProvider } from './telemetry/walkthroughStateProvider'; +import { isWalkthroughSupported, WalkthroughStateProvider } from './telemetry/walkthroughStateProvider'; import { GitTerminalLinkProvider } from './terminal/linkProvider'; import { GitDocumentTracker } from './trackers/documentTracker'; import { LineTracker } from './trackers/lineTracker'; @@ -205,7 +205,9 @@ export class Container { ); this._disposables.push((this._uri = new UriService(this))); this._disposables.push((this._subscription = new SubscriptionService(this, this._connection, previousVersion))); - this._disposables.push((this._walkthrough = new WalkthroughStateProvider(this))); + if (isWalkthroughSupported()) { + this._disposables.push((this._walkthrough = new WalkthroughStateProvider(this))); + } this._disposables.push((this._organizations = new OrganizationService(this, this._connection))); this._disposables.push((this._git = new GitProviderService(this))); @@ -713,8 +715,8 @@ export class Container { return this._usage; } - private readonly _walkthrough: WalkthroughStateProvider; - get walkthrough(): WalkthroughStateProvider { + private readonly _walkthrough: WalkthroughStateProvider | undefined; + get walkthrough(): WalkthroughStateProvider | undefined { return this._walkthrough; } diff --git a/src/system/-webview/cursor.ts b/src/system/-webview/cursor.ts new file mode 100644 index 0000000000000..65d413f030681 --- /dev/null +++ b/src/system/-webview/cursor.ts @@ -0,0 +1,9 @@ +import { env } from 'vscode'; + +/** + * Checks if the current IDE is Cursor + * @returns true if the current IDE is Cursor, false otherwise + */ +export function isCursor(): boolean { + return env.appName === 'Cursor'; +} diff --git a/src/telemetry/walkthroughStateProvider.ts b/src/telemetry/walkthroughStateProvider.ts index 487be3b5496ad..b78b5c5c870e4 100644 --- a/src/telemetry/walkthroughStateProvider.ts +++ b/src/telemetry/walkthroughStateProvider.ts @@ -5,6 +5,7 @@ import type { TrackedUsageKeys } from '../constants.telemetry'; import type { Container } from '../container'; import type { SubscriptionChangeEvent } from '../plus/gk/subscriptionService'; import { setContext } from '../system/-webview/context'; +import { isCursor } from '../system/-webview/cursor'; import { wait } from '../system/promise'; import type { UsageChangeEvent } from './usageTracker'; @@ -319,3 +320,7 @@ export class WalkthroughStateProvider implements Disposable { return true; } } + +export function isWalkthroughSupported(): boolean { + return !isCursor(); +} diff --git a/src/webviews/home/homeWebview.ts b/src/webviews/home/homeWebview.ts index 79f9fe415927c..ad7eeb3e80d32 100644 --- a/src/webviews/home/homeWebview.ts +++ b/src/webviews/home/homeWebview.ts @@ -170,7 +170,7 @@ export class HomeWebviewProvider implements WebviewProvider Date: Mon, 9 Jun 2025 16:35:31 +0200 Subject: [PATCH 2/9] Removes "Get Started" from menus (#3837, #4390) --- contributions.json | 4 ++-- package.json | 6 +++++- src/constants.context.ts | 1 + src/telemetry/walkthroughStateProvider.ts | 2 ++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/contributions.json b/contributions.json index 61395a432003a..6bfabf3681bb0 100644 --- a/contributions.json +++ b/contributions.json @@ -1465,11 +1465,11 @@ }, "gitlens.getStarted": { "label": "Get Started", - "commandPalette": true, + "commandPalette": "gitlens:walkthroughSupported", "menus": { "extension/context": [ { - "when": "extension =~ /^eamodio.gitlens?$/ && extensionStatus == installed", + "when": "extension =~ /^eamodio.gitlens?$/ && extensionStatus == installed && gitlens:walkthroughSupported", "group": "9_gitlens", "order": 1 } diff --git a/package.json b/package.json index 3d4c1601f4ad6..5f83bfa0f1a9f 100644 --- a/package.json +++ b/package.json @@ -11033,6 +11033,10 @@ "command": "gitlens.fetchRepositories", "when": "gitlens:repos:withRemotes && !gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders" }, + { + "command": "gitlens.getStarted", + "when": "gitlens:walkthroughSupported" + }, { "command": "gitlens.ghpr.views.openOrCreateWorktree", "when": "false" @@ -14200,7 +14204,7 @@ "extension/context": [ { "command": "gitlens.getStarted", - "when": "extension =~ /^eamodio.gitlens?$/ && extensionStatus == installed", + "when": "extension =~ /^eamodio.gitlens?$/ && extensionStatus == installed && gitlens:walkthroughSupported", "group": "9_gitlens@1" }, { diff --git a/src/constants.context.ts b/src/constants.context.ts index d495f55b62b15..89eebedf20e49 100644 --- a/src/constants.context.ts +++ b/src/constants.context.ts @@ -60,6 +60,7 @@ export type ContextKeys = { 'gitlens:views:scm:grouped:welcome': boolean; 'gitlens:vsls': boolean | 'host' | 'guest'; 'gitlens:window:annotated': AnnotationStatus; + 'gitlens:walkthroughSupported': boolean; } & Record<`gitlens:action:${string}`, number> & Record<`gitlens:feature:unsupported:${Features}`, boolean> & Record<`gitlens:key:${Keys}`, boolean> & diff --git a/src/telemetry/walkthroughStateProvider.ts b/src/telemetry/walkthroughStateProvider.ts index b78b5c5c870e4..690d2960d8464 100644 --- a/src/telemetry/walkthroughStateProvider.ts +++ b/src/telemetry/walkthroughStateProvider.ts @@ -162,6 +162,8 @@ export class WalkthroughStateProvider implements Disposable { private subscriptionState: SubscriptionState | undefined; constructor(private readonly container: Container) { + void setContext('gitlens:walkthroughSupported', true); + this.disposables.push( this._onDidChangeProgress, this.container.usage.onDidChange(this.onUsageChanged, this), From e6eb30da05c1cf7ed12ebc31b49092e8bfb4caf7 Mon Sep 17 00:00:00 2001 From: Sergei Shmakov Date: Mon, 9 Jun 2025 16:53:33 +0200 Subject: [PATCH 3/9] Remove "Learn about Launchpad" from menus (#3837, #4390) --- contributions.json | 6 +++--- package.json | 6 +++--- src/commands/quickCommand.steps.ts | 33 ++++++++++++++++------------- src/plus/launchpad/launchpad.ts | 34 ++++++++++++++++-------------- 4 files changed, 42 insertions(+), 37 deletions(-) diff --git a/contributions.json b/contributions.json index 6bfabf3681bb0..ba065470be76c 100644 --- a/contributions.json +++ b/contributions.json @@ -8847,21 +8847,21 @@ "menus": { "gitlens/views/grouped/launchpad": [ { - "when": "gitlens:views:scm:grouped:view == launchpad", + "when": "gitlens:views:scm:grouped:view == launchpad && gitlens:walkthroughSupported", "group": "2_gitlens_actions", "order": 1 } ], "view/item/context": [ { - "when": "viewItem == gitlens:views:launchpad", + "when": "viewItem == gitlens:views:launchpad && gitlens:walkthroughSupported", "group": "8_info", "order": 1 } ], "view/title": [ { - "when": "view == gitlens.views.launchpad", + "when": "view == gitlens.views.launchpad && gitlens:walkthroughSupported", "group": "8_info", "order": 1 } diff --git a/package.json b/package.json index 5f83bfa0f1a9f..55f237ab7df48 100644 --- a/package.json +++ b/package.json @@ -15516,7 +15516,7 @@ "gitlens/views/grouped/launchpad": [ { "command": "gitlens.views.launchpad.info", - "when": "gitlens:views:scm:grouped:view == launchpad", + "when": "gitlens:views:scm:grouped:view == launchpad && gitlens:walkthroughSupported", "group": "2_gitlens_actions@1" }, { @@ -19008,7 +19008,7 @@ }, { "command": "gitlens.views.launchpad.info", - "when": "viewItem == gitlens:views:launchpad", + "when": "viewItem == gitlens:views:launchpad && gitlens:walkthroughSupported", "group": "8_info@1" }, { @@ -21103,7 +21103,7 @@ }, { "command": "gitlens.views.launchpad.info", - "when": "view == gitlens.views.launchpad", + "when": "view == gitlens.views.launchpad && gitlens:walkthroughSupported", "group": "8_info@1" }, { diff --git a/src/commands/quickCommand.steps.ts b/src/commands/quickCommand.steps.ts index 4b2d215931326..a5cbcc9a8fe44 100644 --- a/src/commands/quickCommand.steps.ts +++ b/src/commands/quickCommand.steps.ts @@ -110,6 +110,7 @@ import { first, map } from '../system/iterable'; import { Logger } from '../system/logger'; import { getSettledValue } from '../system/promise'; import { pad, pluralize, truncate } from '../system/string'; +import { isWalkthroughSupported } from '../telemetry/walkthroughStateProvider'; import type { ViewsWithRepositoryFolders } from '../views/viewBase'; import type { AsyncStepResultGenerator, @@ -2795,21 +2796,23 @@ export async function* ensureAccessStep< switch (feature) { case 'launchpad': - 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('gitlens.openWalkthrough', { - step: 'accelerate-pr-reviews', - source: { source: 'launchpad', detail: 'info' }, - }), - }), - createQuickPickSeparator(), - ); + if (isWalkthroughSupported()) { + 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('gitlens.openWalkthrough', { + step: 'accelerate-pr-reviews', + source: { source: 'launchpad', detail: 'info' }, + }), + }), + createQuickPickSeparator(), + ); + } break; case 'startWork': directives.splice( diff --git a/src/plus/launchpad/launchpad.ts b/src/plus/launchpad/launchpad.ts index 68f956f6fbaa7..1c92ff43889fa 100644 --- a/src/plus/launchpad/launchpad.ts +++ b/src/plus/launchpad/launchpad.ts @@ -53,6 +53,7 @@ import { getScopedCounter } from '../../system/counter'; import { fromNow } from '../../system/date'; import { some } from '../../system/iterable'; import { interpolate, pluralize } from '../../system/string'; +import { isWalkthroughSupported } from '../../telemetry/walkthroughStateProvider'; import { ProviderBuildStatusState, ProviderPullRequestReviewState } from '../integrations/providers/models'; import type { LaunchpadCategorizedResult, LaunchpadItem } from './launchpadProvider'; import { @@ -1175,21 +1176,22 @@ export class LaunchpadCommand extends QuickCommand { context: Context, ): AsyncStepResultGenerator<{ connected: boolean | IntegrationIds; resume: () => void | undefined }> { const hasConnectedIntegration = some(context.connectedIntegrations.values(), c => c); - const confirmations: (QuickPickItemOfT | DirectiveQuickPickItem)[] = !hasConnectedIntegration - ? [ - 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('gitlens.openWalkthrough', { - step: 'accelerate-pr-reviews', - source: { source: 'launchpad', detail: 'info' }, - }), - }), - createQuickPickSeparator(), - ] - : []; + const confirmations: (QuickPickItemOfT | DirectiveQuickPickItem)[] = + !hasConnectedIntegration && isWalkthroughSupported() + ? [ + 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('gitlens.openWalkthrough', { + step: 'accelerate-pr-reviews', + source: { source: 'launchpad', detail: 'info' }, + }), + }), + createQuickPickSeparator(), + ] + : []; for (const integration of supportedLaunchpadIntegrations) { if (context.connectedIntegrations.get(integration)) { @@ -1249,7 +1251,7 @@ export class LaunchpadCommand extends QuickCommand { const step = this.createConfirmStep( `${this.title} \u00a0\u2022\u00a0 Connect an ${hasConnectedIntegration ? 'Additional ' : ''}Integration`, [ - ...(hasConnectedIntegration + ...(hasConnectedIntegration || !isWalkthroughSupported() ? [] : [ createDirectiveQuickPickItem(Directive.Cancel, undefined, { From 6231d5658588342a9326c863d9a2770ddb03c2f2 Mon Sep 17 00:00:00 2001 From: Sergei Shmakov Date: Tue, 10 Jun 2025 14:39:39 +0200 Subject: [PATCH 4/9] Removes the link from the Launchpad indicator (#3837, #4390) --- contributions.json | 13 +++++++++++-- package.json | 15 +++++++++++++-- src/plus/launchpad/launchpadIndicator.ts | 13 +++++++++++-- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/contributions.json b/contributions.json index ba065470be76c..efd5b6e16428c 100644 --- a/contributions.json +++ b/contributions.json @@ -16781,7 +16781,12 @@ "order": 1, "welcomeContent": [ { - "contents": "[Launchpad](command:gitlens.views.launchpad.info \"Learn about Launchpad\") — organizes your pull requests into actionable groups to help you focus and keep your team unblocked." + "contents": "[Launchpad](command:gitlens.views.launchpad.info \"Learn about Launchpad\") — organizes your pull requests into actionable groups to help you focus and keep your team unblocked.", + "when": "gitlens:walkthroughSupported" + }, + { + "contents": "Launchpad — organizes your pull requests into actionable groups to help you focus and keep your team unblocked.", + "when": "!gitlens:walkthroughSupported" }, { "contents": "[Connect an Integration...](command:gitlens.showLaunchpad?%7B%22source%22%3A%22launchpad-view%22%7D)\n\nAllows Launchpad to organize your pull requests into actionable groups and keep your team unblocked.", @@ -16888,7 +16893,11 @@ }, { "contents": "[Launchpad](command:gitlens.views.launchpad.info \"Learn about Launchpad\") — organizes your pull requests into actionable groups to help you focus and keep your team unblocked.", - "when": "!gitlens:views:scm:grouped:loading && gitlens:views:scm:grouped:view == launchpad" + "when": "!gitlens:views:scm:grouped:loading && gitlens:views:scm:grouped:view == launchpad && gitlens:walkthroughSupported" + }, + { + "contents": "Launchpad — organizes your pull requests into actionable groups to help you focus and keep your team unblocked.", + "when": "!gitlens:views:scm:grouped:loading && gitlens:views:scm:grouped:view == launchpad && !gitlens:walkthroughSupported" }, { "contents": "[Connect an Integration...](command:gitlens.showLaunchpad?%7B%22source%22%3A%22launchpad-view%22%7D)\n\nAllows Launchpad to organize your pull requests into actionable groups and keep your team unblocked.", diff --git a/package.json b/package.json index 55f237ab7df48..11a833b4f5c52 100644 --- a/package.json +++ b/package.json @@ -23631,7 +23631,13 @@ }, { "view": "gitlens.views.launchpad", - "contents": "[Launchpad](command:gitlens.views.launchpad.info \"Learn about Launchpad\") — organizes your pull requests into actionable groups to help you focus and keep your team unblocked." + "contents": "[Launchpad](command:gitlens.views.launchpad.info \"Learn about Launchpad\") — organizes your pull requests into actionable groups to help you focus and keep your team unblocked.", + "when": "gitlens:walkthroughSupported" + }, + { + "view": "gitlens.views.launchpad", + "contents": "Launchpad — organizes your pull requests into actionable groups to help you focus and keep your team unblocked.", + "when": "!gitlens:walkthroughSupported" }, { "view": "gitlens.views.launchpad", @@ -23691,7 +23697,12 @@ { "view": "gitlens.views.scm.grouped", "contents": "[Launchpad](command:gitlens.views.launchpad.info \"Learn about Launchpad\") — organizes your pull requests into actionable groups to help you focus and keep your team unblocked.", - "when": "!gitlens:views:scm:grouped:loading && gitlens:views:scm:grouped:view == launchpad" + "when": "!gitlens:views:scm:grouped:loading && gitlens:views:scm:grouped:view == launchpad && gitlens:walkthroughSupported" + }, + { + "view": "gitlens.views.scm.grouped", + "contents": "Launchpad — organizes your pull requests into actionable groups to help you focus and keep your team unblocked.", + "when": "!gitlens:views:scm:grouped:loading && gitlens:views:scm:grouped:view == launchpad && !gitlens:walkthroughSupported" }, { "view": "gitlens.views.scm.grouped", diff --git a/src/plus/launchpad/launchpadIndicator.ts b/src/plus/launchpad/launchpadIndicator.ts index d28ca0a4669ed..5ae9b8488470e 100644 --- a/src/plus/launchpad/launchpadIndicator.ts +++ b/src/plus/launchpad/launchpadIndicator.ts @@ -11,6 +11,7 @@ import { once } from '../../system/event'; import { groupByMap } from '../../system/iterable'; import { wait } from '../../system/promise'; import { pluralize } from '../../system/string'; +import { isWalkthroughSupported } from '../../telemetry/walkthroughStateProvider'; import type { ConnectionStateChangeEvent } from '../integrations/integrationService'; import type { LaunchpadCommandArgs } from './launchpad'; import type { LaunchpadItem, LaunchpadProvider, LaunchpadRefreshEvent } from './launchpadProvider'; @@ -252,12 +253,20 @@ export class LaunchpadIndicator implements Disposable { tooltip.isTrusted = true; tooltip.appendMarkdown(`GitLens Launchpad ${proBadge}\u00a0\u00a0\u00a0\u00a0—\u00a0\u00a0\u00a0\u00a0`); - tooltip.appendMarkdown(`[$(question)](command:gitlens.launchpad.indicator.action?%22info%22 "What is this?")`); + if (isWalkthroughSupported()) { + tooltip.appendMarkdown( + `[$(question)](command:gitlens.launchpad.indicator.action?%22info%22 "What is this?")`, + ); + } tooltip.appendMarkdown('\u00a0'); tooltip.appendMarkdown(`[$(gear)](command:workbench.action.openSettings?%22gitlens.launchpad%22 "Settings")`); tooltip.appendMarkdown('\u00a0\u00a0|\u00a0\u00a0'); tooltip.appendMarkdown(`[$(circle-slash) Hide](command:gitlens.launchpad.indicator.action?%22hide%22 "Hide")`); + const launchpadLink = isWalkthroughSupported() + ? '[Launchpad](command:gitlens.launchpad.indicator.action?%22info%22 "Learn about Launchpad")' + : 'Launchpad'; + if ( state === 'idle' || state === 'disconnected' || @@ -266,7 +275,7 @@ export class LaunchpadIndicator implements Disposable { ) { tooltip.appendMarkdown('\n\n---\n\n'); tooltip.appendMarkdown( - '[Launchpad](command:gitlens.launchpad.indicator.action?%22info%22 "Learn about Launchpad") organizes your pull requests into actionable groups to help you focus and keep your team unblocked.', + `${launchpadLink} organizes your pull requests into actionable groups to help you focus and keep your team unblocked.`, ); tooltip.appendMarkdown( "\n\nIt's always accessible using the `GitLens: Open Launchpad` command from the Command Palette.", From f4c3e1d4e6719803780a5dabadcd5db885c75636 Mon Sep 17 00:00:00 2001 From: Sergei Shmakov Date: Tue, 10 Jun 2025 15:02:30 +0200 Subject: [PATCH 5/9] Hides walkthrough link in featue-nav.ts (#3837, #4390) --- .../apps/home/components/feature-nav.ts | 40 ++++++++++++------- src/webviews/home/homeWebview.ts | 1 + src/webviews/home/protocol.ts | 1 + 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/src/webviews/apps/home/components/feature-nav.ts b/src/webviews/apps/home/components/feature-nav.ts index ce1d2ceb208e0..29b8fa51642d3 100644 --- a/src/webviews/apps/home/components/feature-nav.ts +++ b/src/webviews/apps/home/components/feature-nav.ts @@ -196,21 +196,31 @@ export class GlFeatureNav extends GlElement { this.orgAllowsDrafts, () => html`