fix: keep draft PR icons muted (#3424)
This commit is contained in:
@@ -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" });
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user