Render the day around a workout instead of linking away from it

The "That day" card took the workout, dropped it, and offered three chips
to Pulse, Sleep and Mood. None of those pages accepts a date, so every chip
landed on an all-time trend surface with the day nowhere in sight.

Replace it with the day itself: the intraday pulse chart pinned to the
session's day, the night the person woke from into it, and that day's mood
entries. All three reads are addressed by the server-resolved dayKey, so
nothing here decides which day a workout belongs to.

The two outbound links that remain are undated and say what they lead to,
Sleep trends and Mood history. Sleep and the intraday chart mount only when
their module is on, so a switched-off module cannot paint as a failed read,
and a query that has not answered yet shows a skeleton rather than claiming
the night was empty.

The detail page also drops the description it borrowed from the list.
This commit is contained in:
Marc-André Bombeck committed 2026-07-30 23:23:36 +02:00
1 parent 0094445f07
commit 76b407b6de
15 files changed
+492 -111

No files matched your search

+11 -4
View File
@@ -21,7 +21,7 @@ import {
WorkoutDetailZones,
WorkoutDetailRoute,
WorkoutDetailSplits,
WorkoutDetailDayLinks,
WorkoutDetailDayContext,
WorkoutInsightCard,
} from "@/components/insights/workout-detail";
@@ -31,7 +31,12 @@ import {
* Layout, top to bottom (mobile-first single column):
* hero header → reserved Activity-Insight seam (renders nothing today)
* → stats grid + sport-average line → HR curve → effort zones → GPS
* route → per-km splits → "that day" cross-links → coach launch.
* route → per-km splits → "that day" → coach launch.
*
* "That day" answers the last question the page is for: what the rest of
* the day looked like around the session. It renders the day's own pulse
* shape, that night's sleep and the day's mood inline, all addressed by
* the server-resolved `dayKey`.
*
* Every data-less section returns `null` (hide, don't render empty), so
* an aggregates-only workout (a Strava ride with no wearable, a manual
@@ -70,7 +75,9 @@ export default function InsightsWorkoutDetailPage({
return (
<SubPageShell
title={t("insights.workouts.title")}
description={t("insights.workouts.description")}
// No description. The one this page used to carry belongs to the LIST
// ("Recent runs, rides, walks…, deduped…") and describes a surface
// this is not — a detail page must not claim to be the list.
backLink={
<BackLink
href="/insights/workouts"
@@ -112,7 +119,7 @@ export default function InsightsWorkoutDetailPage({
<WorkoutDetailZones workout={data} />
<WorkoutDetailRoute workout={data} />
<WorkoutDetailSplits workout={data} />
<WorkoutDetailDayLinks workout={data} />
<WorkoutDetailDayContext workout={data} />
{/* 2026-07-17 UX-flows audit F6-1 — `workouts` narrows the
snapshot the first coach turn reads. v1.31.0 — `workoutId` pins
THIS session's own numbers as one additional snapshot section, so