feat(illness): name the driving vital in the recovery-gap summary

The cross-episode summary already computes per-vital physiological returns
but the card surfaced only one bare line. Thread the dominant returning
vital through the aggregate and the DTO so the copy reads 'you tend to feel
better before your resting heart rate settles' instead of a context-free
gap figure.

The aggregate tallies which vital produced a real return across the
episodes that qualified for the typical-gap median and reports the most
frequent one (deterministic alphabetical tiebreak); the driver is named
only when a gap actually clears the magnitude gate. Zero new compute — the
returns were already in hand. Adds the localized copy in all six locales.
This commit is contained in:
Marc-André Bombeck committed 2026-06-21 14:11:20 +02:00
1 parent 36affd5daf
commit 638bc6c835
13 files changed
+152 -10

No files matched your search

@@ -87,13 +87,22 @@ export function IllnessInsightsCard({
<p className="text-muted-foreground">
{t("illness.insights.typicalGapLearning")}
</p>
) : gap.data.typicalRecoveryGapDays === null ? (
<p className="text-muted-foreground">
{t("illness.insights.typicalGapLearning")}
</p>
) : gap.data.gapDriverType ? (
<p className="text-muted-foreground">
{t("illness.insights.typicalGapWithDriver", {
days: gap.data.typicalRecoveryGapDays,
vital: t(`illness.vital.${gap.data.gapDriverType}`),
})}
</p>
) : (
<p className="text-muted-foreground">
{gap.data.typicalRecoveryGapDays !== null
? t("illness.insights.typicalGap", {
days: gap.data.typicalRecoveryGapDays,
})
: t("illness.insights.typicalGapLearning")}
{t("illness.insights.typicalGap", {
days: gap.data.typicalRecoveryGapDays,
})}
</p>
)}
</div>
+1
View File
@@ -149,4 +149,5 @@ export interface IllnessInsightsResponse {
gapSampleSize: number;
byMonth: Record<string, number>;
byType: Record<string, number>;
gapDriverType: string | null;
}