diff --git a/src/Web/autopilot-monitor-web/app/diagnosis/[sessionId]/page.tsx b/src/Web/autopilot-monitor-web/app/diagnosis/[sessionId]/page.tsx index 63286cb4..680ba523 100644 --- a/src/Web/autopilot-monitor-web/app/diagnosis/[sessionId]/page.tsx +++ b/src/Web/autopilot-monitor-web/app/diagnosis/[sessionId]/page.tsx @@ -794,10 +794,15 @@ export default function DiagnosisPage() { function EvidenceEventLinks({ matchedConditions, sessionId }: { matchedConditions: Record; sessionId: string }) { const eventLinks: { signal: string; eventId: string; eventType?: string }[] = []; + const seenEventIds = new Set(); for (const [signal, evidence] of Object.entries(matchedConditions)) { if (signal.startsWith("factor_")) continue; if (evidence && typeof evidence === "object" && evidence.eventId) { + // Multiple matched conditions can extract different fields from the + // same event — one chip per distinct event, not per condition. + if (seenEventIds.has(evidence.eventId)) continue; + seenEventIds.add(evidence.eventId); eventLinks.push({ signal, eventId: evidence.eventId, eventType: evidence.eventType }); } } diff --git a/src/Web/autopilot-monitor-web/app/sessions/[sessionId]/components/AnalysisResultsSection.tsx b/src/Web/autopilot-monitor-web/app/sessions/[sessionId]/components/AnalysisResultsSection.tsx index 59368963..b9b7e927 100644 --- a/src/Web/autopilot-monitor-web/app/sessions/[sessionId]/components/AnalysisResultsSection.tsx +++ b/src/Web/autopilot-monitor-web/app/sessions/[sessionId]/components/AnalysisResultsSection.tsx @@ -306,10 +306,15 @@ function scrollToEvent(eventId: string) { function EvidenceEventLinks({ matchedConditions }: { matchedConditions: Record }) { const eventLinks: { signal: string; eventId: string; eventType?: string }[] = []; + const seenEventIds = new Set(); for (const [signal, evidence] of Object.entries(matchedConditions)) { if (signal.startsWith("factor_")) continue; if (evidence && typeof evidence === "object" && evidence.eventId) { + // Multiple matched conditions can extract different fields from the + // same event — one chip per distinct event, not per condition. + if (seenEventIds.has(evidence.eventId)) continue; + seenEventIds.add(evidence.eventId); eventLinks.push({ signal, eventId: evidence.eventId, eventType: evidence.eventType }); } }