docs/android-home-screen-widget.md
Status: Maintained
Last verified: 2026-07-29
The widget displays up to 20 tasks from the app's last snapshot of the Today view and lets the user toggle completion. It is a native projection of Angular state, not an independent task or calendar engine.
WidgetDataService is the only writer of the widget_data JSON
snapshot. The TypeScript contract is
src/app/features/android/android-widget.model.ts.v: 1 shape in
android/app/src/main/java/com/superproductivity/superproductivity/widget/WidgetData.kt.
Unknown versions fail closed to an empty list.WidgetDoneQueue. The renderer overlays
queued target states immediately; Angular later drains, deduplicates, and
applies those intents. Native code must never rewrite the snapshot.The serializer and Kotlin parser are locked to the same golden shape by
android-widget.selectors.spec.ts and WidgetDataTest.kt. Update both ends and
both tests when the contract changes.
Angular supplies dayStr and validUntil. Native code judges staleness only as
now >= validUntil; it must not reproduce logical-day offsets, recurring-task
materialization, overdue carry-over, or virtual TODAY_TAG membership.
The widget reflects the last state produced while the app was able to run. When
the process is dead it cannot create a new day's recurring tasks or receive
cross-client changes. Its 30-minute platform refresh is inexact and may be
deferred by Doze. A pre-validUntil snapshot cannot be classified as stale
until the app writes a current snapshot.
Changes should preserve the single-writer snapshot, queued-intent delivery, logical-day boundary, and post-sync refresh invariants.