fix(workouts): read the stored route sample shape for splits and the GPX export

Both ingests store each route point's sample as { t, speedMs?, hr? }, while
computeSplits parsed every sample as a bare instant and the GPX export
skipped anything that was not a string. Splits were therefore null for
every ingested track, and an exported track carried no times. One reader,
routeSampleInstant, takes either shape. The workout detail walk is
re-pinned: its ingested run now answers its first kilometre split.
This commit is contained in:
Marc-André Bombeck committed 2026-10-23 16:37:58 +02:00
1 parent 06d55afc46
commit 976b2ba0bc
9 files changed
+70 -9

No files matched your search

+2 -1
View File
@@ -7,6 +7,7 @@ import { useInfiniteQuery, useQuery } from "@tanstack/react-query";
import { useAuth } from "@/hooks/use-auth";
import { queryKeys } from "@/lib/query-keys";
import { apiGet } from "@/lib/api/api-fetch";
import type { RouteSample } from "@/lib/workouts/route-samples";
/**
* v1.4.32 — TanStack Query wrapper for `GET /api/workouts`.
@@ -325,7 +326,7 @@ export interface WorkoutDetailPayload extends WorkoutListEntry {
metadata: unknown;
route: {
geometry: unknown;
sampleTimestamps: string[] | null;
sampleTimestamps: RouteSample[] | null;
} | null;
/**
* Raw per-workout HR sample envelope. `samples.samples` is dropped