Skip to content

Commit ab8e2fc

Browse files
committed
Adds connect remote integration to autolinks nodes
Renames remote integration command
1 parent 999ac8c commit ab8e2fc

File tree

5 files changed

+38
-13
lines changed

5 files changed

+38
-13
lines changed

CHANGELOG.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,24 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
88

99
### Added
1010

11-
- Adds a _Copy as Markdown_ context menu command to autolinks in the "Autolinked Issues and Pull Requests" section in the _Search & Compare_ view
11+
- Adds a _Copy as Markdown_ context menu command to autolinks in the _Autolinked Issues and Pull Requests_ section in the _Search & Compare_ view
12+
- Adds a _Connect Remote Integration_ command to the _Autolinked Issues and Pull Requests_ section in the _Search & Compare_ view
1213

1314
### Changed
1415

15-
- Improves the _Copy_ context menu command on autolinks in the "Autolinked Issues and Pull Requests" section in the _Search & Compare_ view
16-
- Changes the _Open Issue on Remote_ context menu command on autolinks to _Open URL_ in the "Autolinked Issues and Pull Requests" section in the _Search & Compare_ view
17-
- Changes the _Copy Issue URL_ context menu command on autolinks to _Copy URL_ in the "Autolinked Issues and Pull Requests" section in the _Search & Compare_ view
16+
- Improves the _Copy_ context menu command on autolinks in the _Autolinked Issues and Pull Requests_ section in the _Search & Compare_ view
17+
- Changes the _Open Issue on Remote_ context menu command on autolinks to _Open URL_ in the _Autolinked Issues and Pull Requests_ section in the _Search & Compare_ view
18+
- Changes the _Copy Issue URL_ context menu command on autolinks to _Copy URL_ in the _Autolinked Issues and Pull Requests_ section in the _Search & Compare_ view
19+
- Renames the _Connect to Remote_ command to _Connect Remote Integration_
20+
- Renames the _Disconnect from Remote_ command to _Disconnect Remote Integration_
1821

1922
### Fixed
2023

2124
- Fixes [#3299](https://github.com/gitkraken/vscode-gitlens/issues/3299) - Branches view no longer displays text colors for branch status after updating to v15.0.0 or above
2225
- Fixes [#3277](https://github.com/gitkraken/vscode-gitlens/issues/3277) (in pre-release only) - Unable to pull branch when the local branch whose name differs from its tracking branch
2326
- Fixes "hang" in Worktrees view when a worktree is missing
2427
- Fixes an issue where the Commit Graph header bar sometimes pushes "Fetch" to the right
25-
- Fixes an issue where the autolink type (issue vs pull request) was not shown properly in the "Autolinked Issues and Pull Requests" section in the _Search & Compare_ view
28+
- Fixes an issue where the autolink type (issue vs pull request) was not shown properly in the _Autolinked Issues and Pull Requests_ section in the _Search & Compare_ view
2629

2730
## [15.0.3] - 2024-05-14
2831

package.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6336,13 +6336,13 @@
63366336
},
63376337
{
63386338
"command": "gitlens.connectRemoteProvider",
6339-
"title": "Connect to Remote",
6339+
"title": "Connect Remote Integration",
63406340
"category": "GitLens",
63416341
"icon": "$(plug)"
63426342
},
63436343
{
63446344
"command": "gitlens.disconnectRemoteProvider",
6345-
"title": "Disconnect from Remote",
6345+
"title": "Disconnect Remote Integration",
63466346
"category": "GitLens",
63476347
"icon": "$(gitlens-unplug)"
63486348
},
@@ -14193,11 +14193,21 @@
1419314193
"group": "5_gitlens_open@2",
1419414194
"alt": "gitlens.copyRemoteFileUrlWithoutRange"
1419514195
},
14196+
{
14197+
"command": "gitlens.connectRemoteProvider",
14198+
"when": "config.gitlens.integrations.enabled && viewItem =~ /gitlens:autolinked:items\\b/ && gitlens:hasRichRemotes && !gitlens:hasConnectedRemotes",
14199+
"group": "inline@98"
14200+
},
1419614201
{
1419714202
"command": "gitlens.showSettingsPage!autolinks",
1419814203
"when": "viewItem =~ /gitlens:autolinked:items\\b/",
1419914204
"group": "inline@99"
1420014205
},
14206+
{
14207+
"command": "gitlens.connectRemoteProvider",
14208+
"when": "config.gitlens.integrations.enabled && viewItem =~ /gitlens:autolinked:items\\b/ && gitlens:hasRichRemotes && !gitlens:hasConnectedRemotes",
14209+
"group": "6_gitlens_actions@1"
14210+
},
1420114211
{
1420214212
"command": "gitlens.showSettingsPage!autolinks",
1420314213
"when": "!listMultiSelection && viewItem =~ /gitlens:autolinked:items\\b/",

src/commands/openPullRequestOnRemote.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { env, Uri, window } from 'vscode';
1+
import { env, window } from 'vscode';
22
import { Commands } from '../constants';
33
import type { Container } from '../container';
44
import { shortenRevision } from '../git/models/reference';
55
import { command } from '../system/command';
6+
import { openUrl } from '../system/utils';
67
import { PullRequestNode } from '../views/nodes/pullRequestNode';
78
import type { CommandContext } from './base';
89
import { Command } from './base';
@@ -55,7 +56,7 @@ export class OpenPullRequestOnRemoteCommand extends Command {
5556
if (args.clipboard) {
5657
await env.clipboard.writeText(args.pr.url);
5758
} else {
58-
void env.openExternal(Uri.parse(args.pr.url));
59+
void openUrl(args.pr.url);
5960
}
6061
}
6162
}

