feat: add widget extension — small, medium, large

- KisaniCalWidget: 3 sizes sharing the app's design language
  Small: date badge + kisaniCAL. wordmark + task count
  Medium: badge + task list (3 items) + workout row
  Large: badge + full task list (6 items) + workout row

- WidgetDataStore (Shared/): lightweight Codable types for App Group
  UserDefaults cross-process data exchange

- WidgetBridge: TaskViewModel/WorkoutViewModel extensions that sync
  data into App Group and call WidgetCenter.reloadAllTimelines()

- ContentView: calls syncWidget() on appear and scene becoming active

- project.yml + entitlements updated; project regenerated via xcodegen
This commit is contained in:
kutesir
2026-05-28 19:48:01 +03:00
parent 05a579e2f7
commit 5e232f2d81
9 changed files with 739 additions and 24 deletions

View File

@@ -73,12 +73,19 @@ struct ContentView: View {
OnboardingView(isPresented: $showOnboarding)
.onDisappear { hasOnboarded = true }
}
.onAppear { if !hasOnboarded { showOnboarding = true } }
.onAppear {
if !hasOnboarded { showOnboarding = true }
taskVM.syncWidget()
workoutVM.syncWidget()
}
.onChange(of: scenePhase) { phase in
if phase == .active {
NotificationManager.shared.reschedule(workoutVM: workoutVM, taskVM: taskVM)
taskVM.syncWidget()
workoutVM.syncWidget()
}
}
.onChange(of: taskVM.tasks.count) { _ in taskVM.syncWidget() }
.onChange(of: workoutVM.doneSets) { _ in
NotificationManager.shared.reschedule(workoutVM: workoutVM, taskVM: taskVM)
}