feat(settings): allow backfilling missed daily summaries from notification settings (#11821)
Closed
ZY
17d ago+169+169+012345678901234567890123456789-3-3-0123456789
Summary
Resolves #11821.
Users who temporarily had daily summaries disabled or missed historical days had no UI control in the mobile client to trigger a summary generation for a past date, even though the backend endpoint POST /v1/users/daily-summary-settings/test and client helper generateDailySummary({String? date}) in app/lib/backend/http/api/users.dart were fully implemented.
This PR connects the existing functionality to the user-facing settings UI:
- Adds a "Generate Past Summary" control inside
_buildDailySummaryCard()onNotificationsSettingsPage. - Adds a 365-day back date picker modal (
_showGenerateSummaryDatePicker()) with dark theme styling matching Omi design system. - Formats the selected date (
YYYY-MM-DD) and callsgenerateDailySummary(date: formattedDate), providing instant user feedback withAppSnackbar. - Adds hermetic widget coverage in
app/test/widgets/notifications_settings_daily_summary_test.dart.
Changes
app/lib/pages/settings/notifications_settings_page.dart:- Added import
package:omi/utils/alerts/app_snackbar.dart - Added
_isGeneratingSummaryloading state - Added
_showGenerateSummaryDatePicker()handler - Rendered
Generate Past Summaryrow in_buildDailySummaryCard()with loading indicator
- Added import
app/test/widgets/notifications_settings_daily_summary_test.dart:- Added widget test verifying the backfill control renders and opens the date picker
Verification
- Verified widget rendering and date selection logic.
- Checked that direct calls to
generateDailySummary(date: ...)pass validYYYY-MM-DDstrings to/v1/users/daily-summary-settings/test. - Ensured no regression on
NotificationsSettingsLoadingShimmer.
Bounty & Payout Context
- Proposed bounty: $50 per standard backend/settings bug resolution under the contributor program.
- Claiming bounty for issue #11821. I will provide my PayPal email address after merge.
- cc @josancamon19 @kodjima33