Offer the previous session of the same sport from the workout page

"How does this compare to last time?" is the most likely next question
after reading a workout, and answering it meant going back to the list and
scanning for the one before.

Resolve the previous session server-side, through the same canonical picker
the list uses, so the link can never land on a duplicate row recorded by a
second watch, and render it beside the own-history average line. Null when
nothing older exists, and then no link is shown.

The stats card's hand-rolled heading moves to the icon-less TileHeader
while the file is open.
This commit is contained in:
Marc-André Bombeck committed 2026-07-30 23:23:37 +02:00
1 parent 76b407b6de
commit a61cdae437
13 files changed
+177 -14

No files matched your search

+6
View File
@@ -199,6 +199,12 @@ const workoutDetailResponse = z
// a provider reachable. Reading this endpoint never generates one.
aiInsight: workoutActivityInsight.nullable(),
canonicalId: z.string(),
/**
* The canonical session before this one in the same sport, or null when
* this is the first on record. Resolved through the same source-priority
* picker as the list, so the id always addresses a row the list shows.
*/
previousWorkoutId: z.string().nullable(),
})
.meta({ id: "WorkoutDetailResponse" });