Skip to content

Conversation

@WizCoderr
Copy link
Contributor

@WizCoderr WizCoderr commented Oct 27, 2025

Fixes - Jira-#Issue_Number

Didn't create a Jira ticket, click here to create new.

Please Add Screenshots If there are any UI changes.

Before After

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the static analysis check ./gradlew check or ci-prepush.sh to make sure you didn't break anything

  • If you have multiple commits please combine them into one commit by squashing them.

Summary by CodeRabbit

  • New Features
    • Added a Locations screen with map rendering and in-app navigation to access it.
  • Documentation
    • Added descriptive docs for the Locations screen, navigation routes, and map API.
  • Platform Support
    • Provided platform-specific map implementations so the feature adapts across devices.

@coderabbitai
Copy link

coderabbitai bot commented Oct 27, 2025

Walkthrough

Adds a multiplatform RenderMap expect/actual composable and navigation helpers for the locations feature; provides platform-specific RenderMap implementations (Android documented, others no-op) and new navigation routes/extensions.

Changes

Cohort / File(s) Summary
Common API & Docs
feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.kt
Adds expect @Composable fun RenderMap(modifier: Modifier = Modifier) and KDoc for LocationsScreen and RenderMap.
Navigation API & Graph
feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavigation.kt, feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavGraph.kt
Adds route constants LOCATIONS_NAVIGATION_ROUTE_BASE, LOCATIONS_SCREEN_ROUTE, sealed destinations LocationsBase and LocationsScreen, and extension functions NavController.navigateToLocationsScreen(), NavGraphBuilder.locationsNavGraph(), NavGraphBuilder.locationsScreenRoute() with KDoc.
Platform Implementations
feature/location/src/androidMain/.../LocationScreen.android.kt, feature/location/src/desktopMain/.../LocationScreen.desktop.kt, feature/location/src/jsMain/.../LocationScreen.js.kt, feature/location/src/nativeMain/.../LocationScreen.native.kt, feature/location/src/wasmJsMain/.../LocationScreen.wasmJs.kt
Provides actual implementations of RenderMap per platform: Android includes a KDoc describing centering Google Map on Mifos HQ (no behavioral change), desktop/JS/native/wasmJs provide no-op RenderMap implementations with KDoc.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Nav as NavController/NavGraph
    participant Screen as LocationsScreen
    participant Map as RenderMap

    User->>Nav: navigateToLocationsScreen()
    Nav->>Screen: compose LocationsScreen route
    activate Screen
    Screen->>Map: RenderMap(modifier)
    activate Map
    alt Android
        Map->>Map: Android actual — center Google Map on Mifos HQ (doc)
    else Desktop / JS / Native / WasmJs
        Map->>Map: actual implementations are no-op
    end
    deactivate Map
    deactivate Screen
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Areas needing attention:
    • Confirm the expect/actual signatures and default Modifier are consistent across source sets.
    • Verify navigation route names and NavGraph wiring integrate correctly with app routing.
    • Review Android KDoc to ensure it matches implemented behavior if future Android map logic is added.

Poem

🐰 I hopped through code both near and far,
A map for every platform, that's the star.
Routes laid out, a screen that sings,
From Android maps to silent wings.
Hooray — a rabbit's tiny map-making heart! 🗺️

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title Check ❓ Inconclusive The title "Documentation for features/location" is partially related to the changeset, as documentation (KDoc comments) is indeed added throughout the location feature. However, the title is overly vague and does not adequately convey the substantive changes in this PR. Beyond documentation, the changeset introduces significant functional additions including navigation infrastructure (extension functions for NavController and NavGraphBuilder), route constants, platform-specific implementations of a RenderMap composable across multiple platforms (Android, Desktop, JS, Native, WasmJs), and new public APIs. While a developer scanning the PR history would recognize that documentation was added, the title does not meaningfully communicate the architectural setup and multi-platform feature implementation that represent the core purpose of this PR. Consider revising the title to better reflect the primary changes, such as "Set up location feature with navigation and multi-platform map rendering" or "Add location feature navigation infrastructure and platform-specific implementations." This would provide clarity about the architectural setup and multi-platform support being established, which are the main accomplishments of this PR beyond documentation.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.kt (1)

36-51: Fix layout overflow: don’t use fillMaxSize inside Column; use weight with a wrapper.

Current fillMaxSize can push content off-screen. Wrap the map and allocate remaining space.

-        RenderMap(modifier = Modifier.fillMaxSize())
+        Box(
+            modifier = Modifier
+                .weight(1f)
+                .fillMaxWidth()
+        ) {
+            RenderMap(modifier = Modifier.matchParentSize())
+        }

Add import if missing:

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxWidth
feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavGraph.kt (1)

30-37: Use the multiplatform navigation artifact or move this file to androidMain.

This file is in commonMain but imports androidx.navigation.*, which is Android-only. Either:

  • Move LocationNavGraph.kt to androidMain/, or
  • Use the MPP artifact libs.jb-composeNavigation (org.jetbrains.androidx.navigation:navigation-compose) and declare it in the commonMain dependencies of feature/location/build.gradle.kts

The current setup will fail on non-Android targets.

feature/location/src/desktopMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.desktop.kt (1)

8-8: Fix the repository URL typo in the license comment.

The URL contains "mobile-mobile" but should be "mifos-mobile" to match the actual repository name.

Apply this diff:

- * See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
+ * See https://github.com/openMF/mifos-mobile/blob/master/LICENSE.md
feature/location/src/nativeMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.native.kt (1)

8-8: Fix the repository URL typo in the license comment.

