feat: draft auto-save in compose screen

- Add Drafts table (schema v4 migration) with autoincrement id,
  accountId, replyToEmailId, to/cc/subject/body text, updatedAt
- DraftRepository interface + DraftRepositoryImpl (Drift)
- draftRepositoryProvider wired in di.dart
- ComposeScreen debounces saves (2 s after last keystroke), shows
  transient "Saved" indicator, restores the latest matching draft on
  open when no prefill fields are provided, deletes draft on send
- 6 new unit tests for DraftRepositoryImpl
- New widget test verifying draft restore behaviour
- FakeDraftRepository added to widget test helpers
- draft_repository.dart added to coverage no-code exclusion list

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas Güttler
2026-04-18 19:06:02 +02:00
co-authored by Claude Sonnet 4.6
parent 2f1924be9c
commit e1e95e97ee
11 changed files with 477 additions and 7 deletions
+1
View File
@@ -12,6 +12,7 @@ const _minCoveragePercent = 85;
// Pure-abstract interfaces: no executable code, Dart VM never instruments them.
const _noCode = {
'lib/core/repositories/account_repository.dart',
'lib/core/repositories/draft_repository.dart',
'lib/core/repositories/email_repository.dart',
'lib/core/repositories/mailbox_repository.dart',
'lib/core/storage/secure_storage.dart',