mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 04:32:42 +00:00
feat(illness): name the symptom curve in the recovery-gap card
When the logged symptom curve drives the recovery gap, the card names it
('you felt better N days before your logged symptoms eased') instead of
the vital-driven phrasing. Mirror the new gapDriverType and the return
track's adverse flag into the client DTO, and add the driver-aware copy
across all six locales.
This commit is contained in:
1 parent
fc76c39aea
commit
1352ba2aa6
8 files changed
+36
-4
No files matched your search
@@ -6866,6 +6866,8 @@
|
||||
"recoveryGapTitle": "Erholungslücke",
|
||||
"recoveryGapLag": "Deine Werte normalisierten sich {days} Tage, nachdem es dir besser ging.",
|
||||
"recoveryGapLead": "Deine Werte normalisierten sich {days} Tage, bevor du Genesung vermerktest.",
|
||||
"recoveryGapLagSymptom": "Dir ging es {days} Tage besser, bevor deine erfassten Symptome abklangen.",
|
||||
"recoveryGapLeadSymptom": "Deine erfassten Symptome klangen {days} Tage ab, bevor du Genesung vermerktest.",
|
||||
"recoveryGapSame": "Deine Werte normalisierten sich am selben Tag, an dem es dir besser ging.",
|
||||
"redFlagTitle": "Genauer ansehen",
|
||||
"redFlagSpo2": "Deine Sauerstoffsättigung blieb mehrere Tage niedrig. Wenn das erneut auftritt, suche ärztliche Hilfe.",
|
||||
|
||||
@@ -6866,6 +6866,8 @@
|
||||
"recoveryGapTitle": "Recovery gap",
|
||||
"recoveryGapLag": "Your numbers settled {days} days after you felt better.",
|
||||
"recoveryGapLead": "Your numbers settled {days} days before you marked recovery.",
|
||||
"recoveryGapLagSymptom": "You felt better {days} days before your logged symptoms eased.",
|
||||
"recoveryGapLeadSymptom": "Your logged symptoms eased {days} days before you marked recovery.",
|
||||
"recoveryGapSame": "Your numbers settled the same day you felt better.",
|
||||
"redFlagTitle": "Worth a closer look",
|
||||
"redFlagSpo2": "Your oxygen saturation stayed low for several days. If this recurs, seek medical care.",
|
||||
|
||||
@@ -6866,6 +6866,8 @@
|
||||
"recoveryGapTitle": "Brecha de recuperación",
|
||||
"recoveryGapLag": "Tus valores se estabilizaron {days} días después de sentirte mejor.",
|
||||
"recoveryGapLead": "Tus valores se estabilizaron {days} días antes de marcar la recuperación.",
|
||||
"recoveryGapLagSymptom": "Te sentiste mejor {days} días antes de que cedieran tus síntomas registrados.",
|
||||
"recoveryGapLeadSymptom": "Tus síntomas registrados cedieron {days} días antes de marcar la recuperación.",
|
||||
"recoveryGapSame": "Tus valores se estabilizaron el mismo día en que te sentiste mejor.",
|
||||
"redFlagTitle": "Conviene revisarlo",
|
||||
"redFlagSpo2": "Tu saturación de oxígeno se mantuvo baja varios días. Si se repite, busca atención médica.",
|
||||
|
||||
@@ -6866,6 +6866,8 @@
|
||||
"recoveryGapTitle": "Écart de récupération",
|
||||
"recoveryGapLag": "Tes valeurs se sont stabilisées {days} jours après que tu te sois senti mieux.",
|
||||
"recoveryGapLead": "Tes valeurs se sont stabilisées {days} jours avant que tu notes la guérison.",
|
||||
"recoveryGapLagSymptom": "Tu t'es senti mieux {days} jours avant que tes symptômes consignés s'apaisent.",
|
||||
"recoveryGapLeadSymptom": "Tes symptômes consignés se sont apaisés {days} jours avant que tu notes la guérison.",
|
||||
"recoveryGapSame": "Tes valeurs se sont stabilisées le jour même où tu t'es senti mieux.",
|
||||
"redFlagTitle": "À examiner de plus près",
|
||||
"redFlagSpo2": "Ta saturation en oxygène est restée basse plusieurs jours. Si cela se reproduit, consulte un médecin.",
|
||||
|
||||
@@ -6866,6 +6866,8 @@
|
||||
"recoveryGapTitle": "Divario di recupero",
|
||||
"recoveryGapLag": "I tuoi valori si sono stabilizzati {days} giorni dopo esserti sentito meglio.",
|
||||
"recoveryGapLead": "I tuoi valori si sono stabilizzati {days} giorni prima di segnare la guarigione.",
|
||||
"recoveryGapLagSymptom": "Ti sei sentito meglio {days} giorni prima che i sintomi registrati si attenuassero.",
|
||||
"recoveryGapLeadSymptom": "I tuoi sintomi registrati si sono attenuati {days} giorni prima di segnare la guarigione.",
|
||||
"recoveryGapSame": "I tuoi valori si sono stabilizzati lo stesso giorno in cui ti sei sentito meglio.",
|
||||
"redFlagTitle": "Da guardare più da vicino",
|
||||
"redFlagSpo2": "La tua saturazione di ossigeno è rimasta bassa per diversi giorni. Se si ripete, rivolgiti a un medico.",
|
||||
|
||||
@@ -6866,6 +6866,8 @@
|
||||
"recoveryGapTitle": "Luka rekonwalescencji",
|
||||
"recoveryGapLag": "Twoje wartości ustabilizowały się {days} dni po tym, jak poczułeś się lepiej.",
|
||||
"recoveryGapLead": "Twoje wartości ustabilizowały się {days} dni przed oznaczeniem wyzdrowienia.",
|
||||
"recoveryGapLagSymptom": "Poczułeś się lepiej {days} dni przed ustąpieniem zapisanych objawów.",
|
||||
"recoveryGapLeadSymptom": "Twoje zapisane objawy ustąpiły {days} dni przed oznaczeniem wyzdrowienia.",
|
||||
"recoveryGapSame": "Twoje wartości ustabilizowały się tego samego dnia, gdy poczułeś się lepiej.",
|
||||
"redFlagTitle": "Warto przyjrzeć się bliżej",
|
||||
"redFlagSpo2": "Twoje wysycenie tlenem pozostawało niskie przez kilka dni. Jeśli się powtórzy, zasięgnij pomocy medycznej.",
|
||||
|
||||
@@ -44,6 +44,10 @@ function DeviationRow({ d }: { d: IllnessVitalDeviation }) {
|
||||
function CorrelationBody({ value }: { value: IllnessCorrelationValue }) {
|
||||
const { t } = useTranslations();
|
||||
const gap = value.recoveryGapDays;
|
||||
// Driver-aware copy: when the user's logged symptom curve drove the gap, name
|
||||
// the symptoms ("…before your symptoms eased"); otherwise the existing
|
||||
// vital-driven phrasing. Clinically calm — observation, never prediction.
|
||||
const symptomDriven = value.gapDriverType === "FUNCTIONAL_IMPACT";
|
||||
|
||||
return (
|
||||
<div className="space-y-5">
|
||||
@@ -71,11 +75,19 @@ function CorrelationBody({ value }: { value: IllnessCorrelationValue }) {
|
||||
</p>
|
||||
<p className="text-muted-foreground mt-1 text-sm">
|
||||
{gap > 0
|
||||
? t("illness.correlation.recoveryGapLag", { days: gap })
|
||||
? t(
|
||||
symptomDriven
|
||||
? "illness.correlation.recoveryGapLagSymptom"
|
||||
: "illness.correlation.recoveryGapLag",
|
||||
{ days: gap },
|
||||
)
|
||||
: gap < 0
|
||||
? t("illness.correlation.recoveryGapLead", {
|
||||
days: Math.abs(gap),
|
||||
})
|
||||
? t(
|
||||
symptomDriven
|
||||
? "illness.correlation.recoveryGapLeadSymptom"
|
||||
: "illness.correlation.recoveryGapLead",
|
||||
{ days: Math.abs(gap) },
|
||||
)
|
||||
: t("illness.correlation.recoveryGapSame")}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -97,9 +97,11 @@ export interface IllnessVitalDeviation {
|
||||
}
|
||||
|
||||
export interface IllnessVitalReturn {
|
||||
/** A `MeasurementType`, or `"FUNCTIONAL_IMPACT"` for the symptom-burden track. */
|
||||
type: string;
|
||||
returnedDay: string | null;
|
||||
gapDays: number | null;
|
||||
adverse: boolean;
|
||||
}
|
||||
|
||||
export interface IllnessRedFlag {
|
||||
@@ -117,6 +119,12 @@ export interface IllnessCorrelationValue {
|
||||
recoveryGapDays: number | null;
|
||||
adverseCoverageDays: number;
|
||||
feltBetterDay: string | null;
|
||||
/**
|
||||
* The metric that drove the headline gap — a `MeasurementType`,
|
||||
* `"FUNCTIONAL_IMPACT"` (the symptom-burden track), or null. Drives the
|
||||
* driver-aware recovery-gap copy.
|
||||
*/
|
||||
gapDriverType: string | null;
|
||||
redFlags: IllnessRedFlag[];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user