The URL contains "mobile-mobile" but should be "mifos-mobile" to match the actual repository name.

Apply this diff:

- * See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
+ * See https://github.com/openMF/mifos-mobile/blob/master/LICENSE.md
feature/location/src/wasmJsMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.wasmJs.kt (1)

8-8: Fix the repository URL typo in the license comment.

The URL contains "mobile-mobile" but should be "mifos-mobile" to match the actual repository name.

Apply this diff:

- * See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
+ * See https://github.com/openMF/mifos-mobile/blob/master/LICENSE.md
🧹 Nitpick comments (4)
feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavGraph.kt (1)

21-23: Avoid stacking multiple copies of LocationsScreen.

Use launchSingleTop and restoreState to dedupe and preserve state on reselect.

 fun NavController.navigateToLocationsScreen() {
-    navigate(LocationsNavigation.LocationsScreen.route)
+    navigate(LocationsNavigation.LocationsScreen.route) {
+        launchSingleTop = true
+        restoreState = true
+    }
 }
feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavigation.kt (1)

13-20: Reduce public API surface: keep sealed class public; make route consts internal.

Prevents consumers from mixing two entry points for the same routes.

-const val LOCATIONS_NAVIGATION_ROUTE_BASE = "locations_base_route"
+internal const val LOCATIONS_NAVIGATION_ROUTE_BASE = "locations_base_route"
-const val LOCATIONS_SCREEN_ROUTE = "locations_screen_route"
+internal const val LOCATIONS_SCREEN_ROUTE = "locations_screen_route"
feature/location/src/androidMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.android.kt (1)

38-42: Localize marker strings.

Use shared string resources instead of hardcoded literals.

-        Marker(
-            state = MarkerState(position = headquarterLatLng),
-            title = "Mifos Initiative",
-            snippet = "Mifos Location",
-        )
+        Marker(
+            state = MarkerState(position = headquarterLatLng),
+            title = stringResource(Res.string.mifos_initiative),
+            snippet = stringResource(Res.string.mifos_location),
+        )

Add these imports:

import org.jetbrains.compose.resources.stringResource
import mifos_mobile.feature.location.generated.resources.Res
feature/location/src/jsMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.js.kt (1)

21-23: Add a lightweight placeholder to avoid blank space on JS.

Show a subtle placeholder so users understand the feature is unsupported on this platform.

@Composable
actual fun RenderMap(modifier: Modifier) {
    // TODO: Replace with a real implementation
    androidx.compose.material3.Text(
        text = "Map is not available on this platform yet.",
        modifier = modifier
    )
}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bc3d86b and 4b1f33f.

📒 Files selected for processing (8)
  • feature/location/src/androidMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.android.kt (1 hunks)
  • feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.kt (2 hunks)
  • feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavGraph.kt (2 hunks)
  • feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavigation.kt (1 hunks)
  • feature/location/src/desktopMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.desktop.kt (1 hunks)
  • feature/location/src/jsMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.js.kt (1 hunks)
  • feature/location/src/nativeMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.native.kt (1 hunks)
  • feature/location/src/wasmJsMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.wasmJs.kt (1 hunks)
🔇 Additional comments (5)
feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavigation.kt (1)

22-35: Sealed destinations look good.
Clear, type-safe routes with data object singletons.

feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.kt (1)

54-61: Expect signature is fine.

Default parameter in expect with actuals omitting default is acceptable for MPP.

feature/location/src/desktopMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.desktop.kt (1)

15-23: LGTM! Desktop no-op implementation is appropriate.

The no-op implementation for the desktop platform is correct for the expect/actual pattern. The KDoc clearly documents the current limitation.

feature/location/src/nativeMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.native.kt (1)

15-23: LGTM! Native no-op implementation is appropriate.

The no-op implementation for the native platform is correct for the expect/actual pattern. The KDoc clearly documents the current limitation.

feature/location/src/wasmJsMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.wasmJs.kt (1)

15-23: LGTM! WasmJs no-op implementation is appropriate.

The no-op implementation for the WasmJs platform is correct for the expect/actual pattern. The KDoc clearly documents the current limitation.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavigation.kt (1)

12-37: Consider enhancing documentation with usage context.

While the current documentation is accurate and follows conventions, it could be more valuable by including brief usage examples or explaining when to use LocationsBase vs LocationsScreen. For instance, mentioning that LocationsBase serves as the navigation graph entry point while LocationsScreen represents the actual screen destination would provide clearer guidance.

Example enhancement:

 /**
- * Base route for the locations feature navigation graph.
+ * Base route for the locations feature navigation graph.
+ * Use this as the starting destination when navigating to the locations feature.
  */
 const val LOCATIONS_NAVIGATION_ROUTE_BASE = "locations_base_route"
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4b1f33f and 7d3d1ef.

📒 Files selected for processing (1)
  • feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavigation.kt (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: PR Checks KMP / Static Analysis Check
🔇 Additional comments (2)
feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/navigation/LocationNavigation.kt (2)

13-21: Documentation added for route constants.

The KDoc comments clearly identify the purpose of each route constant. The documentation is concise and follows standard conventions.


23-37: Well-structured navigation documentation.

The sealed class and its data objects are properly documented with KDoc comments. The use of a sealed class for navigation routes is a sound architectural choice, providing type safety for navigation destinations.

@therajanmaurya therajanmaurya merged commit 70c39c6 into openMF:development Oct 28, 2025
8 checks passed
@WizCoderr WizCoderr deleted the MM-435 branch October 28, 2025 11:50
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.

2 participants