mirror of
https://github.com/okieselbach/AutopilotMonitor.git
synced 2026-10-24 12:42:38 +00:00
fix(web): dedupe rule-result evidence chips by eventId
Multiple matched conditions often extract different fields from the same event (e.g. enrollment_failed + enrollment_failed_reason), which rendered duplicate identically-labeled chips all jumping to the same timeline event. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -794,10 +794,15 @@ export default function DiagnosisPage() {
|
||||
|
||||
function EvidenceEventLinks({ matchedConditions, sessionId }: { matchedConditions: Record<string, any>; sessionId: string }) {
|
||||
const eventLinks: { signal: string; eventId: string; eventType?: string }[] = [];
|
||||
const seenEventIds = new Set<string>();
|
||||
|
||||
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 });
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -306,10 +306,15 @@ function scrollToEvent(eventId: string) {
|
||||
|
||||
function EvidenceEventLinks({ matchedConditions }: { matchedConditions: Record<string, any> }) {
|
||||
const eventLinks: { signal: string; eventId: string; eventType?: string }[] = [];
|
||||
const seenEventIds = new Set<string>();
|
||||
|
||||
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 });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user