From f1e4e3949e989cc02af15c181efe091cd3fa60df Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 31 May 2026 17:06:26 +0800 Subject: [PATCH] fix(web): show source mismatch reason in status chain --- apps/web/messages/en.json | 10 +++++++++- apps/web/messages/zh-TW.json | 10 +++++++++- .../src/components/awooop/status-chain.tsx | 20 ++++++++++++++++++- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/apps/web/messages/en.json b/apps/web/messages/en.json index a25bec7c..9124a5d0 100644 --- a/apps/web/messages/en.json +++ b/apps/web/messages/en.json @@ -3672,7 +3672,7 @@ "mcpDetail": "top={topTool}; first-class={firstClass}; legacy={legacy}; policy={policy}", "source": "Sentry / SigNoz", "sourceValue": "{status}; direct {direct}, candidate {candidate}, applied {applied}", - "sourceDetail": "{providers}", + "sourceDetail": "{providers}; reason={reason}", "execution": "Executor", "executionValue": "{executor} / {status}", "executionDetail": "operation={operation}; action={action}; ops={ops}", @@ -3689,7 +3689,15 @@ "directCandidate": "Direct / Candidate / Applied", "directCandidateValue": "{direct} / {candidate} / {applied}", "latestApplied": "最新套用事件", + "reason": "未匹配原因", "providers": "Provider", + "reasons": { + "providerHeartbeatNoMatch": "Provider 有心跳,但這個 Incident 尚未匹配", + "noMatchingProviderSourceEvent": "查無可匹配的 Sentry / SigNoz 事件", + "noIncidentIds": "缺 Incident ID,無法關聯", + "incidentNotFound": "Incident 記錄不存在", + "fetchFailed": "讀取來源關聯失敗" + }, "flow": { "providerIngress": "Provider 接收", "sourceEvidence": "來源證據", diff --git a/apps/web/messages/zh-TW.json b/apps/web/messages/zh-TW.json index a25bec7c..9124a5d0 100644 --- a/apps/web/messages/zh-TW.json +++ b/apps/web/messages/zh-TW.json @@ -3672,7 +3672,7 @@ "mcpDetail": "top={topTool}; first-class={firstClass}; legacy={legacy}; policy={policy}", "source": "Sentry / SigNoz", "sourceValue": "{status}; direct {direct}, candidate {candidate}, applied {applied}", - "sourceDetail": "{providers}", + "sourceDetail": "{providers}; reason={reason}", "execution": "Executor", "executionValue": "{executor} / {status}", "executionDetail": "operation={operation}; action={action}; ops={ops}", @@ -3689,7 +3689,15 @@ "directCandidate": "Direct / Candidate / Applied", "directCandidateValue": "{direct} / {candidate} / {applied}", "latestApplied": "最新套用事件", + "reason": "未匹配原因", "providers": "Provider", + "reasons": { + "providerHeartbeatNoMatch": "Provider 有心跳,但這個 Incident 尚未匹配", + "noMatchingProviderSourceEvent": "查無可匹配的 Sentry / SigNoz 事件", + "noIncidentIds": "缺 Incident ID,無法關聯", + "incidentNotFound": "Incident 記錄不存在", + "fetchFailed": "讀取來源關聯失敗" + }, "flow": { "providerIngress": "Provider 接收", "sourceEvidence": "來源證據", diff --git a/apps/web/src/components/awooop/status-chain.tsx b/apps/web/src/components/awooop/status-chain.tsx index 7bfb1b18..d1f8bf52 100644 --- a/apps/web/src/components/awooop/status-chain.tsx +++ b/apps/web/src/components/awooop/status-chain.tsx @@ -276,8 +276,16 @@ export function AwoooPStatusChainPanel({ no_incident_context: t("source.verificationStatuses.noIncidentContext"), fetch_failed: t("source.verificationStatuses.fetchFailed"), }; + const sourceReasonLabels: Record = { + provider_heartbeat_present_but_no_incident_match: t("source.reasons.providerHeartbeatNoMatch"), + no_matching_provider_source_event: t("source.reasons.noMatchingProviderSourceEvent"), + no_incident_ids: t("source.reasons.noIncidentIds"), + incident_not_found: t("source.reasons.incidentNotFound"), + source_correlation_fetch_failed: t("source.reasons.fetchFailed"), + }; const sourceStatus = String(sourceCorrelation?.status ?? "missing"); const sourceVerificationStatus = String(sourceCorrelation?.verification_status ?? sourceStatus); + const sourceMissingReason = String(sourceCorrelation?.missing_reason ?? ""); const topAppliedLink = sourceCorrelation?.top_candidates?.find( (item) => item.link_state === "applied" ); @@ -398,6 +406,7 @@ export function AwoooPStatusChainPanel({ }), detail: t("toolchain.sourceDetail", { providers: sourceProviderSummary || emptyLabel, + reason: sourceReasonLabels[sourceMissingReason] ?? valueOrEmpty(sourceMissingReason, emptyLabel), }), }, { @@ -603,7 +612,7 @@ export function AwoooPStatusChainPanel({ ))} -
+

{t("source.status")}

@@ -635,6 +644,15 @@ export function AwoooPStatusChainPanel({ {latestAppliedLabel}

+
+

{t("source.reason")}

+

+ {sourceReasonLabels[sourceMissingReason] ?? valueOrEmpty(sourceMissingReason, emptyLabel)} +

+

{t("source.providers")}