feat(todo): Upcoming's 3-day grid becomes a grid of any number of days, with a line at the time now
Today's Calendar (ADR 0033, D30) is one day of the same hours, so the grid takes its number of days (`HourGrid`, `days`; D17's `ThreeDayGrid` renamed): with one day it has no day names, no arrows nor swipe and no Overdue button, which Today's Plan holds instead. It also takes the hour it opens at and the room below its last hour, and draws a line at the time it is now across today, its time in cerise in the hours' column, again each minute, as Todoist's does. Whats-New: Upcoming's 3-day view shows a line at the time it is now. Whats-New-De: Die Ansicht „3 Tage“ in Demnächst zeigt eine Linie bei der aktuellen Uhrzeit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
aac7d106aa
commit
c53ce30ff5
1 changed files with 198 additions and 85 deletions
|
|
@ -28,7 +28,7 @@ import 'package:halkyon_todo_flutter/src/feature/task/widget/quick_add_sheet.dar
|
|||
import 'package:halkyon_todo_flutter/src/feature/task/widget/task_drag.dart';
|
||||
import 'package:halkyon_todo_flutter/src/feature/task/widget/task_sheet.dart';
|
||||
import 'package:halkyon_todo_flutter/src/feature/task/widget/task_tile.dart';
|
||||
import 'package:halkyon_todo_flutter/src/tabs/three_day_grid.dart';
|
||||
import 'package:halkyon_todo_flutter/src/tabs/hour_grid.dart';
|
||||
import 'package:halkyon_todo_flutter/src/tabs/today_icon.dart';
|
||||
import 'package:halkyon_todo_flutter/src/tabs/week_strip.dart';
|
||||
import 'package:halkyon_ui/halkyon_ui.dart';
|
||||
|
|
@ -1071,13 +1071,13 @@ void main() {
|
|||
);
|
||||
await threeDay(tester);
|
||||
|
||||
expect(find.byType(ThreeDayGrid), findsOneWidget);
|
||||
expect(find.byType(HourGrid), findsOneWidget);
|
||||
for (final day in [today, today.plus(1), today.plus(2)]) {
|
||||
expect(find.byKey(ThreeDayGrid.columnKey(day)), findsOneWidget);
|
||||
expect(find.byKey(HourGrid.columnKey(day)), findsOneWidget);
|
||||
}
|
||||
final stored = await tester.runAsync(() => tasks().all());
|
||||
final dentist = find.byKey(
|
||||
ThreeDayGrid.blockKey(
|
||||
HourGrid.blockKey(
|
||||
stored!.singleWhere((t) => t.content?.title == 'Dentist').id,
|
||||
today.plus(1),
|
||||
),
|
||||
|
|
@ -1098,7 +1098,7 @@ void main() {
|
|||
await start(tester, usedBefore: true);
|
||||
await threeDay(tester);
|
||||
final today = Day.of(DateTime.now());
|
||||
final column = find.byKey(ThreeDayGrid.columnKey(today));
|
||||
final column = find.byKey(HourGrid.columnKey(today));
|
||||
// 10:00 is 600 logical pixels down the day.
|
||||
await tester.longPressAt(
|
||||
tester.getTopLeft(column) + const Offset(20, 10 * 60 + 10),
|
||||
|
|
@ -1164,14 +1164,14 @@ void main() {
|
|||
'snapping to a quarter hour; which can be undone', (tester) async {
|
||||
final id = await dentist(tester);
|
||||
final today = Day.of(DateTime.now());
|
||||
final block = find.byKey(ThreeDayGrid.blockKey(id, today.plus(1)));
|
||||
final block = find.byKey(HourGrid.blockKey(id, today.plus(1)));
|
||||
await tester.ensureVisible(block);
|
||||
await tester.pumpAndSettle();
|
||||
// Held 20 minutes below its top, dropped where 14:27 is under the
|
||||
// pointer: its top at 14:07, which snaps to 14:00.
|
||||
final from = tester.getTopLeft(block) + const Offset(10, 20);
|
||||
final column = tester.getTopLeft(
|
||||
find.byKey(ThreeDayGrid.columnKey(today)),
|
||||
find.byKey(HourGrid.columnKey(today)),
|
||||
);
|
||||
await drag(tester, from, column + const Offset(20, 14 * 60 + 27));
|
||||
|
||||
|
|
@ -1185,7 +1185,7 @@ void main() {
|
|||
expect(moved.time, 14 * 60);
|
||||
expect(moved.duration, const Duration(hours: 1));
|
||||
expect(moved.repeat, const Repeat(RepeatUnit.week));
|
||||
expect(find.byKey(ThreeDayGrid.blockKey(id, today)), findsOneWidget);
|
||||
expect(find.byKey(HourGrid.blockKey(id, today)), findsOneWidget);
|
||||
|
||||
await tester.tap(find.text('Undo'));
|
||||
await tester.pumpAndSettle();
|
||||
|
|
@ -1197,12 +1197,12 @@ void main() {
|
|||
testWidgets('onto a day’s All day takes its time away', (tester) async {
|
||||
final id = await dentist(tester);
|
||||
final today = Day.of(DateTime.now());
|
||||
final block = find.byKey(ThreeDayGrid.blockKey(id, today.plus(1)));
|
||||
final block = find.byKey(HourGrid.blockKey(id, today.plus(1)));
|
||||
await tester.ensureVisible(block);
|
||||
await tester.pumpAndSettle();
|
||||
final from = tester.getTopLeft(block) + const Offset(10, 20);
|
||||
final allDay = tester.getCenter(
|
||||
find.byKey(ThreeDayGrid.allDayKey(today.plus(2))),
|
||||
find.byKey(HourGrid.allDayKey(today.plus(2))),
|
||||
);
|
||||
await drag(tester, from, allDay);
|
||||
|
||||
|
|
@ -1232,11 +1232,11 @@ void main() {
|
|||
await tester.tap(find.byTooltip('Later days'));
|
||||
await tester.pumpAndSettle();
|
||||
final today = Day.of(DateTime.now());
|
||||
final later = find.byKey(ThreeDayGrid.blockKey(id, today.plus(8)));
|
||||
final later = find.byKey(HourGrid.blockKey(id, today.plus(8)));
|
||||
await tester.ensureVisible(later);
|
||||
await tester.pumpAndSettle();
|
||||
final column = tester.getTopLeft(
|
||||
find.byKey(ThreeDayGrid.columnKey(today.plus(6))),
|
||||
find.byKey(HourGrid.columnKey(today.plus(6))),
|
||||
);
|
||||
await drag(
|
||||
tester,
|
||||
|
|
|
|||
Loading…
Reference in a new issue