Consolidate extension data providers and add side effects catch-up

- Create unified ExtensionDataProvider for Widget and Watch targets
- Remove duplicate WatchDataProvider and WatchConnectivityManager from Watch App
- Add side effects catch-up mechanism in MoodLogger for widget votes
- Process pending side effects on app launch and midnight background task
- Reduce ~450 lines of duplicated code across targets

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-12-21 22:50:23 -06:00
parent 83aad66f26
commit f7da61d6ca
12 changed files with 306 additions and 530 deletions

View File

@@ -53,7 +53,7 @@ struct ContentView: View {
// Also save locally as fallback and for immediate complication updates
Task { @MainActor in
// Always save locally for immediate complication display
WatchDataProvider.shared.addMood(mood, forDate: date)
ExtensionDataProvider.shared.add(mood: mood, forDate: date, entryType: .watch)
// Send to iPhone - it will handle HealthKit, Live Activity, etc.
_ = WatchConnectivityManager.shared.sendMoodToPhone(mood: mood.rawValue, date: date)