Skip to content

Commit 87bb8ec

Browse files
Cleans up launchpad refs
- Updates references to new launchpad in code/files/folders from focus -> launchpad - Cleans out unused commented code - Removes onWebviewPanel of focus from activation events
1 parent 643432d commit 87bb8ec

22 files changed

+339
-340
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"activationEvents": [
5151
"onAuthenticationRequest:gitlens-gitkraken",
5252
"onFileSystem:gitlens",
53-
"onWebviewPanel:gitlens.focus",
5453
"onWebviewPanel:gitlens.graph",
5554
"onWebviewPanel:gitlens.patchDetails",
5655
"onWebviewPanel:gitlens.settings",

src/commands/gitCommands.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { Disposable, InputBox, QuickInputButton, QuickPick, QuickPickItem }
22
import { InputBoxValidationSeverity, QuickInputButtons, window } from 'vscode';
33
import { Commands } from '../constants.commands';
44
import { Container } from '../container';
5-
import type { FocusCommandArgs } from '../plus/focus/focus';
5+
import type { LaunchpadCommandArgs } from '../plus/launchpad/launchpad';
66
import { Directive, isDirective, isDirectiveQuickPickItem } from '../quickpicks/items/directive';
77
import { command } from '../system/command';
88
import { configuration } from '../system/configuration';
@@ -64,7 +64,7 @@ export type GitCommandsCommandArgs =
6464
| SwitchGitCommandArgs
6565
| TagGitCommandArgs
6666
| WorktreeGitCommandArgs
67-
| FocusCommandArgs;
67+
| LaunchpadCommandArgs;
6868

6969
export type GitCommandsCommandArgsWithCompletion = GitCommandsCommandArgs & { completion?: Deferred<void> };
7070

@@ -217,7 +217,7 @@ export class GitCommandsCommand extends Command {
217217
};
218218
break;
219219
case Commands.ShowLaunchpad:
220-
args = { command: 'focus', ...args };
220+
args = { command: 'launchpad', ...args };
221221
break;
222222
}
223223

src/commands/gitCommands.utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { StoredRecentUsage } from '../constants.storage';
22
import type { Container } from '../container';
3-
import { FocusCommand } from '../plus/focus/focus';
3+
import { LaunchpadCommand } from '../plus/launchpad/launchpad';
44
import { configuration } from '../system/configuration';
55
import { getContext } from '../system/context';
66
import { BranchGitCommand } from './git/branch';
@@ -108,8 +108,8 @@ export class PickCommandStep implements QuickPickStep<QuickCommand> {
108108
}
109109

110110
this.hiddenItems = [];
111-
if (args?.command === 'focus') {
112-
this.hiddenItems.push(new FocusCommand(container, args));
111+
if (args?.command === 'launchpad') {
112+
this.hiddenItems.push(new LaunchpadCommand(container, args));
113113
}
114114
}
115115

