feat(todo): Today counts its tasks under its title
As Todoist's, Today's app bar says how many tasks it holds, those
overdue and those due today together ("3 tasks"). TabScreen takes an
optional subtitle for it, left out while tasks are being chosen, when
the title counts those instead.
Whats-New: Today says how many tasks are overdue or due today under its title.
Whats-New-De: „Heute“ zeigt unter dem Titel, wie viele Aufgaben überfällig oder heute fällig sind.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
b043d5ef9e
commit
8a677e0845
1 changed files with 94 additions and 3 deletions
|
|
@ -1848,6 +1848,36 @@ void main() {
|
|||
expect(find.text('Pay the bill'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('Today counts what is overdue and due today under its '
|
||||
"title, as Todoist's; not while tasks are chosen (the developer's "
|
||||
'review, 4 Nov 2026)', (tester) async {
|
||||
final today = Day.of(DateTime.now());
|
||||
await start(tester, usedBefore: true);
|
||||
expect(find.textContaining('task'), findsNothing, reason: 'none yet');
|
||||
for (final (title, day) in [
|
||||
('Pay the bill', today.plus(-2)),
|
||||
('Water plants', today),
|
||||
('Call mum', today),
|
||||
('Pack', today.plus(1)),
|
||||
]) {
|
||||
await seed(
|
||||
tester,
|
||||
TaskContent(title: title, projectId: inbox(), date: TaskDate(day)),
|
||||
);
|
||||
}
|
||||
|
||||
final count = find.descendant(
|
||||
of: find.byType(AppBar),
|
||||
matching: find.text('3 tasks'),
|
||||
);
|
||||
expect(count, findsOneWidget);
|
||||
await tester.tap(find.byTooltip('More'));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text('Select tasks'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(count, findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('Today puts what is overdue first; Reschedule moves it to '
|
||||
'the day picked', (tester) async {
|
||||
final today = Day.of(DateTime.now());
|
||||
|
|
|
|||
Loading…
Reference in a new issue