feat(settings): allow backfilling missed daily summaries from notification settings (#11821)

Closed
ZY
17d ago
+169-3

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:

  1. Adds a "Generate Past Summary" control inside _buildDailySummaryCard() on NotificationsSettingsPage.
  2. Adds a 365-day back date picker modal (_showGenerateSummaryDatePicker()) with dark theme styling matching Omi design system.
  3. Formats the selected date (YYYY-MM-DD) and calls generateDailySummary(date: formattedDate), providing instant user feedback with AppSnackbar.
  4. 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 _isGeneratingSummary loading state
    • Added _showGenerateSummaryDatePicker() handler
    • Rendered Generate Past Summary row in _buildDailySummaryCard() with loading indicator
  • 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 valid YYYY-MM-DD strings 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