From ec6c5d05e6d9f08e6cf6420c8913defaad7278f4 Mon Sep 17 00:00:00 2001 From: lorentz Date: Fri, 17 Jul 2026 22:24:02 -0400 Subject: [PATCH] fix: convert 0-1 scale confidence to percent in timeline-card (same bug as classification-card, missed in 260716-pgr) --- components/phishing/timeline-card.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/phishing/timeline-card.tsx b/components/phishing/timeline-card.tsx index 3c23897..06d106a 100644 --- a/components/phishing/timeline-card.tsx +++ b/components/phishing/timeline-card.tsx @@ -51,7 +51,8 @@ function renderEntry(entry: TimelineEntry): { } if (entry.kind === 'classification') { - const confidence = entry.confidence != null ? ` (${entry.confidence}%)` : ''; + const confidencePct = entry.confidence != null ? Number(entry.confidence) : NaN; + const confidence = Number.isFinite(confidencePct) ? ` (${Math.round(confidencePct * 100)}%)` : ''; // Defensive fallback: phishing-timeline.ts emits verdict as a plain // unvalidated runtime `string`, so a value outside this component's // narrowed union must never crash the render (T-23-12).