diff --git a/ui/src/components/IssuesList.test.tsx b/ui/src/components/IssuesList.test.tsx index 0d6d3358..ba615dc2 100644 --- a/ui/src/components/IssuesList.test.tsx +++ b/ui/src/components/IssuesList.test.tsx @@ -567,13 +567,14 @@ describe("IssuesList", () => { }); }); - it("hides the sub-issue progress summary unless it is enabled and populated", async () => { + it("hides the sub-issue progress summary unless it is enabled with multiple sub-issues", async () => { const { root } = renderWithQueryClient( undefined} />, container, diff --git a/ui/src/components/IssuesList.tsx b/ui/src/components/IssuesList.tsx index 48a413a7..cce4e502 100644 --- a/ui/src/components/IssuesList.tsx +++ b/ui/src/components/IssuesList.tsx @@ -390,7 +390,7 @@ function SubIssueProgressSummaryStrip({ .filter((entry) => entry.count > 0); return ( -
+
@@ -424,7 +424,7 @@ function SubIssueProgressSummaryStrip({
-
+
{target && targetIssue ? ( <>
diff --git a/ui/src/lib/issue-detail-subissues.test.ts b/ui/src/lib/issue-detail-subissues.test.ts index 586226ba..611e677b 100644 --- a/ui/src/lib/issue-detail-subissues.test.ts +++ b/ui/src/lib/issue-detail-subissues.test.ts @@ -39,8 +39,9 @@ describe("shouldRenderRichSubIssuesSection", () => { }); describe("shouldRenderSubIssueProgressSummary", () => { - it("requires both the opt-in flag and child issues", () => { - expect(shouldRenderSubIssueProgressSummary(true, 1)).toBe(true); + it("requires both the opt-in flag and multiple child issues", () => { + expect(shouldRenderSubIssueProgressSummary(true, 2)).toBe(true); + expect(shouldRenderSubIssueProgressSummary(true, 1)).toBe(false); expect(shouldRenderSubIssueProgressSummary(false, 1)).toBe(false); expect(shouldRenderSubIssueProgressSummary(true, 0)).toBe(false); }); diff --git a/ui/src/lib/issue-detail-subissues.ts b/ui/src/lib/issue-detail-subissues.ts index 3bd3174a..379ca8c1 100644 --- a/ui/src/lib/issue-detail-subissues.ts +++ b/ui/src/lib/issue-detail-subissues.ts @@ -21,8 +21,10 @@ export function shouldRenderRichSubIssuesSection(childIssuesLoading: boolean, ch return childIssuesLoading || childIssueCount > 0; } +const MIN_CHILD_ISSUES_FOR_PROGRESS_SUMMARY = 2; + export function shouldRenderSubIssueProgressSummary(enabled: boolean | undefined, childIssueCount: number): boolean { - return enabled === true && childIssueCount > 0; + return enabled === true && childIssueCount >= MIN_CHILD_ISSUES_FOR_PROGRESS_SUMMARY; } export function buildSubIssueProgressSummary(issues: Issue[]): SubIssueProgressSummary {