Add feedback service, reminder diagnostics and smooth week transitions

This commit is contained in:
Codex
2026-10-14 15:53:21 +08:00
parent c5e736b39b
commit 1f06e3741e
40 changed files with 3982 additions and 25 deletions
+40
View File
@@ -6,6 +6,7 @@ import 'package:hepan_everyday/domain/app_snapshot.dart';
import 'package:hepan_everyday/domain/app_settings.dart';
import 'package:hepan_everyday/domain/schedule_engine.dart';
import 'package:hepan_everyday/features/timetable/timetable_page.dart';
import 'package:hepan_everyday/widgets/directional_week_transition.dart';
import '../support/fakes.dart';
@@ -51,6 +52,45 @@ Future<void> _open(WidgetTester tester, AppController controller) async {
void main() {
setUpAll(tzdata.initializeTimeZones);
testWidgets(
'week arrows animate the grid and current week reverses direction',
(tester) async {
await _open(tester, _controller());
await tester.tap(find.byIcon(Icons.chevron_right_rounded));
await tester.pump();
await tester.pump(const Duration(milliseconds: 100));
expect(find.byType(DirectionalWeekTransition), findsOneWidget);
expect(find.text('第1周课程'), findsOneWidget);
expect(find.text('第2周课程'), findsOneWidget);
expect(
tester
.widget<FractionalTranslation>(
find.byKey(const Key('week-transition-incoming')),
)
.translation
.dx,
greaterThan(0),
);
await tester.pumpAndSettle();
expect(find.text('第1周课程'), findsNothing);
await tester.tap(find.text('本周'));
await tester.pump();
await tester.pump(const Duration(milliseconds: 100));
expect(
tester
.widget<FractionalTranslation>(
find.byKey(const Key('week-transition-incoming')),
)
.translation
.dx,
lessThan(0),
);
await tester.pumpAndSettle();
expect(find.text('第 1 周'), findsOneWidget);
expect(find.text('第2周课程'), findsNothing);
expect(find.text('周日'), findsOneWidget);
},
);
testWidgets(
'horizontal course swipe changes week and course taps still open',
(tester) async {