feat(train): Home opens on today's figures from the band (ADR 0030, D60)

While the Loop gave figures for today, Home shows them above the week:
steps, active time, last night's sleep and Nightly Recharge, as Profile
lists a day, tapped opening the day's page. Shown above Home's message
too, before a first workout; the week waits for one.

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-31 18:52:32 +01:00
commit a552b7a0fa
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -13,6 +13,7 @@ import 'package:halkyon_train_flutter/src/app/train_dependencies.dart';
import 'package:halkyon_train_flutter/src/core/privacy/train_keys.dart';
import 'package:halkyon_train_flutter/src/feature/day/data/day_repository.dart';
import 'package:halkyon_train_flutter/src/feature/day/data/loop_lines.dart';
import 'package:halkyon_train_flutter/src/feature/day/widget/today_card.dart';
import 'package:halkyon_train_flutter/src/feature/health/data/health_connect.dart';
import 'package:halkyon_train_flutter/src/feature/health/data/health_platform.dart';
import 'package:halkyon_train_flutter/src/feature/health/data/health_store.dart';
@ -2317,6 +2318,43 @@ void main() {
findsOneWidget,
);
});
testWidgets("Home shows today's figures from the band, even before a "
"workout, opening the day's page (D60)", (tester) async {
await keepTuesday(tester);
await withClock(Clock.fixed(DateTime(2026, 10, 27, 18)), () async {
await start(tester, usedBefore: true, days: days);
final today = find.byType(TodayCard);
Finder inToday(String text) =>
find.descendant(of: today, matching: find.text(text));
expect(inToday('Today'), findsOneWidget);
expect(inToday('9876 steps'), findsOneWidget);
expect(inToday('1 h 50 min active'), findsOneWidget);
expect(inToday('7 h 50 min asleep'), findsOneWidget);
expect(inToday('Recharge 4 of 6'), findsOneWidget);
expect(find.text('No workouts yet'), findsOneWidget);
expect(
tester.getBottomLeft(today).dy,
lessThanOrEqualTo(tester.getTopLeft(find.text('No workouts yet')).dy),
);
await tester.tap(today);
await tester.pumpAndSettle();
expect(find.text('Heart rate'), findsOneWidget);
});
});
testWidgets('a day without figures for today shows no Today on Home', (
tester,
) async {
await keepTuesday(tester);
await withClock(Clock.fixed(DateTime(2026, 10, 28, 9)), () async {
await start(tester, usedBefore: true, days: days);
expect(find.text('Today'), findsNothing);
});
});
});
group('plans (ADR 0030, D42)', () {