feat: optimize calendar for mobile (#3979)

* feat: calendar mobile ui

- Resolves double border on Calendar Cells
- Adds Jump to year quick action for Mobile
- Reduces Cell height in Calendar
- Change out EventList with EventIndicator in Cell

* chore: push card details screen

* fix: navigation to card details

* feat: day events screen update on new event

* fix: changes after merging main

* fix: missing argument

* fix: amend test and remove stack
This commit is contained in:
Mathias Mogensen
2023-11-25 16:31:54 +02:00
committed by GitHub
parent b3dd5fb8bd
commit 7fb1b4f43f
19 changed files with 510 additions and 231 deletions

View File

@ -74,10 +74,10 @@ void main() {
await tester.scrollToToday();
// Hover over today's calendar cell
await tester.hoverOnTodayCalendarCell();
// Tap on create new event button
await tester.tapAddCalendarEventButton();
await tester.hoverOnTodayCalendarCell(
// Tap on create new event button
onHover: () async => await tester.tapAddCalendarEventButton(),
);
// Make sure that the event editor popup is shown
tester.assertEventEditorOpen();
@ -90,15 +90,9 @@ void main() {
// Double click on today's calendar cell to create a new event
await tester.doubleClickCalendarCell(DateTime.now());
// Make sure that the event editor popup is shown
tester.assertEventEditorOpen();
// Make sure that the event is inserted in the cell
tester.assertNumberOfEventsInCalendar(2);
// Dismiss the event editor popup
await tester.dismissEventEditor();
// Click on the event
await tester.openCalendarEvent(index: 0);
tester.assertEventEditorOpen();
@ -112,7 +106,7 @@ void main() {
tester.assertNumberOfEventsOnSpecificDay(2, DateTime.now());
// Click on the event
await tester.openCalendarEvent(index: 1);
await tester.openCalendarEvent(index: 0);
tester.assertEventEditorOpen();
// Click on the open icon
@ -137,7 +131,7 @@ void main() {
tester.assertNumberOfEventsOnSpecificDay(2, DateTime.now());
// Delete event from row detail page
await tester.openCalendarEvent(index: 1);
await tester.openCalendarEvent(index: 0);
await tester.openEventToRowDetailPage();
tester.assertRowDetailPageOpened();
@ -163,7 +157,7 @@ void main() {
await tester.dismissEventEditor();
// Drag and drop the event onto the next week, same day
await tester.dragDropRescheduleCalendarEvent(firstOfThisMonth);
await tester.dragDropRescheduleCalendarEvent();
// Make sure that the event has been rescheduled to the new date
final sameDayNextWeek = firstOfThisMonth.add(const Duration(days: 7));

View File

@ -1249,12 +1249,14 @@ extension AppFlowyDatabaseTest on WidgetTester {
await pumpAndSettle(const Duration(milliseconds: 300));
}
Future<void> hoverOnTodayCalendarCell() async {
Future<void> hoverOnTodayCalendarCell({
Future<void> Function()? onHover,
}) async {
final todayCell = find.byWidgetPredicate(
(widget) => widget is CalendarDayCard && widget.isToday,
);
await hoverOnWidget(todayCell);
await hoverOnWidget(todayCell, onHover: onHover);
}
Future<void> tapAddCalendarEventButton() async {
@ -1362,7 +1364,7 @@ extension AppFlowyDatabaseTest on WidgetTester {
await tapButton(button);
}
Future<void> dragDropRescheduleCalendarEvent(DateTime startDate) async {
Future<void> dragDropRescheduleCalendarEvent() async {
final findEventCard = find.byType(EventCard);
await drag(findEventCard.first, const Offset(0, 300));
await pumpAndSettle();