From 7c0a97520a24f4f11c93f42a2935292743a8db4c Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Tue, 21 Oct 2025 16:03:08 -0600 Subject: [PATCH] Clean up decision logic --- web/src/components/card/ClassificationCard.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/web/src/components/card/ClassificationCard.tsx b/web/src/components/card/ClassificationCard.tsx index 7ef889176..ef45b844f 100644 --- a/web/src/components/card/ClassificationCard.tsx +++ b/web/src/components/card/ClassificationCard.tsx @@ -197,18 +197,24 @@ export function GroupedClassificationCard({ let best: undefined | ClassificationItemData = undefined; group.forEach((item) => { - if (best?.score == undefined || (item.score && best.score < item.score)) { - best = item; + if (item?.name != undefined && item.name != "none") { + if ( + best?.score == undefined || + (item.score && best.score < item.score) + ) { + best = item; + } } }); if (!best) { - return undefined; + return group[0]; } const bestTyped: ClassificationItemData = best; return { ...bestTyped, + name: event?.sub_label || bestTyped.name, score: event?.data?.sub_label_score || bestTyped.score, }; }, [group, event]);