Repository navigation
Conversation
…e#11821) Added functionality to generate daily summaries for past dates with a date picker.
This test verifies that the NotificationsSettingsPage displays the 'Generate Past Summary' button and that tapping it opens the date picker dialog.
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks @Zyphawk — this fills a real gap from #11821. With the orphaned DailySummarySettingsPage removed from main (e1cd2ef), NotificationsSettingsPage is the right home for this control, and reusing the existing generateDailySummary({String? date}) helper keeps the change small. The tap-guarded loading state (onTap: _isGeneratingSummary ? null : ...), the finally reset, and the mounted checks around the snackbars are all done properly.
Requesting changes for one blocking issue in the added test, plus a few smaller notes.
app/test/widgets/notifications_settings_daily_summary_test.dart — the test cannot pass as written
NotificationsSettingsPage.buildreadscontext.l10n(app bar title, section headers), and the generatedAppLocalizations.of(context)non-null-asserts. The pumpedMaterialAppprovides nolocalizationsDelegates, so the first build throws before the row can render. The repo convention (e.g.app/test/widgets/sync_error_card_test.dart) is:
MaterialApp(
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
...
)-
initStatecalls_loadSettings(), andgetDailySummarySettings()builds'${Env.apiBaseUrl}v1/...'whereEnv._instanceis astatic late final— withoutEnv.init(...)this surfaces as an unhandledLateInitializationError.app/test/widgets/daily_summary_card_test.dartshows the pattern:setUpAll(() => Env.init(_TestEnvFields())). -
The
if (generateText.evaluate().isNotEmpty)guard makes the test vacuous — if the row regresses and stops rendering, the test silently passes. Once (1) and (2) are fixed, please drop the conditional so the assertions actually bind.
Worth noting: the Flutter suite hasn't run on this PR's head yet, so CI didn't catch this — it will once the suite runs.
app/lib/pages/settings/notifications_settings_page.dart — non-blocking notes
'Generate Past Summary', the pickerhelpText, and the snackbar strings are hardcoded English, while every other label on this page goes throughcontext.l10n(enable,deliveryTime,dailySummary, …). Please route them throughAppLocalizations(or call it out as an immediate follow-up).- The new row is enabled even when the Daily Summary toggle is off, whereas the time row dims (
AnimatedOpacity+_showHourPickerearly-return). Backfill-while-disabled is arguably exactly the #11821 scenario, so this may be intentional — just flagging the inconsistency. lastDate: nowlets users generate today's (partial) summary — the backend handles partial days, just confirming that's intended.
The production wiring itself looks correct; the fixes are contained to the test setup plus the l10n pass. Happy to re-review once pushed.
🤖 Automated review on behalf of the maintainers.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
|
Thanks for the thorough review @Git-on-my-level! I have updated the PR with all requested changes:
Regarding the non-blocking notes:
Ready for re-review! |
kodjima33
left a comment
There was a problem hiding this comment.
Mobile feature (feat title, not a bug fix) wiring the existing backend daily-summary backfill endpoint into a new settings UI control. Production wiring looks reasonable per Git-on-my-level's review, but there's an active unresolved CHANGES_REQUESTED: the new widget test cannot pass as written (missing AppLocalizations delegates, missing Env.init, and a vacuous conditional assertion), plus hardcoded English strings where the page otherwise uses l10n. feat(...) defaults to approve-only per policy regardless of score; not merging given the known-broken test and open CR. Confidence n/a (feature).
Refactor test environment and improve widget tests for NotificationsSettingsPage.
Added savedNotificationFrequency to track changes and updated logic for syncing notification settings with backend. Improved error handling for daily summary settings.
|
I have pushed the updated fix following the repository's robust test harness patterns:
Please re-review and approve/dismiss the previous |
kodjima33
left a comment
There was a problem hiding this comment.
Mobile feature (feat title), approve-only per policy regardless of score. New commits landed since last approval (sha changed); Git-on-my-level's CHANGES_REQUESTED (broken widget test: missing AppLocalizations delegates/Env.init, vacuous assertion; hardcoded English strings) is still open at an earlier sha and not confirmed resolved by the new commits. Not merging.
kodjima33
left a comment
There was a problem hiding this comment.
Feature (backfill missed daily summaries UI control) — approve-only per policy regardless of score.
kodjima33
left a comment
There was a problem hiding this comment.
Feature (backfill missed daily summaries UI control) — approve-only per policy regardless of score.
|
Hey @Zyphawk 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
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/testand client helpergenerateDailySummary({String? date})inapp/lib/backend/http/api/users.dartwere fully implemented.This PR connects the existing functionality to the user-facing settings UI:
_buildDailySummaryCard()onNotificationsSettingsPage._showGenerateSummaryDatePicker()) with dark theme styling matching Omi design system.YYYY-MM-DD) and callsgenerateDailySummary(date: formattedDate), providing instant user feedback withAppSnackbar.app/test/widgets/notifications_settings_daily_summary_test.dart.Changes
app/lib/pages/settings/notifications_settings_page.dart:package:omi/utils/alerts/app_snackbar.dart_isGeneratingSummaryloading state_showGenerateSummaryDatePicker()handlerGenerate Past Summaryrow in_buildDailySummaryCard()with loading indicatorapp/test/widgets/notifications_settings_daily_summary_test.dart:Verification
generateDailySummary(date: ...)pass validYYYY-MM-DDstrings to/v1/users/daily-summary-settings/test.NotificationsSettingsLoadingShimmer.Bounty & Payout Context
covers:masks the orphaned settings page #11821. I will provide my PayPal email address after merge.