Skip to content

Conversation

@WizCoderr
Copy link
Contributor

@WizCoderr WizCoderr commented Nov 1, 2025

Fixes - Jira-#MM-449
Fixes - Jira-#MM-456
Fixes - Jira-#MM-457

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

Please Add Screenshots If there are any UI changes.

Before After
Screen_recording_20251101_062243.webm

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

    • Filters now open in a bottom sheet for a more natural, focused filtering experience; added "Type" and "Status" labels.
  • Refactor

    • Filter expansion state moved to centralized state management for consistent behavior and persistence across the UI.
  • Style

    • Bottom sheet visuals now use platform-default surface colors and a standardized card/layout for a cleaner, more consistent look.

@coderabbitai
Copy link

coderabbitai bot commented Nov 1, 2025

Walkthrough

This PR centralizes filter expansion state into AccountsState with new toggle actions, moves SavingsAccountFilters from a dialog to a MifosBottomSheet, adds two localized filter labels, and replaces an explicit white bottom sheet container color with the MaterialTheme surface color.

Changes

Cohort / File(s) Summary
Design System Update
core/designsystem/src/commonMain/kotlin/org/mifos/mobile/core/designsystem/component/MifosBottomSheet.kt
Replaced explicit Color.White container color with MaterialTheme.colorScheme.surface; added MaterialTheme import and removed Color import.
Filter UI Refactor
feature/accounts/src/commonMain/kotlin/org/mifos/mobile/feature/accounts/accounts/AccountsScreen.kt
Replaced Scaffold/dialog-based SavingsAccountFilters with MifosBottomSheet; moved expansion state to state.isTypeExpanded/state.isStatusExpanded and dispatches ToggleTypeExpanded/ToggleStatusExpanded; removed local rememberSaveable flags; switched titles to stringResource(...); removed modifier parameter from public AccountScreenContent usage; flattened layout to a single scrollable column.
State & Actions
feature/accounts/src/commonMain/kotlin/org/mifos/mobile/feature/accounts/accounts/AccountsViewModel.kt
Added ToggleTypeExpanded and ToggleStatusExpanded actions; added isTypeExpanded and isStatusExpanded to AccountsState (default true); implemented view model handlers to toggle these flags.
Localization
feature/accounts/src/commonMain/composeResources/values/strings.xml
Added feature_accounts_filter_status ("Status") and feature_accounts_filter_type ("Type") string resources.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI as AccountsScreen
    participant VM as AccountsViewModel
    participant State as AccountsState

    rect rgb(220,235,255)
    note left of UI: Prior (local state)
    User->>UI: Tap filter header
    UI->>UI: Toggle local rememberSaveable flag
    UI->>UI: Recompose
    end

    rect rgb(220,255,225)
    note left of VM: Now (centralized state)
    User->>UI: Tap filter header
    UI->>VM: Dispatch ToggleTypeExpanded / ToggleStatusExpanded
    VM->>VM: Toggle flag
    VM->>State: Emit updated state
    State->>UI: New state observed
    UI->>UI: Recompose with updated expansion
    end

    rect rgb(255,245,210)
    note left of UI: Presentation change
    UI->>UI: Render SavingsAccountFilters inside MifosBottomSheet
    UI->>UI: Resolve labels via stringResource(...)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Pay attention to:
    • correctness of view model handlers and state emission
    • bottom sheet dismissal and lifecycle/persistence implications
    • call sites impacted by removal of modifier parameter on AccountScreenContent
    • string resource availability across targets

Suggested reviewers

  • therajanmaurya

Poem

🐇 I hopped from dialog to sheet so neat,
Filters fold and unfold to a rhythmic beat,
State now lives central, toggles spring bright,
"Type" and "Status" whisper in themed light,
A rabbit applauds—UI feels right! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "Implemented Account Filters in Bottom Sheet (Saving Account, Loan Account, Share Account)" directly aligns with the main objective of the pull request. The changes across the modified files consistently implement account filters using a bottom sheet component (replacing the previous Scaffold-based dialog), with specific handling for the three account types mentioned. The title is specific, concise, and clearly communicates the primary change without vague terminology. A teammate reviewing the repository would immediately understand that this PR adds bottom sheet-based filtering for multiple account types.
✨ 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 058e0d9 and 5640962.

