fix(web): show source mismatch reason in status chain
All checks were successful
CD Pipeline / tests (push) Successful in 1m19s
Code Review / ai-code-review (push) Successful in 12s
CD Pipeline / build-and-deploy (push) Successful in 3m23s
CD Pipeline / post-deploy-checks (push) Successful in 1m51s

This commit is contained in:
Your Name
2026-05-31 17:06:26 +08:00
parent 79c34c4cf9
commit f1e4e3949e
3 changed files with 37 additions and 3 deletions

View File

@@ -276,8 +276,16 @@ export function AwoooPStatusChainPanel({
no_incident_context: t("source.verificationStatuses.noIncidentContext"),
fetch_failed: t("source.verificationStatuses.fetchFailed"),
};
const sourceReasonLabels: Record<string, string> = {
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({
</div>
))}
</div>
<div className="grid gap-px bg-[#e0ddd4] md:grid-cols-5">
<div className="grid gap-px bg-[#e0ddd4] md:grid-cols-6">
<div className="min-w-0 bg-white px-4 py-3">
<p className="text-xs font-semibold text-[#77736a]">{t("source.status")}</p>
<p className="mt-2 truncate font-mono text-sm text-[#141413]" title={sourceStatusLabels[sourceStatus] ?? sourceStatus}>
@@ -635,6 +644,15 @@ export function AwoooPStatusChainPanel({
{latestAppliedLabel}
</p>
</div>
<div className="min-w-0 bg-white px-4 py-3">
<p className="text-xs font-semibold text-[#77736a]">{t("source.reason")}</p>
<p
className="mt-2 truncate font-mono text-sm text-[#141413]"
title={sourceReasonLabels[sourceMissingReason] ?? sourceMissingReason}
>
{sourceReasonLabels[sourceMissingReason] ?? valueOrEmpty(sourceMissingReason, emptyLabel)}
</p>
</div>
<div className="min-w-0 bg-white px-4 py-3">
<p className="text-xs font-semibold text-[#77736a]">{t("source.providers")}</p>
<p className="mt-2 truncate font-mono text-sm text-[#141413]" title={sourceProviderSummary}>