fix(train): a day's page of its own, in cards, its night and Recharge drawn in place
The night's chart threw mid-paint where Polar's last phase starts at the night's end or after it: its right edge was clamped between left + 1 and the row's width, the lower bound then above the upper (an ArgumentError). A throw mid-paint leaves the canvas moved, so the rows below and the charts after them were drawn out of place, the skin temperature's among them. Each phase now stays within its row, a pixel wide at least. Nightly Recharge showed Polar's marks for a figure it has none of (-1 for the recovery and the intervals, -100 for the nervous system's status, 0 for a baseline not yet learnt) as the person's own. Recharge.known leaves them out, on the page and in the days' list; the figures are rows, each with the person's usual below it, and Polar's explanation of them (the status from -10 to +10, what each measures) is behind halkyon_ui's question mark. The page is a screen of its own over the tabs, without the bar and with the way back at its top left, its parts in cards (the developer's review of 3 Nov 2026; D60 had it inside Profile). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
adbb2c4f2f
commit
ddca423b8a
2 changed files with 1768 additions and 360 deletions
|
|
@ -0,0 +1,38 @@
|
|||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:halkyon_train_flutter/l10n/app_localizations.dart';
|
||||
import 'package:halkyon_train_flutter/src/feature/day/model/day.dart';
|
||||
import 'package:halkyon_train_flutter/src/feature/day/widget/night_chart.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets("a phase starting at the night's end or after it paints "
|
||||
'nothing out of its row rather than throwing mid-paint, which left '
|
||||
'the rows and the charts below drawn out of place (3 Nov 2026)', (
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
home: Scaffold(
|
||||
body: SizedBox(
|
||||
width: 320,
|
||||
child: NightChart(
|
||||
phases: [
|
||||
(Duration.zero, SleepState.light),
|
||||
(Duration(hours: 2), SleepState.rem),
|
||||
(Duration(hours: 3), SleepState.deep),
|
||||
// Polar's last phase, at the night's very end, and one past
|
||||
// it.
|
||||
(Duration(hours: 4), SleepState.wake),
|
||||
(Duration(hours: 5), SleepState.rem),
|
||||
],
|
||||
length: Duration(hours: 4),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:halkyon_train_flutter/src/feature/day/model/day.dart';
|
||||
|
||||
void main() {
|
||||
test("Polar's marks for no value (-1, -100, 0) are no value, the "
|
||||
"person's own figures kept", () {
|
||||
const fromBand = Recharge(
|
||||
ansStatus: -100,
|
||||
recovery: -1,
|
||||
recoverySubLevel: -1,
|
||||
rri: 1000,
|
||||
rmssd: 69,
|
||||
breathInterval: 4380,
|
||||
baselineRri: 0,
|
||||
baselineRmssd: -1,
|
||||
);
|
||||
expect(
|
||||
fromBand.known,
|
||||
const Recharge(rri: 1000, rmssd: 69, breathInterval: 4380),
|
||||
);
|
||||
});
|
||||
|
||||
test('figures in their ranges stay as they are', () {
|
||||
const fromBand = Recharge(
|
||||
ansStatus: -2.5,
|
||||
recovery: 4,
|
||||
recoverySubLevel: 2,
|
||||
rmssd: 48,
|
||||
baselineRmssd: 45,
|
||||
);
|
||||
expect(fromBand.known, fromBand);
|
||||
});
|
||||
}
|
||||
Loading…
Reference in a new issue