Skip to content

feat: home widget for android#2051

Open
Nagarjuna0033 wants to merge 6 commits into
openMF:devfrom
Nagarjuna0033:feat/home-widget
Open

feat: home widget for android#2051
Nagarjuna0033 wants to merge 6 commits into
openMF:devfrom
Nagarjuna0033:feat/home-widget

Conversation

@Nagarjuna0033

@Nagarjuna0033 Nagarjuna0033 commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Jira Task: 420

Screenshot 2026-06-14 at 10 50 12 PM Screenshot 2026-06-14 at 10 50 48 PM Screenshot 2026-06-15 at 10 19 00 AM Screenshot 2026-06-15 at 10 19 42 AM Screenshot 2026-06-15 at 10 20 06 AM Screenshot 2026-06-15 at 10 20 38 AM

Note: Implemented for android

Summary by CodeRabbit

Release Notes

New Features

  • Added a home-screen Finance widget showing balance/budget status with quick actions (add income/expense, open dashboard).
  • Enabled deep links via the mifospay:// URI scheme to route users to dashboard and transaction flows.
  • Implemented background widget syncing with periodic refresh and widget state rendering for unauthenticated, error, and authenticated users.

Bug Fixes

  • Improved logout flow to clear widget-related data.
  • Ensured transfers and login success trigger widget refresh so displayed values stay up to date.

@Nagarjuna0033 Nagarjuna0033 requested a review from a team June 16, 2026 03:53
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds an Android Glance home-screen finance widget that displays account balance and quick-action deep links, backed by a new multiplatform widget data/state layer, WorkManager-based periodic refresh via Koin, and a deferred deep-link capture and navigation system for the mifospay:// URI scheme.

Changes

Android Finance Widget and Deep-Link Routing

