From 47c9dea037bbc3a7708d9887bb5e2d1db67e8d5e Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 2 Jul 2026 19:38:40 +0800 Subject: [PATCH] fix(awooop): classify source contract not-ready state --- .../app/[locale]/awooop/work-items/page.tsx | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/apps/web/src/app/[locale]/awooop/work-items/page.tsx b/apps/web/src/app/[locale]/awooop/work-items/page.tsx index 10c609a9..c822ffd6 100644 --- a/apps/web/src/app/[locale]/awooop/work-items/page.tsx +++ b/apps/web/src/app/[locale]/awooop/work-items/page.tsx @@ -8719,12 +8719,16 @@ function AiLoopLogSourceTagsPanel({ } function stockplatformCompactTone(value: string | boolean | null | undefined) { - if (value === true || value === "ready" || String(value).includes("_ready")) { - return "border-[#b9d9c2] bg-[#f2fbf3] text-[#236332]"; - } - if (String(value).includes("blocked") || value === false) { + if ( + String(value).includes("blocked") || + String(value).includes("not_ready") || + value === false + ) { return "border-[#f0c6a8] bg-[#fff8f1] text-[#9a4d16]"; } + if (value === true || value === "ready" || String(value).endsWith("_ready")) { + return "border-[#b9d9c2] bg-[#f2fbf3] text-[#236332]"; + } return "border-[#c9d8ea] bg-[#eef5ff] text-[#1f5b9b]"; } @@ -8781,7 +8785,10 @@ function StockPlatformP0ReceiptPanel({ evidence?.stockplatform_source_contract_non_ok_source_count ?? 0; const nextOrder = priority?.next_execution_order?.[0] ?? ""; - const runtimeLabel = runtimeStatus.includes("_ready") + const runtimeReady = runtimeStatus === "stockplatform_public_api_runtime_ready"; + const sourceContractReady = + sourceContractStatus === "stockplatform_source_contract_ready"; + const runtimeLabel = runtimeReady ? t("values.ready") : t("values.blocked"); const receiptLabel = receiptProvided ? t("values.received") : t("values.missing"); @@ -8793,12 +8800,12 @@ function StockPlatformP0ReceiptPanel({ : dataDependency === "none" ? t("values.ready") : t("values.review"); - const sourceContractLabel = sourceContractStatus.includes("_ready") + const sourceContractLabel = sourceContractReady ? t("values.ready") : sourceContractReceiptProvided ? t("values.sourcesNeedWork", { count: sourceContractNonOkCount }) : t("values.missing"); - const verifierLabel = runtimeStatus.includes("_ready") + const verifierLabel = runtimeReady ? t("values.ready") : t("values.pending"); const nextActionLabel = @@ -8851,7 +8858,7 @@ function StockPlatformP0ReceiptPanel({ value: verifierLabel, detail: t("metricDetails.verifier"), icon: CheckCircle2, - tone: stockplatformCompactTone(runtimeStatus.includes("_ready")), + tone: stockplatformCompactTone(runtimeReady), }, ];