feat: add two-tab timetable UI and glass dock

This commit is contained in:
Codex
2026-10-12 23:33:33 +08:00
parent 808af007a2
commit 8a98d49d12
17 changed files with 1912 additions and 9 deletions
+31
View File
@@ -35,6 +35,32 @@ void main() {
);
});
tearDown(() => controller.dispose());
test('a new successful demo action clears a stale save error', () async {
await controller.initialize();
store.failSave = true;
await controller.updateSettings(
controller.snapshot.settings.copyWith(reminderMinutes: 30),
);
expect(controller.lastError, isNotNull);
await controller.showDemo();
expect(controller.lastError, isNull);
});
test(
'refresh after corrupt storage never reconciles an empty timetable',
() async {
final damaged = AppController(
DamagedStore(),
notifications,
calendar,
() => DateTime.utc(2026, 9, 8),
);
await damaged.initialize();
await damaged.refreshServices();
expect(notifications.reconciliations, 0);
expect(damaged.storageReady, isFalse);
damaged.dispose();
},
);
test('failed saving does not change currently visible settings', () async {
await controller.initialize();
store.failSave = true;
@@ -90,3 +116,8 @@ void main() {
},
);
}
class DamagedStore extends MemoryStore {
@override
Future<AppSnapshot?> load() async => throw const FormatException('damaged');
}