Layer / File(s) Summary
Widget data model, state, and interface contracts
core/model/.../widget/WidgetData.kt, cmp-shared/.../widget/WidgetState.kt, cmp-shared/.../widget/WidgetDataProvider.kt, cmp-shared/.../widget/WidgetDataProviderImpl.kt, core/data/.../repository/WidgetManagerRepository.kt, core/data/.../repository/WidgetRepository.kt, core/data/.../util/WidgetSyncService.kt
Introduces WidgetData (serializable, with budget computed properties), WidgetState sealed interface (Unauthenticated/Authenticated/Error), WidgetDataProvider interface and its combine-based implementation, plus WidgetManagerRepository, WidgetRepository, and WidgetSyncService contracts.
Widget persistence and dependency wiring
core/datastore/.../WidgetPreferenceDataSource.kt, core/datastore/.../di/PreferenceModule.kt, core/datastore/.../UserPreferencesDataSource.kt, core/data/.../di/RepositoryModule.kt, core/data/.../repositoryImpl/WidgetManagerRepositoryImpl.kt, core/data/.../repositoryImpl/WidgetRepositoryImpl.kt, cmp-shared/.../di/KoinModules.kt
Adds WidgetPreferenceDataSource backed by Settings, implements WidgetRepositoryImpl (enriches stored data with live account balance) and WidgetManagerRepositoryImpl, registers all new Koin bindings, and resets in-memory state flows on clearInfo().
Multiplatform deep-link capture and routing
cmp-shared/src/commonMain/.../MifosPayApp.kt, cmp-shared/src/androidMain/.../MifosPayApp.android.kt, cmp-shared/src/nonAndroidMain/.../MifosPayApp.nonAndroid.kt, cmp-shared/src/commonMain/.../navigation/PendingDeepLinkStore.kt, cmp-shared/src/androidMain/.../navigation/PendingDeepLinkStore.android.kt, cmp-shared/src/nonAndroidMain/.../navigation/PendingDeepLinkStore.nonAndroid.kt, cmp-shared/src/commonMain/.../navigation/ConsumePendingDeepLink.kt, cmp-shared/src/androidMain/.../navigation/ConsumePendingDeepLink.android.kt, cmp-shared/src/nonAndroidMain/.../navigation/ConsumePendingDeepLink.nonAndroid.kt, cmp-shared/.../navigation/RootNavGraph.kt, feature/home/.../navigation/HomeNavigation.kt, cmp-android/.../MainActivity.kt, cmp-android/src/main/AndroidManifest.xml, cmp-android/.../widget/WidgetDeepLink.kt
Adds expect/actual HandleDeepLinks composable, PendingDeepLinkStore for in-memory URI bridging, consumePendingDeepLink wired into MAIN_GRAPH entry via LaunchedEffect, mifospay://dashboard deep link on the home route, onNewIntent override on MainActivity, the VIEW/BROWSABLE intent-filter on MainActivity in the manifest, and WidgetDeepLink constants for widget-triggered URIs.
Finance widget UI and action intents
cmp-android/.../widget/FinanceGlanceWidget.kt, cmp-android/.../widget/ui/Actions.kt, cmp-android/.../widget/ui/WidgetAction.kt, cmp-android/src/main/res/values/strings.xml, cmp-android/src/main/res/xml/finance_widget_info.xml
Implements the full Glance widget with unauthenticated, error, full (with income/expense CTAs), and compact layouts driven by WidgetState; adds AddIncomeAction, AddExpenseAction, OpenDashboardAction callbacks; defines WidgetAction enum backed by WidgetDeepLink URIs; and provides the widget provider XML and description string resource.
Android widget runtime wiring and scheduling
cmp-android/build.gradle.kts, cmp-android/.../widget/AndroidWidgetModule.kt, cmp-android/.../widget/AndroidWidgetSyncService.kt, cmp-android/.../widget/WidgetRefreshWorker.kt, cmp-android/.../widget/FinanceWidgetReceiver.kt, cmp-android/.../MifosPayApp.kt, cmp-android/src/main/AndroidManifest.xml, cmp-android/dependencies/*, cmp-shared/src/iosMain/kotlin/MifosViewController.kt
Adds Glance, WorkManager, and Koin-workmanager dependencies; wires AndroidWidgetSyncService via androidWidgetModule; implements WidgetRefreshWorker (15-min periodic, network-constrained) with KoinWorkerFactory; adds FinanceWidgetReceiver lifecycle hooks; updates MifosPayApp to implement Configuration.Provider and enqueue an initial one-time refresh; registers InitializationProvider and widget receiver in the manifest; and reformats iOS locale call.
Widget refresh on app and account events
core/domain/.../LoginUseCase.kt, core/domain/.../di/DomainModule.kt, cmp-shared/.../MifosPayViewModel.kt, feature/make-transfer/.../MakeTransferViewModel.kt, feature/transfer-interbank/.../InterbankTransferViewModel.kt, feature/transfer-intrabank/.../confirm/TransferConfirmViewModel.kt
Injects WidgetManagerRepository into LoginUseCase, MifosPayViewModel, and three transfer ViewModels; calls refresh() after successful login and all transfer types; calls clear() during logout.
sequenceDiagram
  participant Widget as FinanceWidgetReceiver
  participant MifosPayApp
  participant WidgetManagerRepository
  participant AndroidWidgetSyncService
  participant WidgetRefreshWorker
  participant FinanceGlanceWidget
  participant PendingDeepLinkStore
  participant NavHostController

  MifosPayApp->>WidgetManagerRepository: schedule()
  WidgetManagerRepository->>AndroidWidgetSyncService: schedulePeriodicSync()
  AndroidWidgetSyncService->>WidgetRefreshWorker: schedule(context)

  Note over WidgetRefreshWorker: every 15 min (network connected)
  WidgetRefreshWorker->>WidgetManagerRepository: refresh()
  WidgetManagerRepository->>AndroidWidgetSyncService: refreshWidget()
  AndroidWidgetSyncService->>FinanceGlanceWidget: update(context, glanceId)

  Note over FinanceGlanceWidget: user taps widget action
  FinanceGlanceWidget->>PendingDeepLinkStore: ACTION_VIEW intent (mifospay://...)
  PendingDeepLinkStore->>NavHostController: handleDeepLink(intent)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • revanthkumarJ
  • niyajali

Poem

🐇 Hop hop! A widget blooms on the home screen today,
Balances and budgets displayed in a stylish array.
Deep links like carrots—tap once and you're there,
WorkManager refreshing with seasonal flair.
The rabbit approves: finance in the air! 🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'feat: home widget for android' directly and clearly summarizes the main change—adding a home widget feature for the Android platform.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 15

🧹 Nitpick comments (2)
cmp-shared/src/commonMain/kotlin/org/mifospay/shared/MifosPayViewModel.kt (1)

87-91: ⚡ Quick win

Make logout cleanup resilient to widget-clear failures.

widgetManagerRepository.clear() can interrupt the rest of logout. Ensure lock/passcode cleanup still runs even when widget cleanup fails.

Suggested hardening
     fun logOut() {
         viewModelScope.launch {
             userDataRepository.logOut()
-            widgetManagerRepository.clear()
-            appLockRepository.deleteLock()
-            passcodeManager.logOut()
+            try {
+                widgetManagerRepository.clear()
+            } finally {
+                appLockRepository.deleteLock()
+                passcodeManager.logOut()
+            }
         }
     }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cmp-shared/src/commonMain/kotlin/org/mifospay/shared/MifosPayViewModel.kt`
around lines 87 - 91, The logout cleanup sequence in the viewModelScope.launch
block can fail prematurely if widgetManagerRepository.clear() throws an
exception, preventing appLockRepository.deleteLock() and
passcodeManager.logOut() from executing. Wrap the
widgetManagerRepository.clear() call in a try-catch block to ensure that even if
widget cleanup fails, the remaining lock deletion and passcode logout operations
continue to completion. This guarantees all critical cleanup tasks are attempted
regardless of individual failures.
feature/home/src/commonMain/kotlin/org/mifospay/feature/home/navigation/HomeNavigation.kt (1)

32-36: 🏗️ Heavy lift

Centralize this URI contract in a shared module to prevent drift.

Line 35 hardcodes mifospay://dashboard, while widget actions use WidgetDeepLink constants from Android code. This breaks the “single source of truth” across module boundaries; move URI constants to a common/shared location and reference them here.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@feature/home/src/commonMain/kotlin/org/mifospay/feature/home/navigation/HomeNavigation.kt`
around lines 32 - 36, Extract the hardcoded URI pattern `mifospay://dashboard`
from the navDeepLink uriPattern assignment in the composable navigation block
(where HOME_ROUTE is defined) into a shared module constant. Create or use an
existing shared/common module to define this URI constant as a single source of
truth, ensuring it can be referenced both by this HomeNavigation composable and
by the widget actions that use WidgetDeepLink constants. Replace the hardcoded
string with a reference to this shared constant to maintain consistency across
module boundaries.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmp-android/build.gradle.kts`:
- Around line 137-138: The implementation of koin-android and
koin-androidx-workmanager at lines 137–138 are hardcoded to version 3.5.6,
conflicting with the catalog-managed Koin 4.1.1 already defined at lines
114–117. Replace the two hardcoded implementation calls for koin-android and
koin-androidx-workmanager with their corresponding catalog references
(libs.koin.android and libs.koin.androidx.workmanager) to ensure consistent
versioning across the module and avoid mixed-version dependency conflicts.

In `@cmp-android/src/main/AndroidManifest.xml`:
- Around line 54-61: The intent-filter in the AndroidManifest.xml file currently
accepts any mifospay:// URI without host restrictions due to the <data> element
only specifying the scheme attribute. To tighten security and limit the
deep-link surface, add explicit host restrictions to the <data> element within
the intent-filter by specifying the known widget action hosts (add, expense,
dashboard) using the android:host attribute. Either create separate <data>
elements for each known host or use multiple <data> entries to explicitly define
which hosts are allowed to trigger this intent filter, replacing the overly
permissive wildcard behavior.

In `@cmp-android/src/main/kotlin/org/mifospay/MainActivity.kt`:
- Around line 111-114: In the onNewIntent method of MainActivity.kt, the current
implementation only calls setIntent(intent) which is insufficient for handling
warm-start deep links. You need to explicitly extract and store the URI data
from the incoming intent so the shared deep-link processing pipeline can access
it. After calling setIntent(intent), explicitly capture intent.dataString and
store it in a way that the deep-link handling flow can retrieve and process it
reliably for deep-link navigation.

In `@cmp-android/src/main/kotlin/org/mifospay/MifosPayApp.kt`:
- Around line 47-53: The widget sync is being unconditionally scheduled in the
MifosPayApp class on every app launch via WorkManager.enqueue() with
WidgetRefreshWorker, even when no widget instances exist. This causes
unnecessary work scheduling and can interfere with the FinanceWidgetReceiver
lifecycle which may have disabled periodic syncing. Add a conditional check
before the WorkManager.enqueue() call to verify that at least one widget
instance is placed on the home screen, or alternatively remove this scheduling
entirely and rely solely on FinanceWidgetReceiver to manage all widget work
scheduling through its lifecycle callbacks (onEnabled and onDisabled methods).

In `@cmp-android/src/main/kotlin/org/mifospay/widget/FinanceGlanceWidget.kt`:
- Around line 190-205: The error state message text in the error-state UI
section contains misleading copy that promises a retry option ("Tap to retry or
open the app.") but the associated CTA button only implements
OpenDashboardAction, which opens the app without any retry functionality. Update
the text value on the line with "Tap to retry or open the app." to remove the
reference to retry and only mention opening the app, so the user-facing copy
accurately reflects the single action provided by the button.
- Around line 25-28: Remove the duplicate import of ColorProvider from
androidx.glance.color package, keeping only the correct import from
androidx.glance.unit package. The incorrect import from androidx.glance.color
will cause compilation failures with the ColorProvider(...) usages throughout
the file, so delete the androidx.glance.color.ColorProvider import statement and
retain the androidx.glance.unit.ColorProvider import to resolve the conflict.

In `@cmp-android/src/main/kotlin/org/mifospay/widget/ui/Actions.kt`:
- Around line 15-30: The widget actions AddIncomeAction and AddExpenseAction
emit URIs (mifospay://add and mifospay://expense respectively) that lack
corresponding navigation deep-link registrations, causing them to fail silently
at runtime. Locate the navigation configuration where deep links are registered
(currently only mifospay://dashboard is registered) and add navDeepLink entries
for both the ADD_INCOME URI (mifospay://add) and ADD_EXPENSE URI
(mifospay://expense) to properly route these widget actions to their respective
destinations.

In `@cmp-android/src/main/kotlin/org/mifospay/widget/WidgetDeeplink.kt`:
- Around line 12-13: The KDoc comment for the WidgetDeeplink class incorrectly
states that it lives in the :cmp-shared module when it actually resides in the
:cmp-android module. Update the comment text on lines 12-13 to replace the
reference to :cmp-shared with :cmp-android to accurately reflect the actual
module location and prevent future confusion about dependency organization.

In `@cmp-android/src/main/kotlin/org/mifospay/widget/WidgetRefreshWorker.kt`:
- Around line 35-43: The catch block in WidgetRefreshWorker is catching all
exceptions including CancellationException, and always returns Result.retry()
without respecting the MAX_RETRIES limit, causing indefinite retry loops on
permanent failures. Refactor the exception handling to: (1) rethrow
CancellationException immediately so coroutine cancellations are not swallowed,
(2) implement retry logic that tracks the current attempt number and compares it
against MAX_RETRIES, (3) return Result.retry() only when the retry count is
below MAX_RETRIES, and (4) return Result.failure() when MAX_RETRIES is exceeded.
This ensures cancellations propagate correctly and permanent failures fail fast
instead of retrying indefinitely.

In
`@cmp-shared/src/commonMain/kotlin/org/mifospay/shared/widget/WidgetDataProviderImpl.kt`:
- Around line 32-36: In the WidgetDataProviderImpl.kt file where runCatching is
used with the widgetRepository.getWidgetData() call, modify the onFailure lambda
to explicitly rethrow CancellationException instead of converting it to
WidgetState.Error. Check if the caught exception is an instance of
CancellationException and rethrow it, otherwise return WidgetState.Error for all
other exception types. This ensures coroutine cancellation is not swallowed and
maintains proper structured concurrency behavior.

In
`@cmp-shared/src/iosMain/kotlin/org/mifospay/shared/navigation/consumePendingDeepLink.ios.kt`:
- Around line 5-7: The iOS deep-link pipeline is non-functional because the
consumePendingDeepLink function and PendingDeeplinkStore do not implement the
necessary store/consume mechanics. At
cmp-shared/src/iosMain/kotlin/org/mifospay/shared/navigation/consumePendingDeepLink.ios.kt
lines 5-7, implement the consumePendingDeepLink function body to retrieve the
pending deep-link URI from the store and navigate using the provided
NavHostController, then clear the store after routing. At
cmp-shared/src/iosMain/kotlin/org/mifospay/shared/navigation/PendingDeeplinkStore.ios.kt
lines 4-12, implement the in-memory store, consume, and clear functions to match
the common expect contract, storing the pending URI in a mutable variable and
providing getters/setters/clear operations that the consume function can
retrieve and process.

In
`@core/data/src/commonMain/kotlin/org/mifospay/core/data/repositoryImpl/WidgetRepositoryImpl.kt`:
- Around line 50-51: The code in WidgetRepositoryImpl.kt is throwing an
exception when the accounts fetch returns DataState.Error, which makes widget
enrichment a critical failure. This should be non-critical—when accounts
enrichment fails, the function should return the cached/persisted widgetData
instead. Remove the line that throws accounts.exception when accounts is
DataState.Error, and rely on the existing check for accounts !is
DataState.Success to handle all non-success cases (including errors) by
returning the cached widgetData.

In
`@core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/di/PreferenceModule.kt`:
- Around line 66-71: The WidgetPreferencesDataSource registration uses factory
scope, which creates a new instance each time it is injected, resulting in
multiple independent StateFlow streams. Change the factory block to a single
block to ensure WidgetPreferencesDataSource is instantiated once and shared
across all consumers, maintaining a single shared state stream that all readers
and writers observe.

In
`@feature/make-transfer/src/commonMain/kotlin/org/mifospay/feature/make/transfer/MakeTransferViewModel.kt`:
- Around line 192-193: In
feature/make-transfer/src/commonMain/kotlin/org/mifospay/feature/make/transfer/MakeTransferViewModel.kt
at lines 192-193, replace the detached viewModelScope.launch call with
widgetManagerRepository.refresh() executed inline before
sendEvent(MakeTransferEvent.OnTransferSuccess), and wrap the refresh call with
runCatching or try-catch to ensure widget refresh exceptions do not break the
transfer success UX. In
feature/transfer-interbank/src/commonMain/kotlin/org/mifospay/feature/transfer/interbank/InterbankTransferViewModel.kt
at lines 367-370, remove the detached launch and execute
widgetManagerRepository.refresh() inline before the success event emission,
protecting it with runCatching or try-catch for failure isolation. In
feature/transfer-intrabank/src/commonMain/kotlin/org/mifospay/feature/transfer/intrabank/confirm/TransferConfirmViewModel.kt
at line 343, add failure isolation by wrapping the existing inline
widgetManagerRepository.refresh() call with runCatching or try-catch so
exceptions cannot interrupt post-transfer success handling.

In `@gradle/libs.versions.toml`:
- Line 140: In gradle/libs.versions.toml, there are two separate aliases
referencing the same androidx.compose.runtime:runtime module with inconsistent
version strategies: the androidx-compose-runtime alias lacks version control
while the androidx-runtime alias explicitly specifies version 1.11.2 via
version.ref. Consolidate these into a single alias by removing one of them
(keeping the one with explicit version control via version.ref) and updating all
references to use the single unified alias throughout the gradle configuration
files to ensure consistent version management and eliminate the risk of version
mismatches.

---

Nitpick comments:
In `@cmp-shared/src/commonMain/kotlin/org/mifospay/shared/MifosPayViewModel.kt`:
- Around line 87-91: The logout cleanup sequence in the viewModelScope.launch
block can fail prematurely if widgetManagerRepository.clear() throws an
exception, preventing appLockRepository.deleteLock() and
passcodeManager.logOut() from executing. Wrap the
widgetManagerRepository.clear() call in a try-catch block to ensure that even if
widget cleanup fails, the remaining lock deletion and passcode logout operations
continue to completion. This guarantees all critical cleanup tasks are attempted
regardless of individual failures.

In
`@feature/home/src/commonMain/kotlin/org/mifospay/feature/home/navigation/HomeNavigation.kt`:
- Around line 32-36: Extract the hardcoded URI pattern `mifospay://dashboard`
from the navDeepLink uriPattern assignment in the composable navigation block
(where HOME_ROUTE is defined) into a shared module constant. Create or use an
existing shared/common module to define this URI constant as a single source of
truth, ensuring it can be referenced both by this HomeNavigation composable and
by the widget actions that use WidgetDeepLink constants. Replace the hardcoded
string with a reference to this shared constant to maintain consistency across
module boundaries.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ca0ee879-b4ed-445a-8365-89c6d91d551a

📥 Commits

Reviewing files that changed from the base of the PR and between a518db7 and d98b71f.

📒 Files selected for processing (47)
  • cmp-android/build.gradle.kts
  • cmp-android/src/main/AndroidManifest.xml
  • cmp-android/src/main/kotlin/org/mifospay/MainActivity.kt
  • cmp-android/src/main/kotlin/org/mifospay/MifosPayApp.kt
  • cmp-android/src/main/kotlin/org/mifospay/widget/AndroidWidgetModule.kt
  • cmp-android/src/main/kotlin/org/mifospay/widget/AndroidWidgetSyncService.kt
  • cmp-android/src/main/kotlin/org/mifospay/widget/FinanceGlanceWidget.kt
  • cmp-android/src/main/kotlin/org/mifospay/widget/FinanceWidgetReceiver.kt
  • cmp-android/src/main/kotlin/org/mifospay/widget/WidgetDeeplink.kt
  • cmp-android/src/main/kotlin/org/mifospay/widget/WidgetRefreshWorker.kt
  • cmp-android/src/main/kotlin/org/mifospay/widget/ui/Actions.kt
  • cmp-android/src/main/kotlin/org/mifospay/widget/ui/WidgetAction.kt
  • cmp-android/src/main/res/values/strings.xml
  • cmp-android/src/main/res/xml/finance_widget_info.xml
  • cmp-shared/src/androidMain/kotlin/org/mifospay/shared/MifosPayApp.android.kt
  • cmp-shared/src/androidMain/kotlin/org/mifospay/shared/navigation/PendingDeeplinkStore.android.kt
  • cmp-shared/src/androidMain/kotlin/org/mifospay/shared/navigation/consumePendingDeepLink.android.kt
  • cmp-shared/src/commonMain/kotlin/org/mifospay/shared/MifosPayApp.kt
  • cmp-shared/src/commonMain/kotlin/org/mifospay/shared/MifosPayViewModel.kt
  • cmp-shared/src/commonMain/kotlin/org/mifospay/shared/di/KoinModules.kt
  • cmp-shared/src/commonMain/kotlin/org/mifospay/shared/navigation/PendingDeeplinkStore.kt
  • cmp-shared/src/commonMain/kotlin/org/mifospay/shared/navigation/RootNavGraph.kt
  • cmp-shared/src/commonMain/kotlin/org/mifospay/shared/navigation/consumePendingDeepLink.kt
  • cmp-shared/src/commonMain/kotlin/org/mifospay/shared/widget/WidgetDataProvider.kt
  • cmp-shared/src/commonMain/kotlin/org/mifospay/shared/widget/WidgetDataProviderImpl.kt
  • cmp-shared/src/commonMain/kotlin/org/mifospay/shared/widget/WidgetState.kt
  • cmp-shared/src/iosMain/kotlin/org/mifospay/shared/MifosPayApp.ios.kt
  • cmp-shared/src/iosMain/kotlin/org/mifospay/shared/navigation/PendingDeeplinkStore.ios.kt
  • cmp-shared/src/iosMain/kotlin/org/mifospay/shared/navigation/consumePendingDeepLink.ios.kt
  • core/data/src/commonMain/kotlin/org/mifospay/core/data/di/RepositoryModule.kt
  • core/data/src/commonMain/kotlin/org/mifospay/core/data/mapper/WidgetMapper.kt
  • core/data/src/commonMain/kotlin/org/mifospay/core/data/repository/WidgetManagerRepository.kt
  • core/data/src/commonMain/kotlin/org/mifospay/core/data/repository/WidgetRepository.kt
  • core/data/src/commonMain/kotlin/org/mifospay/core/data/repositoryImpl/WidgetManagerRepositoryImpl.kt
  • core/data/src/commonMain/kotlin/org/mifospay/core/data/repositoryImpl/WidgetRepositoryImpl.kt
  • core/data/src/commonMain/kotlin/org/mifospay/core/data/util/WidgetSyncService.kt
  • core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/UserPreferencesDataSource.kt
  • core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/WidgetPrefernceDataSource.kt
  • core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/di/PreferenceModule.kt
  • core/domain/src/commonMain/kotlin/org/mifospay/core/domain/LoginUseCase.kt
  • core/domain/src/commonMain/kotlin/org/mifospay/core/domain/di/DomainModule.kt
  • core/model/src/commonMain/kotlin/org/mifospay/core/model/widget/WidgetData.kt
  • feature/home/src/commonMain/kotlin/org/mifospay/feature/home/navigation/HomeNavigation.kt
  • feature/make-transfer/src/commonMain/kotlin/org/mifospay/feature/make/transfer/MakeTransferViewModel.kt
  • feature/transfer-interbank/src/commonMain/kotlin/org/mifospay/feature/transfer/interbank/InterbankTransferViewModel.kt
  • feature/transfer-intrabank/src/commonMain/kotlin/org/mifospay/feature/transfer/intrabank/confirm/TransferConfirmViewModel.kt
  • gradle/libs.versions.toml

Comment thread cmp-android/build.gradle.kts
Comment thread cmp-android/src/main/AndroidManifest.xml
Comment thread cmp-android/src/main/kotlin/org/mifospay/MainActivity.kt
Comment thread cmp-android/src/main/kotlin/org/mifospay/MifosPayApp.kt
Comment thread gradle/libs.versions.toml Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmp-android/src/main/kotlin/org/mifospay/widget/FinanceGlanceWidget.kt`:
- Around line 31-40: The function defaultWeight is used multiple times in the
FinanceGlanceWidget class but its import statement is missing. Add the import
for androidx.glance.layout.defaultWeight to the import section at the top of the
file, placing it with the other androidx.glance.layout imports that are already
present (such as fillMaxWidth, height, padding, and width).

In
`@cmp-shared/src/androidMain/kotlin/org/mifospay/shared/navigation/ConsumePendingDeepLink.android.kt`:
- Around line 23-25: The consumePendingDeepLink function irreversibly clears the
URI via PendingDeepLinkStore.consume() but does not handle the case where
navController.handleDeepLink() fails. Capture the return value from the
handleDeepLink() call and check if it returns false, indicating navigation
failure. If navigation fails, re-store the URI string back to
PendingDeepLinkStore using the store() method so the deep link can be retried on
the next app activity cycle.

In
`@cmp-shared/src/nonAndroidMain/kotlin/org/mifospay/shared/MifosPayApp.nonAndroid.kt`:
- Around line 13-14: The HandleDeepLinks function in the nonAndroid
implementation is an empty stub that needs to be completed before release.
Implement this function to properly capture and handle deep links for
iOS/Desktop platforms, mirroring the Android implementation that stores URIs via
HandleDeepLinks() and retrieves them via consumePendingDeepLink(). Additionally,
replace the TODO("Not yet implemented") placeholder in
PendingDeepLinkStore.consume() with a proper implementation that processes
pending deep links on non-Android platforms instead of crashing.

In
`@cmp-shared/src/nonAndroidMain/kotlin/org/mifospay/shared/navigation/PendingDeepLinkStore.nonAndroid.kt`:
- Around line 13-21: The non-Android implementation of PendingDeepLinkStore has
three broken method implementations that violate the expected contract. Add a
private mutable property to hold the pending URI value, then implement the store
function to save the passed URI to this property, the consume function to return
the current URI value and clear it (returning null if none was stored), and the
clear function to reset the property to null. This will ensure the store,
consume-and-clear, and clear operations work correctly as specified in the
shared PendingDeepLinkStore interface.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b8b6f1c6-2943-49b1-8d9c-c5fc3e28b524

📥 Commits

Reviewing files that changed from the base of the PR and between d98b71f and c67c6e8.

📒 Files selected for processing (36)
  • cmp-android/src/main/kotlin/org/mifospay/MainActivity.kt
  • cmp-android/src/main/kotlin/org/mifospay/MifosPayApp.kt
  • cmp-android/src/main/kotlin/org/mifospay/widget/AndroidWidgetModule.kt
  • cmp-android/src/main/kotlin/org/mifospay/widget/AndroidWidgetSyncService.kt
  • cmp-android/src/main/kotlin/org/mifospay/widget/FinanceGlanceWidget.kt
  • cmp-android/src/main/kotlin/org/mifospay/widget/FinanceWidgetReceiver.kt
  • cmp-android/src/main/kotlin/org/mifospay/widget/WidgetDeepLink.kt
  • cmp-android/src/main/kotlin/org/mifospay/widget/WidgetRefreshWorker.kt
  • cmp-android/src/main/kotlin/org/mifospay/widget/ui/Actions.kt
  • cmp-android/src/main/kotlin/org/mifospay/widget/ui/WidgetAction.kt
  • cmp-android/src/main/res/xml/finance_widget_info.xml
  • cmp-shared/src/androidMain/kotlin/org/mifospay/shared/MifosPayApp.android.kt
  • cmp-shared/src/androidMain/kotlin/org/mifospay/shared/navigation/ConsumePendingDeepLink.android.kt
  • cmp-shared/src/androidMain/kotlin/org/mifospay/shared/navigation/PendingDeepLinkStore.android.kt
  • cmp-shared/src/commonMain/kotlin/org/mifospay/shared/MifosPayApp.kt
  • cmp-shared/src/commonMain/kotlin/org/mifospay/shared/MifosPayViewModel.kt
  • cmp-shared/src/commonMain/kotlin/org/mifospay/shared/navigation/ConsumePendingDeepLink.kt
  • cmp-shared/src/commonMain/kotlin/org/mifospay/shared/navigation/PendingDeepLinkStore.kt
  • cmp-shared/src/commonMain/kotlin/org/mifospay/shared/navigation/RootNavGraph.kt
  • cmp-shared/src/commonMain/kotlin/org/mifospay/shared/widget/WidgetDataProvider.kt
  • cmp-shared/src/commonMain/kotlin/org/mifospay/shared/widget/WidgetDataProviderImpl.kt
  • cmp-shared/src/commonMain/kotlin/org/mifospay/shared/widget/WidgetState.kt
  • cmp-shared/src/iosMain/kotlin/org/mifospay/shared/MifosViewController.kt
  • cmp-shared/src/nonAndroidMain/kotlin/org/mifospay/shared/MifosPayApp.nonAndroid.kt
  • cmp-shared/src/nonAndroidMain/kotlin/org/mifospay/shared/navigation/ConsumePendingDeepLink.nonAndroid.kt
  • cmp-shared/src/nonAndroidMain/kotlin/org/mifospay/shared/navigation/PendingDeepLinkStore.nonAndroid.kt
  • core/data/src/commonMain/kotlin/org/mifospay/core/data/di/RepositoryModule.kt
  • core/data/src/commonMain/kotlin/org/mifospay/core/data/repository/WidgetManagerRepository.kt
  • core/data/src/commonMain/kotlin/org/mifospay/core/data/repository/WidgetRepository.kt
  • core/data/src/commonMain/kotlin/org/mifospay/core/data/repositoryImpl/WidgetManagerRepositoryImpl.kt
  • core/data/src/commonMain/kotlin/org/mifospay/core/data/repositoryImpl/WidgetRepositoryImpl.kt
  • core/data/src/commonMain/kotlin/org/mifospay/core/data/util/WidgetSyncService.kt
  • core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/WidgetPreferenceDataSource.kt
  • core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/di/PreferenceModule.kt
  • core/model/src/commonMain/kotlin/org/mifospay/core/model/widget/WidgetData.kt
  • feature/home/src/commonMain/kotlin/org/mifospay/feature/home/navigation/HomeNavigation.kt
💤 Files with no reviewable changes (3)
  • cmp-android/src/main/kotlin/org/mifospay/MainActivity.kt
  • cmp-shared/src/commonMain/kotlin/org/mifospay/shared/navigation/RootNavGraph.kt
  • cmp-shared/src/commonMain/kotlin/org/mifospay/shared/MifosPayViewModel.kt
✅ Files skipped from review due to trivial changes (1)
  • cmp-shared/src/nonAndroidMain/kotlin/org/mifospay/shared/navigation/ConsumePendingDeepLink.nonAndroid.kt
🚧 Files skipped from review as they are similar to previous changes (20)
  • cmp-android/src/main/res/xml/finance_widget_info.xml
  • feature/home/src/commonMain/kotlin/org/mifospay/feature/home/navigation/HomeNavigation.kt
  • cmp-android/src/main/kotlin/org/mifospay/widget/AndroidWidgetModule.kt
  • cmp-android/src/main/kotlin/org/mifospay/widget/ui/WidgetAction.kt
  • cmp-shared/src/commonMain/kotlin/org/mifospay/shared/widget/WidgetDataProvider.kt
  • core/data/src/commonMain/kotlin/org/mifospay/core/data/repository/WidgetRepository.kt
  • core/data/src/commonMain/kotlin/org/mifospay/core/data/di/RepositoryModule.kt
  • cmp-android/src/main/kotlin/org/mifospay/widget/ui/Actions.kt
  • cmp-android/src/main/kotlin/org/mifospay/widget/FinanceWidgetReceiver.kt
  • core/data/src/commonMain/kotlin/org/mifospay/core/data/util/WidgetSyncService.kt
  • cmp-shared/src/androidMain/kotlin/org/mifospay/shared/MifosPayApp.android.kt
  • cmp-android/src/main/kotlin/org/mifospay/widget/AndroidWidgetSyncService.kt
  • core/model/src/commonMain/kotlin/org/mifospay/core/model/widget/WidgetData.kt
  • core/datastore/src/commonMain/kotlin/org/mifospay/core/datastore/di/PreferenceModule.kt
  • cmp-shared/src/commonMain/kotlin/org/mifospay/shared/MifosPayApp.kt
  • cmp-android/src/main/kotlin/org/mifospay/widget/WidgetRefreshWorker.kt
  • cmp-shared/src/commonMain/kotlin/org/mifospay/shared/widget/WidgetDataProviderImpl.kt
  • core/data/src/commonMain/kotlin/org/mifospay/core/data/repositoryImpl/WidgetRepositoryImpl.kt
  • cmp-android/src/main/kotlin/org/mifospay/MifosPayApp.kt
  • core/data/src/commonMain/kotlin/org/mifospay/core/data/repository/WidgetManagerRepository.kt

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmp-android/dependencies/prodReleaseRuntimeClasspath.txt`:
- Around line 229-230: The resolved classpath snapshot shows WorkManager version
2.10.3 and Koin WorkManager version 4.1.1, but these versions don't match what
is declared in cmp-android/build.gradle.kts (which shows 2.9.1 and 3.5.6
respectively). Update the WorkManager and Koin WorkManager dependency
declarations in cmp-android/build.gradle.kts to match the resolved versions in
the classpath snapshot (2.10.3 and 4.1.1), or if this version bump was
unintentional, regenerate the classpath snapshot to reflect the versions
declared in the gradle file. Ensure the declared versions and resolved snapshot
remain consistent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f64547a2-5cfd-4127-9d46-61b1f0223fca

📥 Commits

Reviewing files that changed from the base of the PR and between 1d06df3 and d18fc52.

📒 Files selected for processing (3)
  • cmp-android/dependencies/prodReleaseRuntimeClasspath.tree.txt
  • cmp-android/dependencies/prodReleaseRuntimeClasspath.txt
  • cmp-shared/src/iosMain/kotlin/MifosViewController.kt
✅ Files skipped from review due to trivial changes (2)
  • cmp-shared/src/iosMain/kotlin/MifosViewController.kt
  • cmp-android/dependencies/prodReleaseRuntimeClasspath.tree.txt

Comment thread cmp-android/dependencies/prodReleaseRuntimeClasspath.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant