From 1c57da7d447d409f5397b3fe728594fc8e97cd81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Thu, 9 Jul 2026 00:02:56 +0200 Subject: [PATCH] fix(labs): mark un-linked lab groups and bridge biomarker detail to source reports - Lab groups not backfilled to a catalog biomarker now carry a muted 'not linked to a biomarker yet' affordance in both list and card views, so an inert row no longer reads as a broken link next to clickable neighbours. - The biomarker detail page links to the document vault filtered to lab-result reports (gated on the documents module), giving a path from a value to its source scans. A per-value document relation remains a data-model follow-up. --- messages/de.json | 3 ++- messages/en.json | 3 ++- messages/es.json | 3 ++- messages/fr.json | 3 ++- messages/it.json | 3 ++- messages/pl.json | 3 ++- src/components/labs/lab-biomarker-detail.tsx | 27 +++++++++++++++++++- src/components/labs/lab-list.tsx | 14 ++++++++++ 8 files changed, 52 insertions(+), 7 deletions(-) diff --git a/messages/de.json b/messages/de.json index 73959128c..4c767c5de 100644 --- a/messages/de.json +++ b/messages/de.json @@ -7383,7 +7383,8 @@ "pdfNeedsAnthropic": "PDF-Scannen benötigt einen Claude-Bildanbieter; lade stattdessen ein Foto hoch." }, "loadMoreReadings": "Weitere Werte laden", - "documentsLink": "Befund-Dokumente" + "documentsLink": "Befund-Dokumente", + "notLinkedYet": "Noch keinem Biomarker zugeordnet" }, "modules": { "cycle": { diff --git a/messages/en.json b/messages/en.json index e620e98bb..8a09e86fb 100644 --- a/messages/en.json +++ b/messages/en.json @@ -7383,7 +7383,8 @@ "pdfNeedsAnthropic": "PDF scanning needs a Claude vision provider; upload a photo instead." }, "loadMoreReadings": "Load more readings", - "documentsLink": "Lab report documents" + "documentsLink": "Lab report documents", + "notLinkedYet": "Not linked to a biomarker yet" }, "modules": { "cycle": { diff --git a/messages/es.json b/messages/es.json index 4c4e978ac..b3dece638 100644 --- a/messages/es.json +++ b/messages/es.json @@ -7383,7 +7383,8 @@ "pdfNeedsAnthropic": "El escaneo de PDF necesita un proveedor de visión de Claude; sube una foto en su lugar." }, "loadMoreReadings": "Cargar más mediciones", - "documentsLink": "Documentos de resultados" + "documentsLink": "Documentos de resultados", + "notLinkedYet": "Aún no vinculado a un biomarcador" }, "modules": { "cycle": { diff --git a/messages/fr.json b/messages/fr.json index ec0d5ccb3..6586a1793 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -7383,7 +7383,8 @@ "pdfNeedsAnthropic": "Le scan PDF nécessite un fournisseur de vision Claude ; importez plutôt une photo." }, "loadMoreReadings": "Charger plus de mesures", - "documentsLink": "Documents de résultats" + "documentsLink": "Documents de résultats", + "notLinkedYet": "Pas encore lié à un biomarqueur" }, "modules": { "cycle": { diff --git a/messages/it.json b/messages/it.json index 34a14bc39..dd1115ba9 100644 --- a/messages/it.json +++ b/messages/it.json @@ -7383,7 +7383,8 @@ "pdfNeedsAnthropic": "La scansione PDF richiede un provider di visione Claude; carica invece una foto." }, "loadMoreReadings": "Carica altre misurazioni", - "documentsLink": "Documenti dei referti" + "documentsLink": "Documenti dei referti", + "notLinkedYet": "Non ancora collegato a un biomarcatore" }, "modules": { "cycle": { diff --git a/messages/pl.json b/messages/pl.json index 8830afebe..d4f9695e9 100644 --- a/messages/pl.json +++ b/messages/pl.json @@ -7383,7 +7383,8 @@ "pdfNeedsAnthropic": "Skanowanie PDF wymaga dostawcy wizji Claude; prześlij zamiast tego zdjęcie." }, "loadMoreReadings": "Wczytaj więcej pomiarów", - "documentsLink": "Dokumenty wyników badań" + "documentsLink": "Dokumenty wyników badań", + "notLinkedYet": "Jeszcze niepowiązane z biomarkerem" }, "modules": { "cycle": { diff --git a/src/components/labs/lab-biomarker-detail.tsx b/src/components/labs/lab-biomarker-detail.tsx index 9c8df503a..cddfed4e1 100644 --- a/src/components/labs/lab-biomarker-detail.tsx +++ b/src/components/labs/lab-biomarker-detail.tsx @@ -9,9 +9,17 @@ import { useQuery, useQueryClient, } from "@tanstack/react-query"; -import { FlaskConical, ListOrdered, Pencil, Plus } from "lucide-react"; +import { + ArrowRight, + FlaskConical, + FolderOpen, + ListOrdered, + Pencil, + Plus, +} from "lucide-react"; import { toast } from "sonner"; +import { useAuth } from "@/hooks/use-auth"; import { DeleteButton } from "@/components/data-list"; import { Button } from "@/components/ui/button"; import { Card, CardContent } from "@/components/ui/card"; @@ -84,6 +92,7 @@ const READINGS_PAGE_SIZE = 200; * it. Mirrors the measurement-detail layout. */ export function LabBiomarkerDetail({ biomarkerId }: { biomarkerId: string }) { + const { user } = useAuth(); const { t } = useTranslations(); const router = useRouter(); const queryClient = useQueryClient(); @@ -367,6 +376,22 @@ export function LabBiomarkerDetail({ biomarkerId }: { biomarkerId: string }) { catalog-less marker still carries a description. */}

{description}

+ {/* Bridge to the source report PDFs. There is no per-value document + relation in the data model yet, so this links to the vault filtered + to lab-result documents rather than the exact scan behind one value. + Only when the documents module is enabled. */} + {user?.modules?.inboundDocuments ? ( + +