From a01b1c20660f4024e202bbc2aae2dce41f86a840 Mon Sep 17 00:00:00 2001 From: Alex Southwell <4596216+saphid@users.noreply.github.com> Date: Tue, 3 Nov 2026 12:14:34 +1100 Subject: [PATCH] fix(mobile): cancelled PR checks count as failing in the checks summary Co-Authored-By: Claude Opus 5.5 --- .../src/features/pull-requests/PullRequestStatusRows.tsx | 4 +++- .../src/features/pull-requests/pullRequestStatus.test.ts | 3 +++ apps/mobile/src/features/pull-requests/pullRequestStatus.ts | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/mobile/src/features/pull-requests/PullRequestStatusRows.tsx b/apps/mobile/src/features/pull-requests/PullRequestStatusRows.tsx index 185d555cc776b..7045d817158ff 100644 --- a/apps/mobile/src/features/pull-requests/PullRequestStatusRows.tsx +++ b/apps/mobile/src/features/pull-requests/PullRequestStatusRows.tsx @@ -131,7 +131,9 @@ export function PullRequestChecksRow(props: RowProps) { className="pl-8" > {props.pr.state === "open" && - props.pr.checks.some((check) => check.status === "failure") ? ( + props.pr.checks.some( + (check) => check.status === "failure" || check.status === "cancelled", + ) ? ( ) : null} {action.available("approve-workflows") ? ( diff --git a/apps/mobile/src/features/pull-requests/pullRequestStatus.test.ts b/apps/mobile/src/features/pull-requests/pullRequestStatus.test.ts index aef40179ded64..e5cb4551db56b 100644 --- a/apps/mobile/src/features/pull-requests/pullRequestStatus.test.ts +++ b/apps/mobile/src/features/pull-requests/pullRequestStatus.test.ts @@ -97,5 +97,8 @@ describe("mobile overview check status", () => { expect( pullRequestChecksSummary({ checks: [check("success"), check("pending"), check("failure")] }), ).toMatchObject({ title: "1 check failing", count: "1 of 3" }); + expect( + pullRequestChecksSummary({ checks: [check("success"), check("cancelled")] }), + ).toMatchObject({ title: "1 check failing", tint: "accent-danger-foreground" }); }); }); diff --git a/apps/mobile/src/features/pull-requests/pullRequestStatus.ts b/apps/mobile/src/features/pull-requests/pullRequestStatus.ts index 5426266dc6893..2045dfeb1f65f 100644 --- a/apps/mobile/src/features/pull-requests/pullRequestStatus.ts +++ b/apps/mobile/src/features/pull-requests/pullRequestStatus.ts @@ -89,7 +89,9 @@ export function checkStatus(check: PullRequestCheck) { } export function pullRequestChecksSummary(pr: Pick) { - const failed = pr.checks.filter((check) => check.status === "failure").length; + const failed = pr.checks.filter( + (check) => check.status === "failure" || check.status === "cancelled", + ).length; const required = pr.checks.filter((check) => check.status === "action-required").length; const pending = pr.checks.filter((check) => check.status === "pending").length; const passed = pr.checks.filter((check) => check.status === "success").length;