fix: convert 0-1 scale confidence to percent in timeline-card (same bug as classification-card, missed in 260716-pgr)

This commit is contained in:
lorentz 2026-07-17 22:24:02 -04:00
parent 952b63c8a4
commit ec6c5d05e6

View file

@ -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).