diff --git a/messages/de.json b/messages/de.json index d5421a396..0bf262df8 100644 --- a/messages/de.json +++ b/messages/de.json @@ -6716,7 +6716,9 @@ "electrolytes": "Elektrolyte", "bloodCount": "Blutbild" } - } + }, + "noteLoadFailed": "Notiz konnte nicht geladen werden; sie bleibt beim Speichern unverändert.", + "showingLatestOf": "Die neuesten {shown} von {total} Messwerten werden angezeigt" }, "modules": { "cycle": { diff --git a/messages/en.json b/messages/en.json index a1495e837..080ecafa1 100644 --- a/messages/en.json +++ b/messages/en.json @@ -6716,7 +6716,9 @@ "electrolytes": "Electrolytes", "bloodCount": "Blood count" } - } + }, + "noteLoadFailed": "Note could not be loaded; it will be kept unchanged when you save.", + "showingLatestOf": "Showing the latest {shown} of {total} readings" }, "modules": { "cycle": { diff --git a/messages/es.json b/messages/es.json index 6c88b63ae..169d2f53c 100644 --- a/messages/es.json +++ b/messages/es.json @@ -6716,7 +6716,9 @@ "electrolytes": "Electrolitos", "bloodCount": "Hemograma" } - } + }, + "noteLoadFailed": "No se pudo cargar la nota; se mantendrá sin cambios al guardar.", + "showingLatestOf": "Mostrando los {shown} resultados más recientes de {total}" }, "modules": { "cycle": { diff --git a/messages/fr.json b/messages/fr.json index 079a2b06f..ec4198ed1 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -6716,7 +6716,9 @@ "electrolytes": "Électrolytes", "bloodCount": "Numération sanguine" } - } + }, + "noteLoadFailed": "La note n’a pas pu être chargée ; elle restera inchangée à l’enregistrement.", + "showingLatestOf": "Affichage des {shown} derniers résultats sur {total}" }, "modules": { "cycle": { diff --git a/messages/it.json b/messages/it.json index fcea894ef..830ab8908 100644 --- a/messages/it.json +++ b/messages/it.json @@ -6716,7 +6716,9 @@ "electrolytes": "Elettroliti", "bloodCount": "Emocromo" } - } + }, + "noteLoadFailed": "Impossibile caricare la nota; resterà invariata al salvataggio.", + "showingLatestOf": "Visualizzazione degli ultimi {shown} risultati su {total}" }, "modules": { "cycle": { diff --git a/messages/pl.json b/messages/pl.json index 1c7b3ed76..970837dd4 100644 --- a/messages/pl.json +++ b/messages/pl.json @@ -6716,7 +6716,9 @@ "electrolytes": "Elektrolity", "bloodCount": "Morfologia krwi" } - } + }, + "noteLoadFailed": "Nie udało się wczytać notatki; pozostanie niezmieniona po zapisaniu.", + "showingLatestOf": "Wyświetlanie najnowszych {shown} z {total} wyników" }, "modules": { "cycle": { diff --git a/src/components/labs/lab-list.tsx b/src/components/labs/lab-list.tsx index 0d2cf6c28..d53b69a68 100644 --- a/src/components/labs/lab-list.tsx +++ b/src/components/labs/lab-list.tsx @@ -101,6 +101,13 @@ export function LabList({ onAddFirst }: { onAddFirst?: () => void } = {}) { [data?.results], ); + // The list caps at 500 rows server-side (the `limit` ceiling). Surface a + // calm "showing latest N of M" hint when the cap truncates so the count is + // never silently wrong — proper cursor paging is a later iteration. + const total = data?.meta?.total ?? 0; + const shown = data?.results?.length ?? 0; + const truncated = total > shown; + if (isLoading) { return (
@@ -144,6 +151,11 @@ export function LabList({ onAddFirst }: { onAddFirst?: () => void } = {}) { return (
+ {truncated ? ( +

+ {t("labs.showingLatestOf", { shown, total })} +

+ ) : null} {groups.map((group) => { const body = ( <> diff --git a/src/components/labs/lab-trend-sparkline.tsx b/src/components/labs/lab-trend-sparkline.tsx index 28844fe94..af915743d 100644 --- a/src/components/labs/lab-trend-sparkline.tsx +++ b/src/components/labs/lab-trend-sparkline.tsx @@ -3,12 +3,19 @@ /** * v1.17.1 — minimal inline trend sparkline for an analyte's readings. * - * A dependency-free SVG polyline (the project defers Recharts for tiny - * inline trends; this matches the doctor-report PDF's vector-polyline - * approach). Rendered only when an analyte has ≥ 2 readings. Stroke uses - * the neutral `currentColor` so it inherits the calm muted-foreground tone - * of its row — no status colour, in keeping with the no-alarming-colour - * ethos. + * A dependency-free 72×20 SVG polyline. This is DELIBERATELY a different + * implementation from the detail page's Recharts ``: a + * list row renders one tiny, axis-less, tooltip-less, interaction-less trend + * per group (dozens on screen at once), where mounting a Recharts + * `ResponsiveContainer` each would be heavy and visually noisy. The full + * interactive chart — axes, reference band, range tabs, rich tooltip — lives + * only on the single-biomarker detail surface. The same split (inline + * polyline vs Recharts) is used by the doctor-report PDF. The two are not + * drift; do not unify them. + * + * Rendered only when an analyte has ≥ 2 readings. Stroke uses the neutral + * `currentColor` so it inherits the calm muted-foreground tone of its row — + * no status colour, in keeping with the no-alarming-colour ethos. * * `values` are passed oldest → newest. */ diff --git a/src/lib/labs/biomarker-catalog.ts b/src/lib/labs/biomarker-catalog.ts index 05647fbd6..5b579d824 100644 --- a/src/lib/labs/biomarker-catalog.ts +++ b/src/lib/labs/biomarker-catalog.ts @@ -83,5 +83,3 @@ export const BIOMARKER_PANELS = [ "electrolytes", "bloodCount", ] as const; - -export type BiomarkerPanelKey = (typeof BIOMARKER_PANELS)[number];