From 58a8ea5ef8af26d7a246430d98e2698527b6171d Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Mon, 3 Nov 2025 15:58:08 -0700 Subject: [PATCH] Adjust no class wording --- web/src/components/card/ClassificationCard.tsx | 12 +++++++++--- web/src/pages/FaceLibrary.tsx | 1 + web/src/views/classification/ModelTrainingView.tsx | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/web/src/components/card/ClassificationCard.tsx b/web/src/components/card/ClassificationCard.tsx index 21f498fe4..46b850456 100644 --- a/web/src/components/card/ClassificationCard.tsx +++ b/web/src/components/card/ClassificationCard.tsx @@ -181,6 +181,7 @@ type GroupedClassificationCardProps = { selectedItems: string[]; i18nLibrary: string; objectType: string; + noClassificationLabel?: string; onClick: (data: ClassificationItemData | undefined) => void; children?: (data: ClassificationItemData) => React.ReactNode; }; @@ -190,6 +191,7 @@ export function GroupedClassificationCard({ threshold, selectedItems, i18nLibrary, + noClassificationLabel = "details.none", onClick, children, }: GroupedClassificationCardProps) { @@ -222,10 +224,12 @@ export function GroupedClassificationCard({ const bestTyped: ClassificationItemData = best; return { ...bestTyped, - name: event ? (event.sub_label ?? t("details.unknown")) : bestTyped.name, + name: event + ? (event.sub_label ?? t(noClassificationLabel)) + : bestTyped.name, score: event?.data?.sub_label_score || bestTyped.score, }; - }, [group, event, t]); + }, [group, event, noClassificationLabel, t]); const bestScoreStatus = useMemo(() => { if (!bestItem?.score || !threshold) { @@ -311,7 +315,9 @@ export function GroupedClassificationCard({ isMobile && "px-2", )} > - {event?.sub_label ? event.sub_label : t("details.unknown")} + {event?.sub_label + ? event.sub_label + : t(noClassificationLabel)} {event?.sub_label && (
{ if (data) { onClickFaces([data.filename], true); diff --git a/web/src/views/classification/ModelTrainingView.tsx b/web/src/views/classification/ModelTrainingView.tsx index 5d60ce56c..92a4adcdf 100644 --- a/web/src/views/classification/ModelTrainingView.tsx +++ b/web/src/views/classification/ModelTrainingView.tsx @@ -961,6 +961,7 @@ function ObjectTrainGrid({ selectedItems={selectedImages} i18nLibrary="views/classificationModel" objectType={model.object_config?.objects?.at(0) ?? "Object"} + noClassificationLabel="details.none" onClick={(data) => { if (data) { onClickImages([data.filename], true);