mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 04:50:59 +00:00
chore(v1.22.1): tidy labs subtitle scale and drop dead sleep keys
Standardise the labs marker subtitle to text-xs across both the compact list and the card grid, and build the localized name->slug lookup map once per locale instead of re-scanning the catalog seeds per group on every render. Add relative to the mobile section strips in the settings and admin shells so the active chip's offsetLeft is measured from the strip, giving an exact horizontal scroll target. Drop the orphaned insights.sleep.headlineCaption and headlineCaptionSuffix keys from all six locales; nothing references them after the sleep headline removal.
This commit is contained in:
1 parent
6e2bf34487
commit
6ec0ee0215
9 files changed
+17
-17
No files matched your search
@@ -2617,8 +2617,6 @@
|
||||
"title": "Schlaf",
|
||||
"description": "Phasen-Aufschlüsselung und nächtliche Dauer – gezogen aus Apple Health.",
|
||||
"headlineTitle": "Durchschnitt pro Nacht",
|
||||
"headlineCaption": "Gemittelt über {count} Nächte – {suffix}",
|
||||
"headlineCaptionSuffix": "pro Nacht",
|
||||
"compositionTitle": "Phasen-Verteilung",
|
||||
"compositionSubtitle": "Letzte {nights} Nächte",
|
||||
"compositionAriaLabel": "Schlafphasen-Verteilung über {nights} Nächte",
|
||||
|
||||
@@ -2617,8 +2617,6 @@
|
||||
"title": "Sleep",
|
||||
"description": "Stage breakdown and nightly duration, drawn from Apple Health.",
|
||||
"headlineTitle": "Average per night",
|
||||
"headlineCaption": "Averaged across {count} nights — {suffix}",
|
||||
"headlineCaptionSuffix": "per night",
|
||||
"compositionTitle": "Stage composition",
|
||||
"compositionSubtitle": "Last {nights} nights",
|
||||
"compositionAriaLabel": "Sleep stage composition over {nights} nights",
|
||||
|
||||
@@ -2617,8 +2617,6 @@
|
||||
"title": "Sueño",
|
||||
"description": "Desglose por fases y duración nocturna, tomados de Apple Health.",
|
||||
"headlineTitle": "Media por noche",
|
||||
"headlineCaption": "Promediado sobre {count} noches — {suffix}",
|
||||
"headlineCaptionSuffix": "por noche",
|
||||
"compositionTitle": "Distribución de fases",
|
||||
"compositionSubtitle": "Últimas {nights} noches",
|
||||
"compositionAriaLabel": "Distribución de fases del sueño en {nights} noches",
|
||||
|
||||
@@ -2617,8 +2617,6 @@
|
||||
"title": "Sommeil",
|
||||
"description": "Répartition des phases et durée nocturne, issues d’Apple Health.",
|
||||
"headlineTitle": "Moyenne par nuit",
|
||||
"headlineCaption": "Moyenne sur {count} nuits — {suffix}",
|
||||
"headlineCaptionSuffix": "par nuit",
|
||||
"compositionTitle": "Répartition des phases",
|
||||
"compositionSubtitle": "{nights} dernières nuits",
|
||||
"compositionAriaLabel": "Répartition des phases de sommeil sur {nights} nuits",
|
||||
|
||||
@@ -2617,8 +2617,6 @@
|
||||
"title": "Sonno",
|
||||
"description": "Suddivisione per fasi e durata notturna, da Apple Health.",
|
||||
"headlineTitle": "Media per notte",
|
||||
"headlineCaption": "Mediato su {count} notti — {suffix}",
|
||||
"headlineCaptionSuffix": "per notte",
|
||||
"compositionTitle": "Distribuzione delle fasi",
|
||||
"compositionSubtitle": "Ultime {nights} notti",
|
||||
"compositionAriaLabel": "Distribuzione delle fasi del sonno su {nights} notti",
|
||||
|
||||
@@ -2617,8 +2617,6 @@
|
||||
"title": "Sen",
|
||||
"description": "Podział na fazy i nocna długość snu, dane z Apple Health.",
|
||||
"headlineTitle": "Średnia na noc",
|
||||
"headlineCaption": "Uśrednione z {count} nocy — {suffix}",
|
||||
"headlineCaptionSuffix": "na noc",
|
||||
"compositionTitle": "Rozkład faz",
|
||||
"compositionSubtitle": "Ostatnie {nights} nocy",
|
||||
"compositionAriaLabel": "Rozkład faz snu w {nights} nocach",
|
||||
|
||||
@@ -251,7 +251,7 @@ export function AdminShell({ active, children }: AdminShellProps) {
|
||||
<nav
|
||||
ref={mobileStripRef}
|
||||
aria-label={t("admin.shell.sectionsNav")}
|
||||
className="no-scrollbar -mx-4 mb-4 snap-x snap-mandatory overflow-x-auto px-4 md:hidden"
|
||||
className="no-scrollbar relative -mx-4 mb-4 snap-x snap-mandatory overflow-x-auto px-4 md:hidden"
|
||||
>
|
||||
<ul className="flex min-w-max gap-2">
|
||||
<li className="snap-start">
|
||||
|
||||
@@ -11,7 +11,7 @@ import { Card, CardContent } from "@/components/ui/card";
|
||||
import { EmptyState } from "@/components/ui/empty-state";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import { apiGet } from "@/lib/api/api-fetch";
|
||||
import { resolveCatalogSlug } from "@/lib/labs/biomarker-catalog";
|
||||
import { BIOMARKER_CATALOG } from "@/lib/labs/biomarker-catalog";
|
||||
import { formatDate } from "@/lib/format";
|
||||
import { formatReferenceRange } from "@/lib/labs/reference-range";
|
||||
import { formatLabReading, formatLabValue } from "@/lib/labs/format-value";
|
||||
@@ -81,8 +81,20 @@ export function LabList({ onAddFirst }: { onAddFirst?: () => void } = {}) {
|
||||
// v1.22 — a short, factual line under each marker heading describing what the
|
||||
// biomarker measures, sourced from the catalog via i18n. Free-text markers
|
||||
// (no catalog match) carry no subtitle rather than a fabricated one.
|
||||
// v1.22.1 — build the localized name→slug map once per locale instead of
|
||||
// re-scanning all catalog seeds (calling `t()` each) per group every render.
|
||||
const slugByName = useMemo(() => {
|
||||
const map = new Map<string, string>();
|
||||
for (const seed of BIOMARKER_CATALOG) {
|
||||
const norm = t(`labs.catalog.${seed.slug}`).trim().toLowerCase();
|
||||
if (norm) map.set(norm, seed.slug);
|
||||
}
|
||||
return map;
|
||||
}, [t]);
|
||||
const describeMarker = (analyte: string): string | null => {
|
||||
const slug = resolveCatalogSlug(analyte, (s) => t(`labs.catalog.${s}`));
|
||||
const norm = analyte.trim().toLowerCase();
|
||||
if (!norm) return null;
|
||||
const slug = slugByName.get(norm);
|
||||
return slug ? t(`labs.catalog.desc.${slug}`) : null;
|
||||
};
|
||||
|
||||
@@ -287,7 +299,7 @@ export function LabList({ onAddFirst }: { onAddFirst?: () => void } = {}) {
|
||||
/>
|
||||
<CardContent>
|
||||
{description ? (
|
||||
<p className="text-muted-foreground mb-2 text-sm">
|
||||
<p className="text-muted-foreground mb-2 text-xs">
|
||||
{description}
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
@@ -450,7 +450,7 @@ export function SettingsShell({
|
||||
<nav
|
||||
ref={mobileStripRef}
|
||||
aria-label={t("settings.shell.sectionsNav")}
|
||||
className="no-scrollbar -mx-4 mb-4 snap-x snap-mandatory overflow-x-auto px-4 md:hidden"
|
||||
className="no-scrollbar relative -mx-4 mb-4 snap-x snap-mandatory overflow-x-auto px-4 md:hidden"
|
||||
>
|
||||
<ul className="flex min-w-max gap-2">
|
||||
{visibleSections.map((section) => {
|
||||
|
||||
Reference in new issue
Block a user