Repository navigation
feat: Revamp homepage with Daily Score, Today Tasks, and Goals widgets - #4162
Conversation
- Add Daily Score widget showing task completion rate (0-5 scale) - Add Today Tasks widget displaying top 3 tasks due today with 'Show all' link - Replace single goal with multi-goal widget supporting up to 3 goals - Smart emoji selection for goals based on title keywords (AI-like matching) - Emoji picker available when editing existing goals - Add visual separation between sections with subtle dividers - Update empty tasks message to guide users to Omi or manual creation
There was a problem hiding this comment.
Code Review
This pull request introduces a significant revamp of the homepage, adding new widgets for daily score, today's tasks, and goals. The changes are well-structured, with new widgets encapsulated in their own files. The code is generally clean and follows good practices for state management with Provider.
I've identified a few high-severity issues that should be addressed:
- An incorrect date calculation in the
DailyScoreWidgetthat includes tasks from yesterday. - A potential data inconsistency issue in the
GoalsWidgetwhen syncing goals from the backend. - A misleading UI element in the
GoalsWidgetthat suggests expand/collapse functionality which is not implemented.
Please review the detailed comments for suggestions on how to fix these issues. Overall, this is a great enhancement to the app's home screen.
| return item.dueAt!.isAfter(todayStart.subtract(const Duration(days: 1))) && | ||
| item.dueAt!.isBefore(todayEnd); |
There was a problem hiding this comment.
The logic to filter for "today's tasks" is incorrect. The condition item.dueAt!.isAfter(todayStart.subtract(const Duration(days: 1))) checks if the due date is after midnight of the previous day. This means it will include tasks due yesterday in the calculation for today's score, which seems to contradict the feature's intent of a "Daily Score".
To fix this, the condition should be adjusted to only include tasks that are due on the current day. A robust way to check for a date falling on a specific day is to check if it's not before the start of the day and is before the start of the next day.
| return item.dueAt!.isAfter(todayStart.subtract(const Duration(days: 1))) && | |
| item.dueAt!.isBefore(todayEnd); | |
| return !item.dueAt!.isBefore(todayStart) && | |
| item.dueAt!.isBefore(todayEnd); |
| final existingIndex = _goals.indexWhere((g) => g.id == backendGoal.id); | ||
| if (existingIndex >= 0) { | ||
| _goals[existingIndex] = backendGoal; | ||
| } else if (_goals.isEmpty) { | ||
| _goals.add(backendGoal); | ||
| } |
There was a problem hiding this comment.
There's a potential data inconsistency issue in the _loadGoals method when merging the backendGoal. The current logic only adds the backendGoal if it's not already present AND the local _goals list is empty (else if (_goals.isEmpty)).
This means if the user has existing local goals and a new, different goal is fetched from the backend (e.g., created on another device), it will not be added to the list. This could lead to goals not syncing correctly across devices.
The logic should be updated to add the backendGoal if it's new and there is space available (i.e., less than _maxGoals).
| final existingIndex = _goals.indexWhere((g) => g.id == backendGoal.id); | |
| if (existingIndex >= 0) { | |
| _goals[existingIndex] = backendGoal; | |
| } else if (_goals.isEmpty) { | |
| _goals.add(backendGoal); | |
| } | |
| final existingIndex = _goals.indexWhere((g) => g.id == backendGoal.id); | |
| if (existingIndex >= 0) { | |
| _goals[existingIndex] = backendGoal; | |
| } else if (_goals.length < _maxGoals) { | |
| _goals.add(backendGoal); | |
| } |
| Padding( | ||
| padding: const EdgeInsets.only(left: 8), | ||
| child: Icon( | ||
| _isExpanded ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, | ||
| size: 20, | ||
| color: Colors.white.withOpacity(0.3), | ||
| ), | ||
| ), |
There was a problem hiding this comment.
The _buildGoalItem widget includes an expand/collapse icon (Icons.keyboard_arrow_down), which suggests that the goal item can be expanded to show more details. However, this functionality is not implemented.
The state variable _isExpanded (defined on line 18) is never updated, so the icon always shows the 'down' arrow. Furthermore, tapping anywhere on the goal item, including the icon, triggers the _editGoal function.
This is misleading to the user. To avoid confusion, I recommend removing the icon until the expand/collapse functionality is implemented.
References
- Ensure a UI element's action is consistent with its label to meet user expectations. For instance, a button labeled 'Get App' should open the download link directly rather than triggering a share action.
BasedHardware#4162) ## Summary Revamps the Omi mobile app homepage with new widgets for better task tracking and goal management. ## Changes ### Daily Score Widget - Shows task completion rate as a 0-5 score with semicircular gauge - Grey color when no tasks, yellow/amber scale based on completion - Tap to see score details ### Today Tasks Widget - Displays top 3 tasks due today (including overdue) - 'Show all →' button navigates to full tasks page - Empty state: 'No tasks for today. Ask Omi for more tasks or create manually.' ### Goals Widget (replaces single goal) - Supports up to 3 goals with minimalistic UI - **Smart emoji selection** based on goal title keywords: - '1m users' → 🚀 - 'Read books' → 📚 - 'Run marathon' → 🏃 - 'Save money' → 💰 - etc. - Emoji picker available when editing existing goals - Progress bars with color coding ### Visual Improvements - Subtle divider lines between sections (8% white opacity) - Better spacing/margins for visual separation - Consistent styling across all widgets ## Testing - Tested on iOS Simulator (iPhone 16 Pro) - All widgets render correctly - Task filtering matches tasks page logic - Goals persist locally with emoji mappings
#23233) ## Final merge acceptance — 2026-10-23 Final diff reviewed at `970d03e6e77ed0c65a2a97b9e77eab47660f6611`. Aryan explicitly accepts appropriate simulator/local integration evidence for Omi; the earlier physical-only merge prerequisites below are superseded, not represented as completed physical testing. - Fresh focused run on this head: **45 tests passed**, including startup/provider admission, account/session replacement, callback replacement, coordinator recovery, and paywall navigation. Command: `cd app && flutter test --no-pub --concurrency 1 --reporter expanded test/providers/sync_provider_background_admission_test.dart test/providers/sync_provider_startup_reconciliation_test.dart test/providers/sync_provider_session_generation_test.dart test/services/wals/recording_transfer_coordinator_test.dart test/widgets/trial_paywall_navigation_test.dart`. - **Installed iPhone 16 Pro simulator / iOS 26.5 component-integration run passed all three stages:** persisted synthetic WALs were seeded in process 64239, the host terminated it and verified that PID exited, then relaunched the same app as process 64868. Cold startup surfaced the completed conversation before any new upload; the genuinely queued job retained its handle. Reconnect rediscovered inventory and reset the exhausted local retry budget. A later completed server response surfaced the second conversation and acknowledged only its WAL. - Throughout all stages: **zero upload calls/attempts**, auto-sync opt-out respected, all three original file hashes and capture timestamps unchanged, and transfer-lease refcount returned to zero. The third local recording intentionally remains pending under auto-upload opt-out; no fake all-synced/customer-recovery claim. The production On the Way UI was inspected before/after and driven with Marionette debug controls. - Test composition: unchanged production SyncProvider, RecordingTransferCoordinator, SyncReconciler, LocalWalSync, HTTP/parser, file persistence and native lease bridge. External auth/token I/O, device discovery and loopback server job responses are synthetic; HTTP-header metadata uses the sanctioned local-harness initializer to avoid product telemetry. This is not full shipping-app sign-in/startup, actual STT, BLE, background scheduling/expiration or customer audio recovery. - Build identity: fresh Dart/assets compiled from this head with Flutter 3.44.5/Dart 3.12.2, local_dev/debug isolation. An already-built identical-native simulator shell was reused: `app/ios` and `pubspec.lock` match the previously compiled shell's source; the only pubspec difference is removal of bundled fonts, covered by fresh assets. No new full native-build claim. Simulator BGTaskScheduler scheduling was unavailable, as expected; no physical/background-execution evidence is claimed. - Evidence is retained privately with this maintainer task (phase/result journals, build/test logs, hashes and screenshots). Earlier broad-suite/CI evidence and the explicitly disclosed Siri timing flake in #23380 remain historical; a passing fresh focused run does not erase that record. No production code was modified for this pass. **Merge is separate from release and customer resolution.** Refs #23223 stays open pending release and customer outcome. No deployment, customer-account access, recording deletion or production job mutation is authorized/performed by this verification. Final current-head required checks and approval are rechecked immediately before merge. --- On relaunch, the transfer coordinator can reconcile an uploaded recording while `SyncProvider._admittedWorkGeneration` is still -1: the returned completed conversation is not surfaced, device discovery is skipped, and recovery depends on another upload starting first. Refactoring native keep-alive acquisition alone would also risk admitting an old account after an asynchronous lease wait. The existing coordinator now admits a transfer synchronously before native acquisition. Native lease holds for abandoned bodies do not re-admit work. Reconciliation, discovery, inventory refresh, reconnect retry resets and drains use the admitted account generation. A reconcile pass snapshots its conversation callback with its phone owner, so reattachment cannot deliver an old result into a replacement callback. Auto-sync opt-out remains respected; genuinely queued jobs remain pending with their original handles. Refs #23223. The Discord screenshot (381 recordings / 42 hours / nine almost ready) shows On the Way, not the on-device transcription banner. These are reproduced code defects, not a confirmed diagnosis or recovery of that account's backlog. #22484 is the existing merged missing-handle/poll-order fix; #21999 is a separate open proposal for legacy sequenced jobs and does not establish this account's cause. Validation: - Four regressions fail against unchanged main `a8fdd3889d` and pass after the fix: completed-conversation delivery before a new upload, startup device discovery, account replacement during native acquisition, and callback replacement during a status read. - 41 focused provider/coordinator tests pass. The real provider, coordinator, reconciler and phone WAL owner run against synthetic device/status/persistence boundaries. Completed conversation delivery executes the production HTTP/parser path over a fake HttpClient. The existing On the Way widget renders a pending recording, receives startup completion, renders all synced, and retains the same WAL; queued-job and auto-upload opt-out checks prevent false completion and duplicate sends. - Final full app run: 7,063 passed, four skipped, no failures; the separate opt-in protected spine also passes. All six hermetic mobile journeys pass (23 checks). The final normal pre-push gate passes all 24 selected manifest checks, and the analyzer ratchet passes with the original baseline unchanged. The history-dependent failure-class ratchet explicitly skips this shallow clone; no local full-history coverage is claimed. - The first broad run exposed an existing paywall test tapping the removed `trial_paywall_free` widget; it also failed with all three production sync files restored to unchanged main. A separate test-only commit exercises system back and the actual close control, retaining restore/no-pop/late-completion assertions. All four navigation tests and the final full suite pass; paywall production code is unchanged. - Remote CI on `07ea53ac7898e859f492aa81d4adc257e654f942`, checked 2026-10-23 through Code Review: Dart Analyze & Tests, Android compile/emulator/JVM, metadata, hygiene, formatting and backend merge gate pass; no failed or running checks remain. iOS compile and seeded-journey lanes were skipped; local hermetic journeys above are separate evidence. Cubic reported its review quota exhausted, which is not a completed independent review. - Commands: `TZ=UTC bash app/test.sh`; `(cd app && flutter test test/widgets/trial_paywall_navigation_test.dart)`; `(cd app && flutter test test/providers/sync_provider_background_admission_test.dart test/providers/sync_provider_startup_reconciliation_test.dart test/providers/sync_provider_session_generation_test.dart test/services/wals/recording_transfer_coordinator_test.dart)`; `(cd app && bash scripts/analyze_ratchet.sh)`; `make mobile-verify ARGS="fast --paths app/lib/providers/sync_provider.dart app/lib/services/wals/recording_transfer_coordinator.dart app/lib/services/wals/sync_reconciler.dart"`; `make preflight`. Release and limits: - Needs review/CI, merge and a mobile app release. This change adds no backend API, deployment, firmware, migration, audio deletion or timestamp rewrite. - Public iOS 1.0.570 is confirmed on the App Store on 2026-10-22. Codemagic build #4162 (`1.0.570+1430`, `b859b78f821217c0df0082359cbcf70b6f29987d`) includes #22484 by commit ancestry. The public page does not expose the binary build number, and the customer's installed build is unverified; later TestFlight artifacts are not a public release. - Physical iPhone and customer verification remain: exact app build and private diagnostics must identify the actual pending stage/job outcome; after release verify the queue declines and the corresponding conversations open. No customer account was accessed, audio recovered or production job redriven. Keep #23223 open until the customer outcome is verified. Preserve recordings and app data meanwhile. - Architecture and implementation checklist: `app/docs/offline-sync-stall-recovery.md`, startup transfer admission. ## Product invariants affected - INV-CAP-1: keep the existing capture/custody owner and native lease; change when a scoped recovery pass is admitted, with no audio loss or new pendant-uplink pause. `app/lib/services/capture/OWNERSHIP.md` defines pre-await generation capture and owner-ready recovery. - INV-UI-1 / INV-UI-3 / INV-PERF-1: no layout, copy, palette, new UI controls, UI-isolate audio work or additional poller. Existing queue rendering is exercised headlessly. Failure-Class: FC-sync-gated-on-consumer-trigger UI-Evidence: none -- startup/session wiring only; no widget layout or user-facing copy changes. Existing On the Way transition is tested through the real provider; no physical-device or native-build qualification is claimed. ## Merge verification gate Marked ready for code review on 2026-10-23 at Aryan's request. The former physical-only gate is superseded by the final simulator-first acceptance above; current-commit CI and independent approval still apply. Passing automated CI does not establish recovery of this customer’s recordings. ## 2026-10-23 maintainer review and merge gates Main integration conflict resolved without dropping system-back coverage; pushed c4aa08b. The 45 focused provider/coordinator/navigation tests, analyzer ratchet, 24 selected preflight checks and 23 hermetic cases across six mobile journeys pass. The bounded full Flutter run completed with 7,123 passed, 9 skipped and one failure in the unchanged Siri cooldown timing test. That file and service match main; its isolated suite then passed all 28 tests. This is not a green full-suite claim: the timing failure is tracked in #23380. Exact-head GitHub checks were green at the final review snapshot. The former installed-phone prerequisite is superseded by the final simulator-first acceptance above. Customer-specific verification remains post-release follow-up, not a claim of recovery. No recordings, customer account, or production jobs were changed. Current main was merged again in 970d03e (docs-only conflict).
Summary
Revamps the Omi mobile app homepage with new widgets for better task tracking and goal management.
Changes
Daily Score Widget
Today Tasks Widget
Goals Widget (replaces single goal)
Visual Improvements
Testing