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
30 changes: 30 additions & 0 deletions contributions.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
]
}
},
"gitlens.associateIssueWithBranch": {
"label": "Associate Issue with Branch...",
"commandPalette": "gitlens:enabled && !gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders"
},
"gitlens.annotations.nextChange": {
"label": "Next Change",
"icon": "$(arrow-down)"
Expand Down Expand Up @@ -1453,6 +1457,19 @@
]
}
},
"gitlens.graph.associateIssueWithBranch": {
"label": "Associate Issue with Branch...",
"enablement": "!operationInProgress",
"menus": {
"webview/context": [
{
"when": "webviewItem =~ /gitlens:branch\\b(?!.*?\\b\\+remote\\b)/ && !gitlens:hasVirtualFolders && !gitlens:readonly && !gitlens:untrusted",
"group": "1_gitlens_actions",
"order": 8
}
]
}
},
"gitlens.graph.cherryPick": {
"label": "Cherry Pick Commit...",
"enablement": "!operationInProgress",
Expand Down Expand Up @@ -4739,6 +4756,19 @@
]
}
},
"gitlens.views.associateIssueWithBranch": {
"label": "Associate Issue with Branch...",
"enablement": "!operationInProgress",
"menus": {
"view/item/context": [
{
"when": "viewItem =~ /gitlens:branch\\b(?!.*?\\b\\+remote\\b)/ && !listMultiSelection && !gitlens:hasVirtualFolders && !gitlens:readonly && !gitlens:untrusted",
"group": "1_gitlens_actions",
"order": 8
}
]
}
},
"gitlens.views.addRemote": {
"label": "Add Remote...",
"icon": "$(add)",
Expand Down
107 changes: 103 additions & 4 deletions docs/telemetry-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,105 @@ or
}
```

### associateIssueWithBranch/action

> Sent when the user chooses to manage integrations

```typescript
{
'instance': number,
'action': 'manage' | 'connect',
'connected': boolean,
'items.count': number
}
```

### associateIssueWithBranch/issue/action

> Sent when the user takes an action on an issue

```typescript
{
'instance': number,
'action': 'soft-open',
'connected': boolean,
[`item.${string}`]: string | number | boolean,
'items.count': number
}
```

### associateIssueWithBranch/issue/chosen

> Sent when the user chooses an issue to associate with the branch in the second step

```typescript
{
'instance': number,
'connected': boolean,
[`item.${string}`]: string | number | boolean,
'items.count': number
}
```

### associateIssueWithBranch/open

> Sent when the user opens Start Work; use `instance` to correlate an Associate Issue with Branch "session"

```typescript
{
'instance': number
}
```

### associateIssueWithBranch/opened

> Sent when the launchpad is opened; use `instance` to correlate an Associate Issue with Branch "session"

```typescript
{
'instance': number,
'connected': boolean,
'items.count': number
}
```

### associateIssueWithBranch/steps/connect

> Sent when the user reaches the "connect an integration" step of Associate Issue with Branch

```typescript
{
'instance': number,
'connected': boolean,
'items.count': number
}
```

### associateIssueWithBranch/steps/issue

> Sent when the user reaches the "choose an issue" step of Associate Issue with Branch

```typescript
{
'instance': number,
'connected': boolean,
'items.count': number
}
```

### associateIssueWithBranch/title/action

> Sent when the user chooses to connect an integration

```typescript
{
'instance': number,
'action': 'connect',
'connected': boolean,
'items.count': number
}
```

### cloudIntegrations/connected

> Sent when connected to one or more cloud-based integrations from gkdev
Expand Down Expand Up @@ -960,7 +1059,7 @@ void
{
'instance': number,
'items.error': string,
'action': 'open' | 'code-suggest' | 'merge' | 'soft-open' | 'switch' | 'open-worktree' | 'switch-and-code-suggest' | 'show-overview' | 'open-changes' | 'open-in-graph' | 'pin' | 'unpin' | 'snooze' | 'unsnooze' | 'open-suggestion' | 'open-suggestion-browser',
'action': 'soft-open' | 'open' | 'code-suggest' | 'merge' | 'switch' | 'open-worktree' | 'switch-and-code-suggest' | 'show-overview' | 'open-changes' | 'open-in-graph' | 'pin' | 'unpin' | 'snooze' | 'unsnooze' | 'open-suggestion' | 'open-suggestion-browser',
'groups.blocked.collapsed': boolean,
'groups.blocked.count': number,
'groups.count': number,
Expand Down Expand Up @@ -1257,7 +1356,7 @@ void
{
'instance': number,
'items.error': string,
'action': 'settings' | 'feedback' | 'open-on-gkdev' | 'refresh' | 'connect',
'action': 'settings' | 'connect' | 'feedback' | 'open-on-gkdev' | 'refresh',
'groups.blocked.collapsed': boolean,
'groups.blocked.count': number,
'groups.count': number,
Expand Down Expand Up @@ -1298,7 +1397,7 @@ void
'provider': string,
'repoPrivacy': 'private' | 'public' | 'local',
'repository.visibility': 'private' | 'public' | 'local',
'source': 'account' | 'subscription' | 'graph' | 'patchDetails' | 'settings' | 'timeline' | 'home' | 'code-suggest' | 'cloud-patches' | 'commandPalette' | 'deeplink' | 'inspect' | 'inspect-overview' | 'integrations' | 'launchpad' | 'launchpad-indicator' | 'launchpad-view' | 'notification' | 'prompt' | 'quick-wizard' | 'remoteProvider' | 'startWork' | 'trial-indicator' | 'scm-input' | 'walkthrough' | 'whatsnew' | 'worktrees'
'source': 'account' | 'subscription' | 'graph' | 'patchDetails' | 'settings' | 'timeline' | 'home' | 'view' | 'code-suggest' | 'associateIssueWithBranch' | 'cloud-patches' | 'commandPalette' | 'deeplink' | 'inspect' | 'inspect-overview' | 'integrations' | 'launchpad' | 'launchpad-indicator' | 'launchpad-view' | 'notification' | 'prompt' | 'quick-wizard' | 'remoteProvider' | 'startWork' | 'trial-indicator' | 'scm-input' | 'walkthrough' | 'whatsnew' | 'worktrees'
}
```