📒 Files selected for processing (1)
  • core/designsystem/src/commonMain/kotlin/org/mifos/mobile/core/designsystem/component/MifosBottomSheet.kt (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • core/designsystem/src/commonMain/kotlin/org/mifos/mobile/core/designsystem/component/MifosBottomSheet.kt
⏰ 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

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: 1

🧹 Nitpick comments (1)
core/designsystem/src/commonMain/kotlin/org/mifos/mobile/core/designsystem/component/MifosBottomSheet.kt (1)

57-57: Use theme colors instead of hardcoded Color.Black.

Hardcoding Color.Black doesn't respect the app's theme and will appear the same in both light and dark modes. Consider using MaterialTheme.colorScheme.surface or another appropriate semantic color from the theme to ensure proper appearance across different theme configurations.

Apply this diff to use a theme-based color:

-            containerColor = Color.Black,
+            containerColor = MaterialTheme.colorScheme.surface,
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 43af85e and f531ea7.

📒 Files selected for processing (4)
  • cmp-android/prodRelease-badging.txt (3 hunks)
  • core/designsystem/src/commonMain/kotlin/org/mifos/mobile/core/designsystem/component/MifosBottomSheet.kt (1 hunks)
  • feature/accounts/src/commonMain/kotlin/org/mifos/mobile/feature/accounts/accounts/AccountsScreen.kt (4 hunks)
  • feature/accounts/src/commonMain/kotlin/org/mifos/mobile/feature/accounts/accounts/AccountsViewModel.kt (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
feature/accounts/src/commonMain/kotlin/org/mifos/mobile/feature/accounts/accounts/AccountsScreen.kt (3)
core/designsystem/src/commonMain/kotlin/org/mifos/mobile/core/designsystem/component/MifosBottomSheet.kt (1)
  • MifosBottomSheet (31-68)
core/ui/src/commonMain/kotlin/org/mifos/mobile/core/ui/component/FiterTopSection.kt (1)
  • FilterTopSection (33-125)
feature/accounts/src/commonMain/kotlin/org/mifos/mobile/feature/accounts/component/FilterSection.kt (1)
  • FilterSection (61-159)
⏰ 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 (3)
feature/accounts/src/commonMain/kotlin/org/mifos/mobile/feature/accounts/accounts/AccountsViewModel.kt (1)

86-87: LGTM! Clean state management implementation.

The expansion state management is well-structured:

  • Actions are properly defined in the sealed interface
  • Handlers follow the established pattern
  • State fields have sensible defaults (expanded by default)
  • Documentation is clear and helpful

Also applies to: 102-114, 250-251, 279-280

feature/accounts/src/commonMain/kotlin/org/mifos/mobile/feature/accounts/accounts/AccountsScreen.kt (1)

197-226: Bottom sheet refactor looks good.

The migration from dialog-based filters to bottom sheet presentation is well-executed:

  • State management properly moved to ViewModel
  • Layout is clean and scrollable
  • Actions are dispatched correctly for expansion toggles
  • Component reuse (FilterSection) follows DRY principles

Note: The AccountScreenContent signature no longer accepts a modifier parameter. Since this is an internal API, this change is acceptable and provides consistency in the bottom bar presentation.

cmp-android/prodRelease-badging.txt (1)

1-126: Auto-generated manifest metadata - no concerns.

This file appears to be auto-generated Android manifest metadata (aapt badging output). The changes reflect standard build configuration updates including version bumps, activity name changes, and locale additions. No review action needed.

@WizCoderr
Copy link
Contributor Author

Screen_recording_20251101_065843.webm

@WizCoderr
Copy link
Contributor Author

Loan Account, Savings Account And Share Account All are Done in this one pr.
Uploading Screen_recording_20251101_070555.webm…

@WizCoderr WizCoderr changed the title Implemented Savings Filter in Bottom Sheet Implemented Account Filters in Bottom Sheet (Saving Account, Loan Account, Share Account) Nov 1, 2025
@therajanmaurya therajanmaurya merged commit 35d7fca into openMF:development Nov 2, 2025
8 checks passed
@WizCoderr WizCoderr deleted the MM-449 branch November 2, 2025 14:02
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