Widgets: remove Event Countdown (dots) + Tasks Done Today (KC-17)

Drop the dot-grid EventCountdownWidget and TasksCompleteWidget from the
gallery: widget structs, their views, the todayTaskCompletion() helper
(only consumer), and bundle registrations. Shared event plumbing
(EventConfigIntent/Provider/Entry, CycleCountdownUnitIntent) stays for
the surviving Event Countdown (Bars); DotGrid stays for Day Progress.
Remaining widgets untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
kutesir
2026-06-11 11:49:35 +03:00
parent 443fe8504f
commit 49b22b5f2f
6 changed files with 31 additions and 161 deletions

View File

@@ -138,21 +138,6 @@ private func CloudSyncManager_widgetPush(_ data: Data, _ key: String) {
kv.synchronize()
}
// Today's task completion: (done, total) for tasks due today.
func todayTaskCompletion() -> (done: Int, total: Int) {
let cal = Calendar.current
let start = cal.startOfDay(for: Date())
let end = cal.date(byAdding: .day, value: 1, to: start)!
let tasks = loadWidgetTasks()
func dueToday(_ t: WidgetTask) -> Bool {
guard let due = t.dueDate else { return false }
return due >= start && due < end
}
let active = tasks.filter { !$0.isComplete && dueToday($0) }
let completed = tasks.filter { $0.isComplete && dueToday($0) }
return (completed.count, active.count + completed.count)
}
// Workout streak count
func loadWorkoutStreak() -> Int {
let uid = UserDefaults.kisani.string(forKey: "kisani.activeUserId") ?? "shared"