fix(train): a day's skin temperature in time order, and its heart rate a point a minute without lost contact

The skin temperature's line ran backwards in places: the band's samples
aren't always in time order, and neither the Loop's lines, nor the kept
day, nor the chart sorted them. They are sorted now, a time given twice
kept once, as the lines are read and as a kept day is opened, and
WorkoutChart draws any points in the order of their x, from the least
to the most.

The heart rate spiked down: the band writes 0 where it lost contact,
and each run's mean, the chart's one point a run, counted those in. A
value that isn't a heart's rate is 0, none read, in its place (so the
samples after keep their times), left out of every mean, days kept
before included; the chart draws the samples a point a minute, averaged
across runs, rather than one mean a run, which zigzagged where runs lay
close. ADR 0030, D65.

Whats-New: A day's skin temperature no longer runs backwards, and its heart rate no longer drops where the band lost contact.
Whats-New-De: Die Hauttemperatur eines Tages läuft nicht mehr rückwärts, und sein Puls fällt nicht mehr ab, wo das Band den Kontakt verlor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-11-04 20:48:42 +01:00
commit ae3121310a
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -24,6 +24,21 @@ void main() {
),
);
test('its points are drawn in the order of their x, never backwards '
'(D65); points in order are taken as they are', () {
const sorted = [(x: 0.0, value: 1.0), (x: 1.0, value: 2.0)];
expect(
chartInOrder(const [
(x: 2.0, value: 3.0),
(x: 0.0, value: 1.0),
(x: 1.0, value: 2.0),
]),
[(x: 0.0, value: 1.0), (x: 1.0, value: 2.0), (x: 2.0, value: 3.0)],
);
expect(identical(chartInOrder(sorted), sorted), isTrue);
});
testWidgets('held, the value and its moment under the finger show beside '
'the title, following the finger, and go when it lifts', (
tester,