From a0ddd97267b841e09c58bb6d11fe2ea12b3497cd Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sun, 10 May 2026 19:35:59 +0100 Subject: [PATCH] Use singular verb agreement when one existing issue remains The patrol run-row drill-down rendered "1 existing issue remain" because the pluralization only toggled the noun, not the verb. Visible whenever an errored or unchanged run still had exactly one active finding (e.g. the Provider analysis error scenario observed in the wild). Adds a singular-case test alongside the existing plural one with a regression guard against the previous wording. --- .../src/components/patrol/RunHistoryEntry.tsx | 2 +- .../patrol/__tests__/RunHistoryEntry.test.tsx | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/frontend-modern/src/components/patrol/RunHistoryEntry.tsx b/frontend-modern/src/components/patrol/RunHistoryEntry.tsx index 3b749030c..0fd46cfd2 100644 --- a/frontend-modern/src/components/patrol/RunHistoryEntry.tsx +++ b/frontend-modern/src/components/patrol/RunHistoryEntry.tsx @@ -273,7 +273,7 @@ export function RunHistoryEntry(props: RunHistoryEntryProps) { ) : run.existing_findings > 0 ? ( <> No new issues, but {run.existing_findings} existing issue - {run.existing_findings !== 1 ? 's' : ''} remain. + {run.existing_findings !== 1 ? 's remain' : ' remains'}. ) : !hasFindingsSnapshot ? ( diff --git a/frontend-modern/src/components/patrol/__tests__/RunHistoryEntry.test.tsx b/frontend-modern/src/components/patrol/__tests__/RunHistoryEntry.test.tsx index 1a0ae381f..c281992cf 100644 --- a/frontend-modern/src/components/patrol/__tests__/RunHistoryEntry.test.tsx +++ b/frontend-modern/src/components/patrol/__tests__/RunHistoryEntry.test.tsx @@ -378,6 +378,41 @@ describe('RunHistoryEntry', () => { expect(screen.queryByText(/^All clear$/)).not.toBeInTheDocument(); }); + it('uses singular verb agreement when a single existing issue remains', () => { + render(() => ( + + )); + + expect( + screen.getByText( + (_, element) => + element?.tagName === 'P' && + (element.textContent?.includes('No new issues, but 1 existing issue remains.') ?? false), + ), + ).toBeInTheDocument(); + // Guard against the regression: the prior wording was "1 existing issue remain." + expect( + screen.queryByText( + (_, element) => + element?.tagName === 'P' && + (element.textContent?.includes('existing issue remain.') ?? false) && + !(element.textContent?.includes('remains.') ?? false), + ), + ).not.toBeInTheDocument(); + }); + it('surfaces deterministic triage runs that skipped the llm', () => { render(() => (