feat(train): Days, the Loop's days and nights kept sealed (ADR 0030, D37, D38)

What the band read brings, from the bridge or the background job's
file (`LoopLines`), is kept by `DayRepository`: one sealed `day` and
`night` a date and the day's heart rate in chunks of three hours, every
ID made from the person and the date, a later read replacing what it
brought and keeping the rest, nothing rewritten unchanged; versioned,
gzipped JSON (`day_payload.dart`). `PolarLoop` reads the band as each
connection is ready (every half hour at most, or when asked), takes in
the background file as the app opens, and remembers up to which day
the days are sealed, which the next read then deletes on the band;
it keeps the background job on the band and from the right day, and
`Let the band go` stops it.

Home gains a Days tab, each day with its steps, active time, sleep and
Nightly Recharge, pulled to read the band; a day's page shows its
figures, its time in each class, its heart rate, the night's phases
and rating, Nightly Recharge and skin temperature.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-28 19:53:12 +01:00
commit 5250f32329
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -276,5 +276,64 @@
"loopSetUpDone": "The band is set up.",
"loopFormTitle": "For your band",
"loopFormIntro": "Your band needs these. They're kept in Your body, sealed with your key. For a resting or highest heart rate or a VO2max you haven't given, the band takes Polar's defaults, and Your body stays as it is.",
"loopFormSave": "Set up the band"
"loopFormSave": "Set up the band",
"homeWorkouts": "Workouts",
"homeDays": "Days",
"daysEmptyTitle": "No days yet",
"daysEmptyHint": "The days and nights your Polar Loop counts show here.",
"daysSteps": "{steps, plural, =1{1 step} other{{steps} steps}}",
"@daysSteps": {"placeholders": {"steps": {"type": "int"}}},
"daysActive": "{time} active",
"@daysActive": {"placeholders": {"time": {"type": "String", "example": "1 h 20 min"}}},
"daysAsleep": "{time} asleep",
"@daysAsleep": {"placeholders": {"time": {"type": "String", "example": "7 h 10 min"}}},
"daysRecharge": "Recharge {level} of 6",
"@daysRecharge": {"placeholders": {"level": {"type": "int"}}},
"dayHoursMinutes": "{hours} h {minutes} min",
"@dayHoursMinutes": {"placeholders": {"hours": {"type": "int"}, "minutes": {"type": "int"}}},
"dayMinutes": "{minutes} min",
"@dayMinutes": {"placeholders": {"minutes": {"type": "int"}}},
"dayCalories": "{calories} kcal",
"@dayCalories": {"placeholders": {"calories": {"type": "int"}}},
"dayGoal": "{percent} % of the day's goal",
"@dayGoal": {"placeholders": {"percent": {"type": "int"}}},
"dayNothing": "The band has given nothing for this day yet.",
"dayTimes": "The day's time",
"dayTimeNonWear": "Not worn",
"dayTimeSleep": "Asleep",
"dayTimeSedentary": "Sitting still",
"dayTimeLight": "Light activity",
"dayTimeModerate": "Moderate activity",
"dayTimeVigorous": "Vigorous activity",
"dayHeartRate": "Heart rate",
"dayBpm": "{bpm} bpm",
"@dayBpm": {"placeholders": {"bpm": {"type": "int"}}},
"dayNight": "The night",
"dayNightSpan": "{from} – {to}",
"@dayNightSpan": {"placeholders": {"from": {"type": "String", "example": "23:15"}, "to": {"type": "String", "example": "07:05"}}},
"daySleepWake": "Awake",
"daySleepRem": "REM",
"daySleepLight": "Light",
"daySleepDeep": "Deep",
"dayRatingPoorly": "You slept poorly",
"dayRatingSomewhatPoorly": "You slept somewhat poorly",
"dayRatingNeither": "You slept neither poorly nor well",
"dayRatingSomewhatWell": "You slept somewhat well",
"dayRatingWell": "You slept well",
"dayRecharge": "Nightly Recharge",
"dayRechargeLevel": "Recovery {level} of 6",
"@dayRechargeLevel": {"placeholders": {"level": {"type": "int"}}},
"dayAnsStatus": "Autonomic nervous system {value}, from −10 to +10",
"@dayAnsStatus": {"placeholders": {"value": {"type": "String", "example": "+2.5"}}},
"dayNightHeart": "Heart rate {bpm} bpm, your usual {usual} bpm",
"@dayNightHeart": {"placeholders": {"bpm": {"type": "int"}, "usual": {"type": "int"}}},
"dayHrv": "Heart rate variability {ms} ms, your usual {usual} ms",
"@dayHrv": {"placeholders": {"ms": {"type": "int"}, "usual": {"type": "int"}}},
"dayBreathing": "Breathing {rate} a minute",
"@dayBreathing": {"placeholders": {"rate": {"type": "String", "example": "14.5"}}},
"daySkin": "Skin temperature",
"dayCelsius": "{value} °C",
"@dayCelsius": {"placeholders": {"value": {"type": "String", "example": "33.4"}}},
"daySkinDeviation": "{value} °C from your usual at night",
"@daySkinDeviation": {"placeholders": {"value": {"type": "String", "example": "−0.2"}}}
}