fix: keep draft PR icons muted (#3424)

This commit is contained in:
Carlos Florêncio
2026-09-06 11:36:41 +01:00
committed by GitHub
parent 188fb09082
commit fed90594d3
7 changed files with 261 additions and 4 deletions
@@ -41,6 +41,20 @@ describe("draft PR task status", () => {
expect(getPRStatusColor(draftPR())).toBe("text-muted-foreground");
});
// @covers AC-UI-PR-TASK-STATUS-SUMMARY-001.20
it("stays muted when checks fail", () => {
expect(getPRStatusColor({ ...draftPR(), checks_state: "failure" })).toBe(
"text-muted-foreground",
);
});
// @covers AC-UI-PR-TASK-STATUS-SUMMARY-001.20
it("stays muted when changes are requested", () => {
expect(getPRStatusColor({ ...draftPR(), review_state: "changes_requested" })).toBe(
"text-muted-foreground",
);
});
it("identifies the draft without claiming it is ready to merge", () => {
const summary = derivePRTaskStatusSummary(draftPR(), false);
expect(summary.rows.at(-1)).toEqual({ kind: "merge", status: "draft", tone: "muted" });
+3 -3
View File
@@ -156,12 +156,12 @@ export function getPRStatusColor(pr: TaskPR): string {
// membership must remain visible while provider checks or mergeability
// fields hydrate, even when those fields still describe an earlier state.
if (isPRQueued(pr)) return QUEUED;
if (pr.review_state === "changes_requested" || pr.checks_state === "failure") {
return RED_500;
}
if (isPRDraft(pr)) {
return MUTED_FOREGROUND;
}
if (pr.review_state === "changes_requested" || pr.checks_state === "failure") {
return RED_500;
}
const blockerColor = openMergeBlockerColor(pr);
if (blockerColor) return blockerColor;
if (isPRReadyToMerge(pr)) {