src/git/gitProviderService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ export class GitProviderService implements Disposable {
11001100
}
11011101

11021102
if (!hasRemotesWithIntegrations && integrations) {
1103-
hasRemotesWithIntegrations = await repo.hasRemoteWithIntegration();
1103+
hasRemotesWithIntegrations = await repo.hasRemoteWithIntegration({ includeDisconnected: true });
11041104

11051105
if (hasRemotesWithIntegrations) {
11061106
hasRemotes = true;

src/views/nodes/compareResultsNode.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { Disposable, TreeCheckboxChangeEvent } from 'vscode';
2-
import { ThemeIcon, TreeItem, TreeItemCheckboxState, TreeItemCollapsibleState, window } from 'vscode';
1+
import type { TreeCheckboxChangeEvent } from 'vscode';
2+
import { Disposable, ThemeIcon, TreeItem, TreeItemCheckboxState, TreeItemCollapsibleState, window } from 'vscode';
33
import { md5 } from '@env/crypto';
44
import type { StoredNamedRef } from '../../constants';
55
import type { FilesComparison } from '../../git/actions/commit';
@@ -106,7 +106,18 @@ export class CompareResultsNode extends SubscribeableViewNode<
106106
}
107107

108108
protected override subscribe(): Disposable | Promise<Disposable | undefined> | undefined {
109-
return weakEvent(this.view.onDidChangeNodesCheckedState, this.onNodesCheckedStateChanged, this);
109+
return Disposable.from(
110+
weakEvent(this.view.onDidChangeNodesCheckedState, this.onNodesCheckedStateChanged, this),
111+
weakEvent(
112+
this.view.container.integrations.onDidChangeConnectionState,
113+
this.onIntegrationConnectionStateChanged,
114+
this,
115+
),
116+
);
117+
}
118+
119+
private onIntegrationConnectionStateChanged() {
120+
this.view.triggerNodeChange(this.parent);
110121
}
111122

112123
private onNodesCheckedStateChanged(e: TreeCheckboxChangeEvent<ViewNode>) {

0 commit comments

Comments
 (0)