diff --git a/CHANGELOG.md b/CHANGELOG.md index b99239cd612f6..a6438037ee4b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p ### Changed - Automatically stashes (and pops) uncommitted changes on Pull ([#4296](https://github.com/gitkraken/vscode-gitlens/issues/4296)) +- Removes the option to associate an issue from cards in the RECENT section of the _Home_ view ([#4333](https://github.com/gitkraken/vscode-gitlens/issues/4333)) ### Fixed diff --git a/src/webviews/apps/plus/home/components/active-work.ts b/src/webviews/apps/plus/home/components/active-work.ts index 91af225d9bc40..064f49d8cac87 100644 --- a/src/webviews/apps/plus/home/components/active-work.ts +++ b/src/webviews/apps/plus/home/components/active-work.ts @@ -5,6 +5,7 @@ import { css, html, LitElement, nothing } from 'lit'; import { customElement, state } from 'lit/decorators.js'; import { ifDefined } from 'lit/directives/if-defined.js'; import { isSubscriptionTrialOrPaidFromState } from '../../../../../plus/gk/utils/subscription.utils'; +import type { AssociateIssueWithBranchCommandArgs } from '../../../../../plus/startWork/startWork'; import { createCommandLink } from '../../../../../system/commands'; import { createWebviewCommandLink } from '../../../../../system/webview'; import type { @@ -511,4 +512,25 @@ export class GlActiveBranchCard extends GlBranchCardBase { protected getCollapsedActions(): TemplateResult[] { return []; } + + protected override renderIssuesItem(): TemplateResult | NothingType { + const issues = [...(this.issues ?? []), ...(this.autolinks ?? [])]; + if (!issues.length) { + if (!this.expanded) return nothing; + + return html`('gitlens.associateIssueWithBranch', { + branch: this.branch.reference, + source: 'home', + })} + >Associate an Issue`; + } + return super.renderIssuesItem(); + } } + +type NothingType = typeof nothing; diff --git a/src/webviews/apps/plus/home/components/branch-card.ts b/src/webviews/apps/plus/home/components/branch-card.ts index eb38d1eb8360a..42e4aa0450b19 100644 --- a/src/webviews/apps/plus/home/components/branch-card.ts +++ b/src/webviews/apps/plus/home/components/branch-card.ts @@ -12,7 +12,6 @@ import { launchpadGroupIconMap, launchpadGroupLabelMap, } from '../../../../../plus/launchpad/models/launchpad'; -import type { AssociateIssueWithBranchCommandArgs } from '../../../../../plus/startWork/startWork'; import { createCommandLink } from '../../../../../system/commands'; import { fromNow } from '../../../../../system/date'; import { interpolate, pluralize } from '../../../../../system/string'; @@ -916,18 +915,7 @@ export abstract class GlBranchCardBase extends GlElement { protected renderIssuesItem(): TemplateResult | NothingType { const issues = [...(this.issues ?? []), ...(this.autolinks ?? [])]; if (!issues.length) { - if (!this.expanded) return nothing; - - return html`('gitlens.associateIssueWithBranch', { - branch: this.branch.reference, - source: 'home', - })} - >Associate an Issue`; + return nothing; } const indicator: GlCard['indicator'] = this.branch.opened ? 'base' : undefined;