Show whole-number metrics as whole numbers

The dashboard tiles printed every value at one decimal: '121,0 mmHg',
'60,0 bpm', '9.240,0' steps. TrendCard takes the metric's precision, and
blood pressure, pulse, HRV, steps and mg/dL glucose pass zero. The
measurement list names count-shaped units the way the insights pages do
('13 Etagen', '12,5 Atemzüge/min') instead of the source's 'count'.
This commit is contained in:
Marc-André Bombeck committed 2026-10-08 16:21:12 +02:00
1 parent b80dc14142
commit 554f36aeab
6 files changed
+108 -7

No files matched your search

+11 -1
View File
@@ -28,7 +28,11 @@ import {
TrendingUp,
Wind,
} from "lucide-react";
import { convertGlucose, resolveGlucoseUnit } from "@/lib/glucose";
import {
convertGlucose,
glucoseFractionDigits,
resolveGlucoseUnit,
} from "@/lib/glucose";
import { cn } from "@/lib/utils";
import {
resolveDashboardLayout,
@@ -1039,6 +1043,7 @@ export default function DashboardPageClient({
node: (
<TrendCard
key="bp-sys"
fractionDigits={0}
label={t("dashboard.bloodPressureSysShort")}
latest={sys?.latest ?? null}
unit="mmHg"
@@ -1080,6 +1085,7 @@ export default function DashboardPageClient({
node: (
<TrendCard
key="bp-dia"
fractionDigits={0}
label={t("dashboard.bloodPressureDiaShort")}
latest={dia?.latest ?? null}
unit="mmHg"
@@ -1121,6 +1127,7 @@ export default function DashboardPageClient({
node: (
<TrendCard
key="pulse"
fractionDigits={0}
label={t("dashboard.pulseShort")}
latest={pulseTileSummary?.latest ?? null}
unit="bpm"
@@ -1243,6 +1250,7 @@ export default function DashboardPageClient({
node: (
<TrendCard
key="steps"
fractionDigits={0}
label={t("dashboard.stepsShort") ?? "Steps"}
latest={stepsSummary?.latest ?? null}
unit=""
@@ -1303,6 +1311,7 @@ export default function DashboardPageClient({
node: (
<TrendCard
key="hrv"
fractionDigits={0}
// Name the measure when the RMSSD series is the one on show.
// Without it a ring / strap reading (typically 20-60 ms) sits
// under the same label as an SDNN one and reads as a collapse
@@ -1631,6 +1640,7 @@ export default function DashboardPageClient({
: null
}
unit={displayGlucoseUnit}
fractionDigits={glucoseFractionDigits(displayGlucoseUnit)}
avg7={
s.avg7 != null
? convertGlucose(s.avg7, displayGlucoseUnit)