feat(labs): surface low-confidence OCR rows in review

The extraction already self-scores each field; the review screen only
hinted at a shaky numeric value. Add a calm per-row low-confidence badge
when any tracked field scores below the threshold, including qualitative
rows that had no confidence cue. Informative secondary badge, no alarm
colour.
This commit is contained in:
Marc-André Bombeck committed 2026-06-26 09:26:59 +02:00
1 parent 561a0694cf
commit 1c93a670f0
7 files changed
+23

No files matched your search

+1
View File
@@ -6725,6 +6725,7 @@
"linksExisting": "Verknüpft mit vorhandenem {name}",
"duplicateWarning": "Ein passender Wert existiert bereits",
"lowConfidence": "Bitte diesen Wert überprüfen",
"lowConfidenceBadge": "Geringe Sicherheit",
"valueUnreadable": "Wert unleserlich — bitte manuell eingeben",
"saveSelected": "{count} ausgewählte speichern",
"discardAll": "Alle verwerfen",
+1
View File
@@ -6725,6 +6725,7 @@
"linksExisting": "Links to existing {name}",
"duplicateWarning": "A matching reading already exists",
"lowConfidence": "Please double-check this value",
"lowConfidenceBadge": "Low confidence",
"valueUnreadable": "Value unreadable — enter it manually",
"saveSelected": "Save {count} selected",
"discardAll": "Discard all",
+1
View File
@@ -6725,6 +6725,7 @@
"linksExisting": "Se vincula a {name} existente",
"duplicateWarning": "Ya existe un valor coincidente",
"lowConfidence": "Verifica este valor",
"lowConfidenceBadge": "Confianza baja",
"valueUnreadable": "Valor ilegible — introdúcelo manualmente",
"saveSelected": "Guardar {count} seleccionados",
"discardAll": "Descartar todo",
+1
View File
@@ -6725,6 +6725,7 @@
"linksExisting": "Lié au {name} existant",
"duplicateWarning": "Une valeur correspondante existe déjà",
"lowConfidence": "Veuillez vérifier cette valeur",
"lowConfidenceBadge": "Confiance faible",
"valueUnreadable": "Valeur illisible — saisissez-la manuellement",
"saveSelected": "Enregistrer {count} sélectionnées",
"discardAll": "Tout abandonner",
+1
View File
@@ -6725,6 +6725,7 @@
"linksExisting": "Collegato a {name} esistente",
"duplicateWarning": "Esiste già un valore corrispondente",
"lowConfidence": "Controlla questo valore",
"lowConfidenceBadge": "Bassa attendibilità",
"valueUnreadable": "Valore illeggibile — inseriscilo manualmente",
"saveSelected": "Salva {count} selezionati",
"discardAll": "Scarta tutto",
+1
View File
@@ -6725,6 +6725,7 @@
"linksExisting": "Łączy z istniejącym {name}",
"duplicateWarning": "Pasujący wynik już istnieje",
"lowConfidence": "Sprawdź tę wartość",
"lowConfidenceBadge": "Niska pewność",
"valueUnreadable": "Wartość nieczytelna — wprowadź ją ręcznie",
"saveSelected": "Zapisz {count} wybranych",
"discardAll": "Odrzuć wszystko",
+17
View File
@@ -49,6 +49,17 @@ export function OcrRowEditor({
!isQualitative && row.confidence.value < CONFIDENCE_THRESHOLD;
const valueUnreadable = !isQualitative && row.value === null;
// The model self-scores each field it transcribed. Surface a single calm
// per-row flag when ANY tracked field came back below the threshold so a
// shaky read is visible at a glance — including on qualitative rows, which
// have no value-confidence footnote of their own. Informative, not alarming.
const lowRowConfidence =
row.confidence.analyte < CONFIDENCE_THRESHOLD ||
row.confidence.unit < CONFIDENCE_THRESHOLD ||
(isQualitative
? row.confidence.value < CONFIDENCE_THRESHOLD
: lowValueConfidence);
// v1.18.10 (#5) — a NEW numeric biomarker mints its catalog reference range
// from THIS extracted row. The range is therefore load-bearing and worth a
// second look. Surface the range confidence prominently for new numeric
@@ -106,6 +117,12 @@ export function OcrRowEditor({
{t("labs.ocr.duplicateWarning")}
</Badge>
) : null}
{lowRowConfidence ? (
<Badge variant="secondary" className="text-muted-foreground">
<AlertCircle aria-hidden />
{t("labs.ocr.lowConfidenceBadge")}
</Badge>
) : null}
</div>
</div>
</div>