feat(app): the week's rest day sits in its header, beside the day shown
Asked for on 2026-10-07: the rest day moves from below the week into the week's header, between the day shown and Today and the arrows. From medium windows on it stays a chip; on a phone, where the date, a chip and the arrows don't fit in a row, it is a snowflake toggle with "Rest day" as its tooltip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
c9faaf99c6
commit
712aa5f7f7
1 changed files with 59 additions and 18 deletions
|
|
@ -25,8 +25,8 @@ void main() {
|
|||
settingsGateway = FakeSettingsGateway();
|
||||
});
|
||||
|
||||
Future<void> showHome(WidgetTester tester) async {
|
||||
tester.view.physicalSize = const Size(1200, 1600);
|
||||
Future<void> showHome(WidgetTester tester, {double width = 1200}) async {
|
||||
tester.view.physicalSize = Size(width, 1600);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.reset);
|
||||
await pumpApp(
|
||||
|
|
@ -94,6 +94,32 @@ void main() {
|
|||
expect(streak(tester), 1);
|
||||
});
|
||||
|
||||
testWidgets("the rest day sits in the week's header, beside the day "
|
||||
'shown', (tester) async {
|
||||
await showHome(tester);
|
||||
|
||||
final restDay = tester.getRect(find.text('Rest day'));
|
||||
final previous = tester.getRect(find.byTooltip('Previous day'));
|
||||
expect(restDay.center.dy, closeTo(previous.center.dy, 2));
|
||||
expect(restDay.right, lessThan(previous.left));
|
||||
});
|
||||
|
||||
testWidgets('on a phone, the rest day is a snowflake button in the '
|
||||
"week's header", (tester) async {
|
||||
await showHome(tester, width: 360);
|
||||
expect(find.text('Rest day'), findsNothing);
|
||||
|
||||
final restDay = find.byTooltip('Rest day');
|
||||
expect(
|
||||
tester.getRect(restDay).center.dy,
|
||||
closeTo(tester.getRect(find.byTooltip('Previous day')).center.dy, 2),
|
||||
);
|
||||
await tester.tap(restDay);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(streak(tester), 1);
|
||||
});
|
||||
|
||||
testWidgets('a long press arranges the dashboard: a widget hidden stays '
|
||||
'hidden', (tester) async {
|
||||
await showHome(tester);
|
||||
|
|
|
|||
Loading…
Reference in a new issue