diff --git a/apps/loopover-ui/src/components/site/audit-feed-model.ts b/apps/loopover-ui/src/components/site/audit-feed-model.ts index 4efc4721c3..550143b2da 100644 --- a/apps/loopover-ui/src/components/site/audit-feed-model.ts +++ b/apps/loopover-ui/src/components/site/audit-feed-model.ts @@ -125,5 +125,8 @@ export function skipReasonTone(reason: string): "ready" | "info" | "warn" | "deg if (reason === "bot_author" || reason === "not_official_gittensor_miner") return "info"; if (reason === "surface_off" || reason === "maintainer_author") return "warn"; if (reason === "miner_detection_unavailable" || reason === "missing_author") return "degraded"; - return "ready"; + // #8666: an unrecognized reason degrades to the neutral "info" tone (matching + // contributor-quality-table-model's `band` convention), not "ready" -- a green/healthy tone would imply a + // successful state for a value that is actually unclassified, since none of the enumerated reasons map to "ready". + return "info"; } diff --git a/apps/loopover-ui/src/components/site/audit-feed.test.tsx b/apps/loopover-ui/src/components/site/audit-feed.test.tsx index 563d20bb0c..d26c4c2e0c 100644 --- a/apps/loopover-ui/src/components/site/audit-feed.test.tsx +++ b/apps/loopover-ui/src/components/site/audit-feed.test.tsx @@ -11,6 +11,7 @@ import { normalizeSinceInput, normalizeSkippedPrAuditExport, pullRequestHref, + skipReasonTone, } from "@/components/site/audit-feed-model"; import { AuditFeed } from "@/components/site/audit-feed"; @@ -62,6 +63,19 @@ describe("audit feed helpers", () => { ); }); + it("maps each enumerated skip reason to its tone and degrades an unrecognized reason to neutral 'info', not 'ready' (#8666)", () => { + expect(skipReasonTone("bot_author")).toBe("info"); + expect(skipReasonTone("not_official_gittensor_miner")).toBe("info"); + expect(skipReasonTone("surface_off")).toBe("warn"); + expect(skipReasonTone("maintainer_author")).toBe("warn"); + expect(skipReasonTone("miner_detection_unavailable")).toBe("degraded"); + expect(skipReasonTone("missing_author")).toBe("degraded"); + // An unrecognized/legacy reason must NOT read as a green "ready" (healthy) pill -- it degrades to the + // neutral "info" tone, matching contributor-quality-table-model's convention for unknown enum-like values. + expect(skipReasonTone("some_future_reason")).not.toBe("ready"); + expect(skipReasonTone("some_future_reason")).toBe("info"); + }); + it("formats skip reasons and pull request links", () => { expect(formatSkipReason("surface_off")).toBe("Surface off"); expect(formatSkipReason("legacy_skip_reason")).toBe("legacy skip reason");