Skip to content

Conversation

@WizCoderr
Copy link
Contributor

@WizCoderr WizCoderr commented Oct 30, 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 notifications screen with pull-to-refresh capability
    • Display notification read/unread status with visual differentiation
    • Show timestamps and allow dismissing individual notifications
    • Automatically clean up old notifications on app startup
    • Monitor network connectivity for improved reliability

@coderabbitai
Copy link

coderabbitai bot commented Oct 30, 2025

Walkthrough

Added a new notification feature module implementing UI presentation layer with composables for screen layout, content list, and individual items; ViewModel providing state management with network monitoring and notification operations; and type-safe navigation helpers for routing integration.

Changes

Cohort / File(s) Summary
UI Composables
feature/notification/src/commonMain/kotlin/org/mifos/mobile/feature/notification/NotificationScreen.kt
Introduced public entry point NotificationScreen() with default modifier and injected viewModel; added private presentation overload aggregating UI state, network status, and callback wiring; added NotificationContent composable with pull-to-refresh and LazyColumn rendering; added NotificationItem composable displaying notifications with read-state icon tinting and dismiss button; included KDoc documentation for all composables.
State Management
feature/notification/src/commonMain/kotlin/org/mifos/mobile/feature/notification/NotificationViewModel.kt
Added networkMonitor constructor parameter; introduced isNetworkAvailable StateFlow; added loadNotifications(), refreshNotifications(), and dismissNotification() public functions with Loading/Success/Error/Empty state handling; added private sortNotifications() helper for unread-first and recency sorting; introduced NotificationUiState sealed interface with four variants.
Navigation
feature/notification/src/commonMain/kotlin/org/mifos/mobile/feature/notification/navigation/NotificationNavigation.kt
Added NavController.navigateToNotificationScreen() extension for type-safe navigation delegation; added NavGraphBuilder.notificationDestination() extension defining route destination with composableWithPushTransitions and callback wiring; included KDoc for both extensions.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Screen as NotificationScreen
    participant ViewModel as NotificationViewModel
    participant Repo as NotificationRepository
    participant Network as NetworkMonitor

    User->>Screen: Navigate to Notifications
    Screen->>ViewModel: Observe uiState & isNetworkAvailable
    ViewModel->>Network: Check network status
    Network-->>ViewModel: isNetworkAvailable: Boolean
    ViewModel->>Repo: loadNotifications()
    Repo-->>ViewModel: Notifications list
    ViewModel->>ViewModel: sortNotifications()
    ViewModel-->>Screen: emit Success(notifications)
    Screen->>Screen: Render NotificationContent
    
    User->>Screen: Pull to refresh
    Screen->>ViewModel: refreshNotifications()
    ViewModel->>ViewModel: emit Loading
    ViewModel->>Repo: loadNotifications()
    Repo-->>ViewModel: Updated list
    ViewModel-->>Screen: emit Success(notifications)
    
    User->>Screen: Dismiss notification (OK button)
    Screen->>ViewModel: dismissNotification(notification)
    ViewModel->>Repo: Mark as read
    Repo-->>ViewModel: Update state
    ViewModel-->>Screen: Updated uiState
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

  • NotificationScreen.kt: Review composable hierarchy, state observation flow, and proper integration of three nested composables with LazyColumn and pull-to-refresh implementation
  • NotificationViewModel.kt: Validate state machine transitions (Loading → Success/Error/Empty), sorting logic, notification dismissal flow, and network status observation setup
  • NotificationNavigation.kt: Verify type-safe navigation delegation pattern and route configuration consistency with composableWithPushTransitions

Poem

🐰 Notifications hop into view,
With lists refreshing, network status true,
Unread first, timestamps aligned,
A rabbit's touch—organized and refined! 🔔✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The PR title "Documentation Done for feature/notification" suggests that the primary work is documentation or commenting code. However, the actual changeset includes substantial code implementation and refactoring work: new composables (NotificationContent, NotificationItem), significant NotificationViewModel modifications (new functions, properties, sealed interface), and navigation helper extensions. While KDoc documentation blocks were added as part of these changes, they are supporting elements rather than the main purpose. The title misrepresents the scope and nature of the work by emphasizing documentation over the actual code implementation and architectural changes. Revise the title to accurately reflect the main changes, such as "Implement notification screen composables and refactor ViewModel" or "Build NotificationScreen UI components with enhanced ViewModel logic and navigation helpers." This will better communicate to reviewers and developers scanning history that the PR contains significant code implementation and architectural changes, not primarily documentation work.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 70c39c6 and c3c932c.

📒 Files selected for processing (3)
  • feature/notification/src/commonMain/kotlin/org/mifos/mobile/feature/notification/NotificationScreen.kt (4 hunks)
  • feature/notification/src/commonMain/kotlin/org/mifos/mobile/feature/notification/NotificationViewModel.kt (4 hunks)
  • feature/notification/src/commonMain/kotlin/org/mifos/mobile/feature/notification/navigation/NotificationNavigation.kt (1 hunks)

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.

@therajanmaurya therajanmaurya merged commit 3af50cd into openMF:development Oct 31, 2025
8 checks passed
@WizCoderr WizCoderr deleted the MM-436 branch October 31, 2025 17:13
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