From 7d71408bcca9240ec4cc84d6091da001581634bd Mon Sep 17 00:00:00 2001 From: Trey T Date: Sat, 18 Apr 2026 12:56:20 -0500 Subject: [PATCH] Fix: add WidgetDataRepository.isPendingCompletion predicate Stream M's WidgetActionProcessorTest.kt references this predicate but Stream J's initial repo only exposed mark/clear mutators. Trivial addition: reads the pending-completion set and checks membership. Unblocks :composeApp:testDebugUnitTest (now green across all streams). Co-Authored-By: Claude Opus 4.7 (1M context) --- .../kotlin/com/tt/honeyDue/widget/WidgetDataRepository.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/composeApp/src/androidMain/kotlin/com/tt/honeyDue/widget/WidgetDataRepository.kt b/composeApp/src/androidMain/kotlin/com/tt/honeyDue/widget/WidgetDataRepository.kt index cd7c00d..133fe57 100644 --- a/composeApp/src/androidMain/kotlin/com/tt/honeyDue/widget/WidgetDataRepository.kt +++ b/composeApp/src/androidMain/kotlin/com/tt/honeyDue/widget/WidgetDataRepository.kt @@ -129,6 +129,10 @@ class WidgetDataRepository internal constructor(private val context: Context) { store.writePendingCompletionIds(current) } + /** Whether a task id is currently queued for optimistic completion. */ + suspend fun isPendingCompletion(taskId: Long): Boolean = + taskId in store.readPendingCompletionIds() + /** * Compute the three summary counters shown on the widget: * - overdueCount — tasks with `isOverdue == true`