diff --git a/src/webviews/apps/plus/home/components/branch-section.ts b/src/webviews/apps/plus/home/components/branch-section.ts index bc19c2feb2eae..b52b4849049a5 100644 --- a/src/webviews/apps/plus/home/components/branch-section.ts +++ b/src/webviews/apps/plus/home/components/branch-section.ts @@ -57,16 +57,30 @@ export class GlBranchSection extends LitElement { @property({ type: Array }) branches!: GetOverviewBranch[]; @property({ type: Boolean }) isFetching = false; + private renderSectionLabel() { + if (this.isFetching || this.branches.length === 0) { + return this.label; + } + + return `${this.label} (${this.branches.length})`; + } + override render() { return html` - ${this.label}${when(!this.isFetching, () => html` (${this.branches.length})`)} + ${this.renderSectionLabel()} ${this.branches.map( branch => html``, )} + ${when( + this.branches.length > 0, + () => + this.branches.map( + branch => html``, + ), + () => html`

No ${this.label} branches

`, + )}
`; } diff --git a/src/webviews/apps/plus/home/components/overview.ts b/src/webviews/apps/plus/home/components/overview.ts index 0545da29d8198..2c8683d38bb12 100644 --- a/src/webviews/apps/plus/home/components/overview.ts +++ b/src/webviews/apps/plus/home/components/overview.ts @@ -95,37 +95,32 @@ export class GlOverview extends SignalWatcher(LitElement) { if (overview == null) return nothing; const { repository } = overview; return html` + + + ${when( - repository.branches.recent.length > 0, + this._overviewState.filter.stale?.show === true, () => html` - - - `, - )} - ${when( - repository.branches.stale.length > 0, - () => html` -