chore(release): v1.4.29.1

Daily-step aggregation hotfix. The dashboard 7-day step chart now renders daily totals (sums in the thousands), not per-sample averages, by routing cumulative HealthKit types through the sum branch of the client-side daily aggregator.
This commit is contained in:
Marc-André Bombeck authored and GitHub committed 2026-05-16 11:29:46 +02:00
1 parent d76c0b56e7
commit 945b556664
6 files changed
+607 -2

No files matched your search

+12 -1
View File
@@ -38,6 +38,8 @@ import type {
ChartOverlayKey,
ComparisonBaseline,
} from "@/lib/dashboard-layout";
import { CUMULATIVE_HK_TYPES } from "@/lib/measurements/apple-health-mapping";
import type { MeasurementType } from "@/generated/prisma/client";
import { ChartOverlayControls } from "./chart-overlay-controls";
import { useChartOverlayPrefs } from "@/hooks/use-chart-overlay-prefs";
import { useViewportWidth } from "@/hooks/use-viewport-width";
@@ -629,7 +631,16 @@ export function HealthChart({
};
for (const [type, stats] of Object.entries(bucket.values)) {
point[type] = stats.sum / stats.count;
// v1.4.29.1 — cumulative HealthKit types (steps, active energy,
// distance, flights, daylight) must reduce with sum, not the
// per-sample average. The server already does this when the
// chart fetches with `aggregate=daily` (windows over 7 days);
// the 7-day path still pulls raw rows and aggregates here,
// so the same distinction must hold client-side.
const isCumulative = CUMULATIVE_HK_TYPES.has(
type as MeasurementType,
);
point[type] = isCumulative ? stats.sum : stats.sum / stats.count;
}
return point;