Expand Down Expand Up @@ -1468,7 +1567,7 @@ void
```typescript
{
'instance': number,
'action': 'connect' | 'manage',
'action': 'manage' | 'connect',
'connected': boolean,
'items.count': number
}
Expand Down
37 changes: 37 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5746,6 +5746,11 @@
"category": "GitLens",
"icon": "$(person-add)"
},
{
"command": "gitlens.associateIssueWithBranch",
"title": "Associate Issue with Branch...",
"category": "GitLens"
},
{
"command": "gitlens.annotations.nextChange",
"title": "Next Change",
Expand Down Expand Up @@ -6302,6 +6307,11 @@
"title": "Add as Co-author",
"icon": "$(person-add)"
},
{
"command": "gitlens.graph.associateIssueWithBranch",
"title": "Associate Issue with Branch...",
"enablement": "!operationInProgress"
},
{
"command": "gitlens.graph.cherryPick",
"title": "Cherry Pick Commit...",
Expand Down Expand Up @@ -7553,6 +7563,11 @@
"title": "Add Co-authors...",
"icon": "$(person-add)"
},
{
"command": "gitlens.views.associateIssueWithBranch",
"title": "Associate Issue with Branch...",
"enablement": "!operationInProgress"
},
{
"command": "gitlens.views.addRemote",
"title": "Add Remote...",
Expand Down Expand Up @@ -9850,6 +9865,10 @@
"command": "gitlens.applyPatchFromClipboard",
"when": "gitlens:enabled && !gitlens:untrusted && !gitlens:hasVirtualFolders"
},
{
"command": "gitlens.associateIssueWithBranch",
"when": "gitlens:enabled && !gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders"
},
{
"command": "gitlens.browseRepoAtRevision",
"when": "!gitlens:hasVirtualFolders && gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/"
Expand Down Expand Up @@ -10250,6 +10269,10 @@
"command": "gitlens.graph.addAuthor",
"when": "false"
},
{
"command": "gitlens.graph.associateIssueWithBranch",
"when": "false"
},
{
"command": "gitlens.graph.cherryPick",
"when": "false"
Expand Down Expand Up @@ -11206,6 +11229,10 @@
"command": "gitlens.views.applyChanges",
"when": "false"
},
{
"command": "gitlens.views.associateIssueWithBranch",
"when": "false"
},
{
"command": "gitlens.views.branches.copy",
"when": "false"
Expand Down Expand Up @@ -15205,6 +15232,11 @@
"when": "viewItem =~ /gitlens:branch\\b(?!.*?\\b\\+(current|checkedout)\\b)(?!.*?\\b\\+closed\\b)/ && listMultiSelection && !gitlens:hasVirtualFolders && !gitlens:readonly && !gitlens:untrusted",
"group": "1_gitlens_actions@7"
},
{
"command": "gitlens.views.associateIssueWithBranch",
"when": "viewItem =~ /gitlens:branch\\b(?!.*?\\b\\+remote\\b)/ && !listMultiSelection && !gitlens:hasVirtualFolders && !gitlens:readonly && !gitlens:untrusted",
"group": "1_gitlens_actions@8"
},
{
"command": "gitlens.views.createBranch",
"when": "viewItem =~ /gitlens:branch\\b(?!.*?\\b\\+closed\\b)/ && !listMultiSelection && !gitlens:hasVirtualFolders && !gitlens:readonly && !gitlens:untrusted",
Expand Down Expand Up @@ -18091,6 +18123,11 @@
"when": "webviewItem =~ /gitlens:branch\\b(?!.*?\\b\\+(current|checkedout)\\b)/ && !gitlens:hasVirtualFolders && !gitlens:readonly && !gitlens:untrusted",
"group": "1_gitlens_actions@7"
},
{
"command": "gitlens.graph.associateIssueWithBranch",
"when": "webviewItem =~ /gitlens:branch\\b(?!.*?\\b\\+remote\\b)/ && !gitlens:hasVirtualFolders && !gitlens:readonly && !gitlens:untrusted",
"group": "1_gitlens_actions@8"
},
{
"command": "gitlens.graph.createBranch",
"when": "webviewItem =~ /gitlens:branch\\b/ && !gitlens:hasVirtualFolders && !gitlens:readonly && !gitlens:untrusted",
Expand Down
9 changes: 6 additions & 3 deletions src/commands/quickWizard.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { GlCommand } from '../constants.commands';
import type { Container } from '../container';
import type { LaunchpadCommandArgs } from '../plus/launchpad/launchpad';
import type { StartWorkCommandArgs } from '../plus/startWork/startWork';
import type { AssociateIssueWithBranchCommandArgs, StartWorkCommandArgs } from '../plus/startWork/startWork';
import { command } from '../system/vscode/command';
import type { CommandContext } from './base';
import type { QuickWizardCommandArgsWithCompletion } from './quickWizard.base';
import { QuickWizardCommandBase } from './quickWizard.base';

export type QuickWizardCommandArgs = LaunchpadCommandArgs | StartWorkCommandArgs;
export type QuickWizardCommandArgs = LaunchpadCommandArgs | StartWorkCommandArgs | AssociateIssueWithBranchCommandArgs;

@command()
export class QuickWizardCommand extends QuickWizardCommandBase {
constructor(container: Container) {
super(container, [GlCommand.ShowLaunchpad, GlCommand.StartWork]);
super(container, [GlCommand.ShowLaunchpad, GlCommand.StartWork, GlCommand.AssociateIssueWithBranch]);
}

protected override preExecute(
Expand All @@ -26,6 +26,9 @@ export class QuickWizardCommand extends QuickWizardCommandBase {
case GlCommand.StartWork:
return this.execute({ command: 'startWork', ...args });

case GlCommand.AssociateIssueWithBranch:
return this.execute({ command: 'associateIssueWithBranch', ...args });

default:
return this.execute(args);
}
Expand Down
6 changes: 5 additions & 1 deletion src/commands/quickWizard.utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { StoredRecentUsage } from '../constants.storage';
import type { Container } from '../container';
import { LaunchpadCommand } from '../plus/launchpad/launchpad';
import { StartWorkCommand } from '../plus/startWork/startWork';
import { AssociateIssueWithBranchCommand, StartWorkCommand } from '../plus/startWork/startWork';
import { configuration } from '../system/vscode/configuration';
import { getContext } from '../system/vscode/context';
import { BranchGitCommand } from './git/branch';
Expand Down Expand Up @@ -117,6 +117,10 @@ export class QuickWizardRootStep implements QuickPickStep<QuickCommand> {
if (args?.command === 'startWork') {
this.hiddenItems.push(new StartWorkCommand(container, args));
}

if (args?.command === 'associateIssueWithBranch') {
this.hiddenItems.push(new AssociateIssueWithBranchCommand(container, args));
}
}

private _command: QuickCommand | undefined;
Expand Down
3 changes: 3 additions & 0 deletions src/constants.commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const actionCommandPrefix = 'gitlens.action.';

export const enum GlCommand {
AddAuthors = 'gitlens.addAuthors',
AssociateIssueWithBranch = 'gitlens.associateIssueWithBranch',
BrowseRepoAtRevision = 'gitlens.browseRepoAtRevision',
BrowseRepoAtRevisionInNewWindow = 'gitlens.browseRepoAtRevisionInNewWindow',
BrowseRepoBeforeRevision = 'gitlens.browseRepoBeforeRevision',
Expand Down Expand Up @@ -572,6 +573,7 @@ export type TreeViewCommands = `gitlens.views.${
| 'addAuthors'
| 'addAuthor'
| 'addAuthor.multi'
| 'associateIssueWithBranch'
| 'openBranchOnRemote'
| 'openBranchOnRemote.multi'
| 'copyRemoteCommitUrl'
Expand Down Expand Up @@ -697,6 +699,7 @@ type GraphWebviewCommands = `graph.${
| 'pull'
| 'fetch'
| 'pushWithForce'
| 'associateIssueWithBranch'
| 'publishBranch'
| 'switchToAnotherBranch'
| 'createBranch'
Expand Down
Loading
Loading