fix(labs): surface truncation hint, drop dead code, document module gate

Add a 'showing latest N of M' hint to the lab list and biomarker detail
when the 500-row cap truncates. Drop the inaccurate amend comment from the
edit history, justify the inline-SVG vs Recharts sparkline split, remove
the unused BiomarkerPanelKey export, and document the deliberate UX-only
(non-server) module gate on the labs + biomarkers routes. New labs i18n
keys added across all six locales.
This commit is contained in:
Marc-André Bombeck committed 2026-06-16 23:12:12 +02:00
1 parent 9c8c7051aa
commit fee26254b2
9 files changed
+43 -14

No files matched your search

+3 -1
View File
@@ -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": {
+3 -1
View File
@@ -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": {
+3 -1
View File
@@ -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": {
+3 -1
View File
@@ -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": {
+3 -1
View File
@@ -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": {
+3 -1
View File
@@ -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": {
+12
View File
@@ -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 (
<div className="space-y-3" data-slot="lab-list-loading">
@@ -144,6 +151,11 @@ export function LabList({ onAddFirst }: { onAddFirst?: () => void } = {}) {
return (
<div className="space-y-3">
{truncated ? (
<p className="text-muted-foreground text-xs">
{t("labs.showingLatestOf", { shown, total })}
</p>
) : null}
{groups.map((group) => {
const body = (
<>
+13 -6
View File
@@ -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 `<LabBiomarkerChart>`: 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.
*/
-2
View File
@@ -83,5 +83,3 @@ export const BIOMARKER_PANELS = [
"electrolytes",
"bloodCount",
] as const;
export type BiomarkerPanelKey = (typeof BIOMARKER_PANELS)[number];