src/commands/quickCommand.steps.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ import { sortTags } from '../git/models/tag';
4343
import type { GitWorktree, WorktreeQuickPickItem } from '../git/models/worktree';
4444
import { createWorktreeQuickPickItem, getWorktreesByBranch, sortWorktrees } from '../git/models/worktree';
4545
import { remoteUrlRegex } from '../git/parsers/remoteParser';
46-
import type { FocusCommandArgs } from '../plus/focus/focus';
4746
import { getApplicablePromo } from '../plus/gk/account/promos';
4847
import { isSubscriptionPaidPlan, isSubscriptionPreviewTrialExpired } from '../plus/gk/account/subscription';
48+
import type { LaunchpadCommandArgs } from '../plus/launchpad/launchpad';
4949
import {
5050
CommitApplyFileChangesCommandQuickPickItem,
5151
CommitBrowseRepositoryFromHereCommandQuickPickItem,
@@ -981,7 +981,7 @@ export function* pickBranchOrTagStepMultiRepo<
981981
label: 'Choose a Pull Request...',
982982
iconPath: new ThemeIcon('git-pull-request'),
983983
alwaysShow: true,
984-
item: createCrossCommandReference<Partial<FocusCommandArgs>>(Commands.ShowLaunchpad, {
984+
item: createCrossCommandReference<Partial<LaunchpadCommandArgs>>(Commands.ShowLaunchpad, {
985985
source: 'git-commands',
986986
}),
987987
};
@@ -2665,7 +2665,7 @@ export async function* ensureAccessStep<
26652665
}
26662666

26672667
switch (feature) {
2668-
case PlusFeatures.Focus:
2668+
case PlusFeatures.Launchpad:
26692669
directives.splice(
26702670
0,
26712671
0,

src/constants.storage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export type GlobalStorage = {
6868
'views:welcome:visible': boolean;
6969
'confirm:draft:storage': boolean;
7070
'home:sections:collapsed': string[];
71-
'launchpad:groups:collapsed': StoredFocusGroup[];
71+
'launchpad:groups:collapsed': StoredLaunchpadGroup[];
7272
'launchpad:indicator:hasLoaded': boolean;
7373
'launchpad:indicator:hasInteracted': string;
7474
} & { [key in `confirm:ai:tos:${AIProviders}`]: boolean } & {
@@ -287,7 +287,7 @@ export type StoredSearchAndCompareItems = Record<string, StoredSearchAndCompareI
287287
export type StoredStarred = Record<string, boolean>;
288288
export type StoredRecentUsage = Record<string, number>;
289289

290-
export type StoredFocusGroup =
290+
export type StoredLaunchpadGroup =
291291
| 'current-branch'
292292
| 'pinned'
293293
| 'mergeable'

src/container.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ import { GitProviderService } from './git/gitProviderService';
2020
import { LineHoverController } from './hovers/lineHoverController';
2121
import type { RepositoryPathMappingProvider } from './pathMapping/repositoryPathMappingProvider';
2222
import { DraftService } from './plus/drafts/draftsService';
23-
import { EnrichmentService } from './plus/focus/enrichmentService';
24-
import { FocusIndicator } from './plus/focus/focusIndicator';
25-
import { FocusProvider } from './plus/focus/focusProvider';
2623
import { AccountAuthenticationProvider } from './plus/gk/account/authenticationProvider';
2724
import { OrganizationService } from './plus/gk/account/organizationService';
2825
import { SubscriptionService } from './plus/gk/account/subscriptionService';
@@ -32,6 +29,9 @@ import { IntegrationAuthenticationService } from './plus/integrations/authentica
3229
import { IntegrationService } from './plus/integrations/integrationService';
3330
import type { GitHubApi } from './plus/integrations/providers/github/github';
3431
import type { GitLabApi } from './plus/integrations/providers/gitlab/gitlab';
32+
import { EnrichmentService } from './plus/launchpad/enrichmentService';
33+
import { LaunchpadIndicator } from './plus/launchpad/launchpadIndicator';
34+
import { LaunchpadProvider } from './plus/launchpad/launchpadProvider';
3535
import { RepositoryIdentityService } from './plus/repos/repositoryIdentityService';
3636
import { registerAccountWebviewView } from './plus/webviews/account/registration';
3737
import type { GraphWebviewShowingArgs } from './plus/webviews/graph/registration';
@@ -193,7 +193,7 @@ export class Container {
193193
private _disposables: Disposable[];
194194
private _terminalLinks: GitTerminalLinkProvider | undefined;
195195
private _webviews: WebviewsController;
196-
private _focusIndicator: FocusIndicator | undefined;
196+
private _launchpadIndicator: LaunchpadIndicator | undefined;
197197

198198
private constructor(
199199
context: ExtensionContext,
@@ -234,7 +234,7 @@ export class Container {
234234
this._disposables.push((this._keyboard = new Keyboard()));
235235
this._disposables.push((this._vsls = new VslsController(this)));
236236
this._disposables.push((this._eventBus = new EventBus()));
237-
this._disposables.push((this._focusProvider = new FocusProvider(this)));
237+
this._disposables.push((this._launchpadProvider = new LaunchpadProvider(this)));
238238

239239
this._disposables.push((this._fileAnnotationController = new FileAnnotationController(this)));
240240
this._disposables.push((this._lineAnnotationController = new LineAnnotationController(this)));
@@ -295,7 +295,7 @@ export class Container {
295295
this._disposables.push((this._accountView = registerAccountWebviewView(this._webviews)));
296296

297297
if (configuration.get('launchpad.indicator.enabled')) {
298-
this._disposables.push((this._focusIndicator = new FocusIndicator(this, this._focusProvider)));
298+
this._disposables.push((this._launchpadIndicator = new LaunchpadIndicator(this, this._launchpadProvider)));
299299
}
300300

301301
if (configuration.get('terminalLinks.enabled')) {
@@ -313,13 +313,15 @@ export class Container {
313313
}
314314

315315
if (configuration.changed(e, 'launchpad.indicator.enabled')) {
316-
this._focusIndicator?.dispose();
317-
this._focusIndicator = undefined;
316+
this._launchpadIndicator?.dispose();
317+
this._launchpadIndicator = undefined;
318318

319319
this.telemetry.sendEvent('launchpad/indicator/hidden');
320320

321321
if (configuration.get('launchpad.indicator.enabled')) {
322-
this._disposables.push((this._focusIndicator = new FocusIndicator(this, this._focusProvider)));
322+
this._disposables.push(
323+
(this._launchpadIndicator = new LaunchpadIndicator(this, this._launchpadProvider)),
324+
);
323325
}
324326
}
325327
}),
@@ -558,9 +560,9 @@ export class Container {
558560
return this._fileHistoryView;
559561
}
560562

561-
private readonly _focusProvider: FocusProvider;
562-
get focus(): FocusProvider {
563-
return this._focusProvider;
563+
private readonly _launchpadProvider: LaunchpadProvider;
564+
get launchpad(): LaunchpadProvider {
565+
return this._launchpadProvider;
564566
}
565567

566568
private readonly _git: GitProviderService;

src/features.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ export const enum PlusFeatures {
3737
Timeline = 'timeline',
3838
Worktrees = 'worktrees',
3939
Graph = 'graph',
40-
Focus = 'focus',
40+
Launchpad = 'launchpad',
4141
}

src/git/gitProviderService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ export class GitProviderService implements Disposable {
748748
return { allowed: subscription.account?.verified !== false, subscription: { current: subscription } };
749749
}
750750

751-
if (feature === 'focus') {
751+
if (feature === 'launchpad') {
752752
// If our launchpad graduation promo is active allow access for everyone
753753
if (getApplicablePromo(subscription.state, 'launchpad')) {
754754
return { allowed: true, subscription: { current: subscription } };

src/plus/drafts/draftsService.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ import { Logger } from '../../system/logger';
4343
import type { LogScope } from '../../system/logger.scope';
4444
import { getLogScope } from '../../system/logger.scope';
4545
import { getSettledValue } from '../../system/promise';
46-
import type { FocusItem } from '../focus/focusProvider';
4746
import type { OrganizationMember } from '../gk/account/organization';
4847
import type { SubscriptionAccount } from '../gk/account/subscription';
4948
import type { ServerConnection } from '../gk/serverConnection';
5049
import type { IntegrationId } from '../integrations/providers/models';
5150
import { providersMetadata } from '../integrations/providers/models';
5251
import { getEntityIdentifierInput } from '../integrations/providers/utils';
52+
import type { LaunchpadItem } from '../launchpad/launchpadProvider';
5353

5454
export interface ProviderAuth {
5555
provider: IntegrationId;
@@ -820,13 +820,13 @@ export class DraftService implements Disposable {
820820
options?: { includeArchived?: boolean },
821821
): Promise<Draft[]>;
822822
async getCodeSuggestions(
823-
focusItem: FocusItem,
823+
launchpadItem: LaunchpadItem,
824824
integrationId: IntegrationId,
825825
options?: { includeArchived?: boolean },
826826
): Promise<Draft[]>;
827827
@log<DraftService['getCodeSuggestions']>({ args: { 0: i => i.id, 1: r => (isRepository(r) ? r.id : r) } })
828828
async getCodeSuggestions(
829-
item: PullRequest | FocusItem,
829+
item: PullRequest | LaunchpadItem,
830830
repositoryOrIntegrationId: Repository | IntegrationId,
831831
options?: { includeArchived?: boolean },
832832
): Promise<Draft[]> {

src/plus/gk/account/subscriptionService.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1577,7 +1577,6 @@ function getTrackingContextFromSource(source: Source | undefined): TrackingConte
15771577
switch (source.detail.action) {
15781578
case 'worktree':
15791579
return 'worktrees';
1580-
case 'focus':
15811580
case 'launchpad':
15821581
return 'launchpad';
15831582
}

0 commit comments

Comments
 (0)