Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes issue autolinks rendering when autolinks enabled is false #3924

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Fixes intermittent issue with greater reliability of webview requests
- Fixes an issue with autolink enrichment for issues
- Fixes issues with incorrect aggregate contributor stats
- Fixes [#3841](https://github.com/gitkraken/vscode-gitlens/issues/3841) - Inspect & Graph Details: issue autolinks rendering when autolinks enabled is false

## [16.1.1] - 2024-12-20

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ export class GlCommitDetails extends GlDetailsBase {

private renderAutoLinks() {
if (this.isUncommitted) return undefined;
if (!this.state?.autolinksEnabled) {
return nothing;
}
Comment on lines 206 to +209
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit:

Suggested change
if (this.isUncommitted) return undefined;
if (!this.state?.autolinksEnabled) {
return nothing;
}
if (this.isUncommitted || !this.state?.autolinksEnabled) return undefined;


const deduped = new Map<
string,
Expand Down
7 changes: 6 additions & 1 deletion src/webviews/commitDetails/commitDetailsWebview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,11 @@ export class CommitDetailsWebviewProvider
preferences: current.preferences,
includeRichContent: current.richStateLoaded,
autolinkedIssues: current.autolinkedIssues?.map(serializeIssueOrPullRequest),
pullRequest: current.pullRequest != null ? serializePullRequest(current.pullRequest) : undefined,
autolinksEnabled: configuration.get('views.commitDetails.autolinks.enabled') ?? false,
pullRequest:
configuration.get('views.commitDetails.autolinks.enabled') && current.pullRequest != null
Comment on lines +1242 to +1244
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: consolidated the two configuration lookups

? serializePullRequest(current.pullRequest)
: undefined,
wip: serializeWipContext(wip),
orgSettings: current.orgSettings,
inReview: current.inReview,
Expand Down Expand Up @@ -1424,6 +1428,7 @@ export class CommitDetailsWebviewProvider
configuration.get('views.commitDetails.autolinks.enhanced')
? pauseOnCancelOrTimeoutMapTuplePromise(commit.getEnrichedAutolinks(remote))
: undefined,
configuration.get('views.commitDetails.autolinks.enabled') &&
configuration.get('views.commitDetails.pullRequests.enabled')
? commit.getAssociatedPullRequest(remote)
: undefined,
Expand Down
1 change: 1 addition & 0 deletions src/webviews/commitDetails/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export interface State extends WebviewState {

commit?: CommitDetails;
autolinkedIssues?: IssueOrPullRequest[];
autolinksEnabled: boolean;
pullRequest?: PullRequestShape;
wip?: Wip;
inReview?: boolean;
Expand Down
Loading