feat(sleep): surface sleep debt and chronotype

Assemble a sleep-rhythm read on the canonical per-night reconstruction — the
same midpoints and asleep totals the sleep score uses — that reports a rolling
sleep debt against the age-based need and an MCTQ chronotype with its mid-sleep,
social jetlag and band. A shared assembler caps the chronotype window so the
dashboard and the dedicated read return identical values, and both withhold a
confident reading behind a learning state until enough nights accrue. The sleep
page gains a debt headline and a chronotype card with the deeper detail behind
an advanced disclosure; the sleep score is left untouched so debt reframes the
sufficiency gap without double-counting it.
This commit is contained in:
Marc-André Bombeck committed 2026-06-14 19:12:01 +02:00
commit a970ba8ab0
22 files changed
+1529 -2

No files matched your search

+26
View File
@@ -2671,6 +2671,32 @@
"title": "Noch keine Schlafdaten",
"description": "Apple-Health-Sync folgt mit v1.5 und füllt diese Ansicht automatisch.",
"action": "Geräte verwalten"
},
"debt": {
"title": "Schlafschuld",
"value": "{hours} Std. {minutes} Min. zu wenig",
"caption": "Kumuliertes Defizit der letzten {nights} Nächte",
"clearValue": "Ausgeglichen",
"clearCaption": "Kein aufgelaufenes Defizit über die letzten {nights} Nächte",
"learning": "Dein Schlaf wird noch erfasst — {counted} Nächte bisher, noch {remaining} für eine verlässliche Bilanz."
},
"chronotype": {
"title": "Chronotyp",
"learning": "Dein Rhythmus wird noch erfasst — {counted} von {total} freien Nächten. Ein Chronotyp braucht ein paar weckerfreie Morgen, um aussagekräftig zu sein.",
"midSleepCaption": "Schlafmitte an freien Tagen gegen {clock}",
"advancedToggle": "Mehr Details",
"socialJetlagValue": "{hours} Std. {minutes} Min. sozialer Jetlag",
"socialJetlagCaption": "Der Unterschied zwischen deinem Schlaf an Arbeits- und freien Tagen — wie eine kleine wöchentliche Zeitzonenverschiebung.",
"msfScValue": "Korrigierte Schlafmitte {clock}",
"msfScCaption": "Bereinigt um den Schlaf, den du am Wochenende nachholst (MSFsc).",
"dayTypeNote": "Freie Tage werden als Wochenenden angenommen, bis eine Tagestyp-Erfassung ergänzt wird.",
"band": {
"extreme_early": "Ausgeprägter Morgentyp",
"early": "Morgentyp",
"intermediate": "Mischtyp",
"late": "Abendtyp",
"extreme_late": "Ausgeprägter Abendtyp"
}
}
},
"correlations": "Korrelationen",
+26
View File
@@ -2671,6 +2671,32 @@
"title": "No sleep data yet",
"description": "Apple Health sync arrives in v1.5 and will fill this in automatically.",
"action": "Manage devices"
},
"debt": {
"title": "Sleep debt",
"value": "{hours}h {minutes}m short",
"caption": "Cumulative shortfall over the last {nights} nights",
"clearValue": "All caught up",
"clearCaption": "No accumulated shortfall over the last {nights} nights",
"learning": "Still learning your sleep — {counted} nights so far, {remaining} more to read a reliable balance."
},
"chronotype": {
"title": "Chronotype",
"learning": "Still learning your rhythm — {counted} of {total} free nights. A chronotype needs a few alarm-free mornings before it means anything.",
"midSleepCaption": "Mid-sleep on free days around {clock}",
"advancedToggle": "Advanced",
"socialJetlagValue": "{hours}h {minutes}m social jetlag",
"socialJetlagCaption": "The gap between your work-day and free-day sleep timing — like a small weekly time-zone shift.",
"msfScValue": "Corrected mid-sleep {clock}",
"msfScCaption": "Adjusted for the sleep you catch up on at the weekend (MSFsc).",
"dayTypeNote": "Free days are assumed to be weekends until day-type tracking is added.",
"band": {
"extreme_early": "Strong morning type",
"early": "Morning type",
"intermediate": "Intermediate type",
"late": "Evening type",
"extreme_late": "Strong evening type"
}
}
},
"correlations": "Correlations",
+26
View File
@@ -2671,6 +2671,32 @@
"title": "Aún no hay datos de sueño",
"description": "La sincronización con Apple Health llega con la v1.5 y llenará esta vista automáticamente.",
"action": "Gestionar dispositivos"
},
"debt": {
"title": "Deuda de sueño",
"value": "{hours} h {minutes} min de déficit",
"caption": "Déficit acumulado de las últimas {nights} noches",
"clearValue": "Al día",
"clearCaption": "Sin déficit acumulado en las últimas {nights} noches",
"learning": "Aún estamos midiendo tu sueño — {counted} noches hasta ahora, faltan {remaining} para un balance fiable."
},
"chronotype": {
"title": "Cronotipo",
"learning": "Aún estamos aprendiendo tu ritmo — {counted} de {total} noches libres. Un cronotipo necesita varias mañanas sin despertador para tener sentido.",
"midSleepCaption": "Punto medio del sueño en días libres en torno a las {clock}",
"advancedToggle": "Avanzado",
"socialJetlagValue": "{hours} h {minutes} min de jet lag social",
"socialJetlagCaption": "La diferencia entre el horario de sueño laboral y el de los días libres — como un pequeño cambio de huso horario semanal.",
"msfScValue": "Punto medio corregido {clock}",
"msfScCaption": "Ajustado por el sueño que recuperas el fin de semana (MSFsc).",
"dayTypeNote": "Se asume que los días libres son los fines de semana hasta que se añada el registro del tipo de día.",
"band": {
"extreme_early": "Matutino marcado",
"early": "Matutino",
"intermediate": "Intermedio",
"late": "Vespertino",
"extreme_late": "Vespertino marcado"
}
}
},
"correlations": "Correlaciones",
+26
View File
@@ -2671,6 +2671,32 @@
"title": "Pas encore de données de sommeil",
"description": "La synchro Apple Health arrive avec la v1.5 et remplira automatiquement cette vue.",
"action": "Gérer les appareils"
},
"debt": {
"title": "Dette de sommeil",
"value": "{hours} h {minutes} min de déficit",
"caption": "Déficit cumulé sur les {nights} dernières nuits",
"clearValue": "À jour",
"clearCaption": "Aucun déficit cumulé sur les {nights} dernières nuits",
"learning": "Votre sommeil est encore en cours d'analyse — {counted} nuits jusqu'ici, encore {remaining} pour un bilan fiable."
},
"chronotype": {
"title": "Chronotype",
"learning": "Votre rythme est encore en cours d'analyse — {counted} sur {total} nuits libres. Un chronotype a besoin de quelques matins sans réveil pour avoir du sens.",
"midSleepCaption": "Milieu de sommeil les jours libres vers {clock}",
"advancedToggle": "Avancé",
"socialJetlagValue": "{hours} h {minutes} min de jet lag social",
"socialJetlagCaption": "L'écart entre vos horaires de sommeil les jours travaillés et les jours libres — comme un petit décalage horaire hebdomadaire.",
"msfScValue": "Milieu de sommeil corrigé {clock}",
"msfScCaption": "Ajusté pour le sommeil rattrapé le week-end (MSFsc).",
"dayTypeNote": "Les jours libres sont supposés être les week-ends jusqu'à l'ajout du suivi du type de jour.",
"band": {
"extreme_early": "Type du matin marqué",
"early": "Type du matin",
"intermediate": "Type intermédiaire",
"late": "Type du soir",
"extreme_late": "Type du soir marqué"
}
}
},
"correlations": "Corrélations",
+26
View File
@@ -2671,6 +2671,32 @@
"title": "Ancora nessun dato sul sonno",
"description": "La sync con Apple Health arriva con v1.5 e riempirà questa vista in automatico.",
"action": "Gestisci dispositivi"
},
"debt": {
"title": "Debito di sonno",
"value": "{hours} h {minutes} min in meno",
"caption": "Deficit cumulato nelle ultime {nights} notti",
"clearValue": "In pari",
"clearCaption": "Nessun deficit accumulato nelle ultime {nights} notti",
"learning": "Stiamo ancora misurando il tuo sonno — {counted} notti finora, ne mancano {remaining} per un bilancio affidabile."
},
"chronotype": {
"title": "Cronotipo",
"learning": "Stiamo ancora imparando il tuo ritmo — {counted} di {total} notti libere. Un cronotipo richiede alcune mattine senza sveglia per avere significato.",
"midSleepCaption": "Metà del sonno nei giorni liberi intorno alle {clock}",
"advancedToggle": "Avanzate",
"socialJetlagValue": "{hours} h {minutes} min di jet lag sociale",
"socialJetlagCaption": "La differenza tra gli orari del sonno nei giorni lavorativi e in quelli liberi — come un piccolo cambio di fuso orario settimanale.",
"msfScValue": "Metà del sonno corretta {clock}",
"msfScCaption": "Corretta per il sonno recuperato nel fine settimana (MSFsc).",
"dayTypeNote": "Si presume che i giorni liberi siano i fine settimana finché non verrà aggiunto il tracciamento del tipo di giorno.",
"band": {
"extreme_early": "Tipo mattutino marcato",
"early": "Tipo mattutino",
"intermediate": "Tipo intermedio",
"late": "Tipo serale",
"extreme_late": "Tipo serale marcato"
}
}
},
"correlations": "Correlazioni",
+26
View File
@@ -2671,6 +2671,32 @@
"title": "Brak danych o śnie",
"description": "Synchronizacja Apple Health pojawi się w v1.5 i wypełni ten widok automatycznie.",
"action": "Zarządzaj urządzeniami"
},
"debt": {
"title": "Dług snu",
"value": "{hours} godz. {minutes} min niedoboru",
"caption": "Skumulowany niedobór z ostatnich {nights} nocy",
"clearValue": "Na bieżąco",
"clearCaption": "Brak skumulowanego niedoboru w ostatnich {nights} nocach",
"learning": "Wciąż analizujemy Twój sen — {counted} nocy do tej pory, jeszcze {remaining}, aby uzyskać wiarygodny bilans."
},
"chronotype": {
"title": "Chronotyp",
"learning": "Wciąż poznajemy Twój rytm — {counted} z {total} wolnych nocy. Chronotyp wymaga kilku poranków bez budzika, aby coś znaczył.",
"midSleepCaption": "Środek snu w dni wolne około {clock}",
"advancedToggle": "Zaawansowane",
"socialJetlagValue": "{hours} godz. {minutes} min jet lagu społecznego",
"socialJetlagCaption": "Różnica między porą snu w dni robocze i wolne — jak niewielka cotygodniowa zmiana strefy czasowej.",
"msfScValue": "Skorygowany środek snu {clock}",
"msfScCaption": "Skorygowany o sen nadrabiany w weekend (MSFsc).",
"dayTypeNote": "Dni wolne przyjmuje się jako weekendy, dopóki nie zostanie dodane śledzenie typu dnia.",
"band": {
"extreme_early": "Wyraźny typ poranny",
"early": "Typ poranny",
"intermediate": "Typ pośredni",
"late": "Typ wieczorny",
"extreme_late": "Wyraźny typ wieczorny"
}
}
},
"correlations": "Korelacje",