Skip to content

refactor(feature): replace MaterialTheme with KptTheme#3013

Merged
therajanmaurya merged 5 commits intoopenMF:developmentfrom
biplab1:MM-389-replace-materialtheme-with-kptmaterialtheme
Dec 23, 2025
Merged

refactor(feature): replace MaterialTheme with KptTheme#3013
therajanmaurya merged 5 commits intoopenMF:developmentfrom
biplab1:MM-389-replace-materialtheme-with-kptmaterialtheme

Conversation

@biplab1
Copy link
Contributor

@biplab1 biplab1 commented Dec 16, 2025

Fixes - Jira-#MM-389

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

Summary of changes:

  • Replaced MaterialTheme with KptTheme for Typography and Color Scheme
  • Used KptTheme for shapes, spacing, padding which matched with DesignToken, remaining uses DesignToken
  • Non-standard values have been replaced with DesignToken's custom values
  • New type introduced for strokes in DesignToken.

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

Style

  • Unified theming across the app: migrated components to a single design system for consistent colors, typography, shapes, and spacing.
  • Refined spacing, paddings, dividers and icon/image sizes for improved visual alignment and layout consistency.
  • Introduced additional design tokens (sizes, strokes, shapes, spacings) to enable more consistent UI elements and thinner dividers across screens.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 16, 2025

Walkthrough

Migrates UI theming across many composables from androidx.compose.material3.MaterialTheme to template.core.base.designsystem.theme.KptTheme, replaces hardcoded dp values with DesignToken/KptTheme spacing and size tokens, and adds DesignToken.strokes and size/spacing tokens. No control-flow or public-signature removals; some default parameter values updated.

Changes

Cohort / File(s) Summary
Design system tokens
core/designsystem/src/commonMain/kotlin/org/mifos/mobile/core/designsystem/theme/DesignToken.kt
Adds AppStrokes/LocalStrokes and many new spacing/size/shape/elevation tokens; exposes DesignToken.strokes.
Auth Screens
feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/login/LoginScreen.kt, .../otpAuthentication/OtpAuthenticationScreen.kt, .../recoverPassword/RecoverPasswordScreen.kt, .../registration/RegistrationScreen.kt, .../setNewPassword/SetPasswordScreen.kt, .../uploadId/UploadIdScreen.kt
Replace MaterialTheme usages with KptTheme (colors/typography/shapes); migrate dp/fixed sizes to DesignToken/KptTheme.spacing tokens.
Accounts / Transactions
feature/accounts/src/commonMain/kotlin/org/mifos/mobile/feature/accounts/accountTransactions/TransactionScreen.kt, .../component/FilterSection.kt, feature/accounts/.../accounts/AccountsScreen.kt
Swap theme refs to KptTheme.colorScheme, replace paddings/divider heights with KptTheme.spacing/DesignToken.strokes.thin.
Loan Account & Repayment
feature/loan-account/src/commonMain/kotlin/.../component/AccountSummaryCard.kt, .../component/RepaymentPeriodCard.kt, .../loanAccount/LoanAccountScreen.kt, .../loanAccountDetails/LoanAccountDetailsScreen.kt, .../loanAccountRepaymentSchedule/RepaymentScheduleScreen.kt, .../loanAccountSummary/AccountSummaryScreen.kt
Migrate to KptTheme for colors/typography/shapes; replace sizes with DesignToken.sizes.*; one default param in LoanCardCustom now uses KptTheme.colorScheme.primary.
Loan Application
feature/loan-application/src/commonMain/kotlin/.../component/ConfirmDetailsCard.kt, .../component/LoanCard.kt, .../component/ApplyLoanBottomBar.kt, .../loanApplication/LoanApplyScreen.kt, .../uploadDocs/UploadDocsScreen.kt, .../uploadDocs/component/BottomSheetContent.kt, .../component/TermsAndConditionItem.kt, .../confirmDetails/ConfirmDetailsScreen.kt, .../loanProductDescription/LoanProductDetailsScren.kt, .../loanType/SelectLoanTypeSceen.kt
Broad theming swap to KptTheme; replace spacings/shapes with KptTheme.spacing/KptTheme.shapes and update various sizes to DesignToken.
Beneficiary & Guarantor
feature/beneficiary/.../*, feature/guarantor/.../*
Swap to KptTheme color/spacing/shapes across list, detail, add screens; replace hardcoded paddings with token-based spacing.
Savings, Share & Client Charge
feature/savings-account/.../*, feature/share-account/.../ShareAccountScreen.kt, feature/client-charge/.../*
Replace MaterialTheme with KptTheme; migrate paddings, divider/stroke, icon/text sizes to KptTheme/DesignToken.
Home / Notification / Bottom Sheets
feature/home/src/commonMain/.../HomeScreen.kt, .../components/BottomSheetContent.kt, feature/notification/.../NotificationScreen.kt
Theming and spacing migrated to KptTheme and DesignToken tokens; borders/strokes use DesignToken.strokes.
Passcode / Verify
feature/passcode/.../PasscodeScreen.kt, .../verifyPasscode/VerifyPasscodeScreen.kt
Replace MaterialTheme with KptTheme, migrate many fixed sizes to DesignToken.sizes.*, and use DesignToken.strokes.thin / token shapes for borders.
Recent Transaction, Location, QR & Others
feature/recent-transaction/.../RecentTransactionScreen.kt, feature/location/.../LocationScreen.kt, feature/qr/.../*, feature/qr/src/commonMain/.../QrCodeDisplayScreen.kt, feature/qr/src/androidMain/*, feature/transfer-process/*, feature/third-party-transfer/*, feature/settings/*, feature/notification/*, feature/savings-application/*, feature/share-application/*, feature/status/*, feature/onboarding-language/*, feature/passcode/*
Large set of files uniformly switching theme tokens from MaterialTheme/hardcoded dp to KptTheme and newly added DesignToken tokens (spacing, sizes, shapes, strokes). No logic or public API removals besides styling changes.
Small miscellaneous UI updates
multiple previews and composables across features (e.g., AboutScreen, AppInfoScreen, HelpScreen, LanguageScreen, Settings screens)
Consistent replacement of theme/padding/tokens to KptTheme/DesignToken equivalents; imports cleaned up (remove MaterialTheme/dp).

Sequence Diagram(s)

(omitted — changes are theming/token substitutions, not new multi-component control flows)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • Arinyadav1
  • WizCoderr
  • revanthkumarJ

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.40% 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 'refactor(feature): replace MaterialTheme with KptTheme' accurately and specifically describes the primary change throughout the changeset—a comprehensive replacement of MaterialTheme references with KptTheme equivalents across 50+ feature files and design tokens.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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.

@biplab1 biplab1 marked this pull request as ready for review December 18, 2025 14:53
Copy link
Contributor

@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: 5

Caution

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

⚠️ Outside diff range comments (2)
feature/notification/src/commonMain/kotlin/org/mifos/mobile/feature/notification/NotificationScreen.kt (1)

1-256: Migration is incomplete across the codebase—MaterialTheme usage persists in 200+ files.

While this file correctly uses KptTheme throughout, the verification found extensive remaining MaterialTheme usage across the codebase:

  • Core UI components still reference MaterialTheme.colorScheme, MaterialTheme.typography, and MaterialTheme.shapes directly (e.g., PasswordStrengthIndicator.kt, MifosCard.kt, MifosTopAppBar.kt)
  • Mixed imports of both MaterialTheme and KptTheme exist in core-base/designsystem/src/commonMain/kotlin/template/core/base/designsystem/KptMaterialTheme.kt
  • Hardcoded dimension values (8.dp, 16.dp, 24.dp) remain in 25+ files instead of using DesignToken equivalents

Complete the migration across all remaining modules and libraries before merging.

feature/beneficiary/src/commonMain/kotlin/org/mifos/mobile/feature/beneficiary/beneficiaryDetail/BeneficiaryDetailContent.kt (1)

152-184: KptTheme is not provided in the composition tree — this will cause theme colors to use hardcoded defaults instead of theme values.

The ActionBar function uses KptTheme.colorScheme.primary, but MifosMobileTheme does not provide the required KptTheme composition locals. MifosMobileTheme wraps content in MaterialTheme and DesignTokenTheme, but neither of these provide LocalKptColors, LocalKptTypography, LocalKptShapes, LocalKptSpacing, or LocalKptElevation.

When KptTheme.colorScheme is accessed, it retrieves LocalKptColors.current, which falls back to the hardcoded default KptColorSchemeImpl() instead of using the active theme. This means the Delete and Update button colors will always render with the default purple (Color(0xFF6750A4)) regardless of theme changes.

To fix this, MifosMobileTheme should either:

  • Replace MaterialTheme + DesignTokenTheme with KptMaterialTheme, which provides both Material3 and KPT composition locals, or
  • Wrap the content with the KptTheme composable to provide the necessary KPT composition locals
♻️ Duplicate comments (1)
feature/transfer-process/src/commonMain/kotlin/org/mifos/mobile/feature/transfer/process/transferProcess/TransferProcessScreen.kt (1)

52-52: Verify the KptTheme package name matches project conventions.

Same issue as in MakeTransferScreen.kt: the import uses template.core.base.designsystem.theme.KptTheme instead of matching the project's org.mifos.mobile.* package structure. This appears to be a systematic issue across the theming migration.

🧹 Nitpick comments (9)
feature/guarantor/src/commonMain/kotlin/org/mifos/mobile/feature/guarantor/screens/guarantorAdd/AddGuarantorScreen.kt (1)

190-190: Consider migrating the remaining hardcoded spacing value.

Line 190 still uses a hardcoded 10.dp value for the Spacer height. For consistency with the PR objective of migrating to design tokens, consider replacing this with an appropriate design token (e.g., DesignToken.padding.medium or DesignToken.spacing.small, depending on what's available in your design system).

🔎 Example refactor suggestion:
-        Spacer(modifier = Modifier.height(10.dp))
+        Spacer(modifier = Modifier.height(DesignToken.padding.medium))
feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/component/LoanCard.kt (1)

54-54: Consider migrating remaining hardcoded dimensions to DesignToken.

Several hardcoded dp values remain in the file that could be migrated to design tokens for consistency:

  • Card heights: 128.dp (lines 54, 72) and 140.dp (line 159)
  • Elevation: 6.dp (line 150) - note that line 64 already uses DesignToken.elevation.elevation
  • Corner radii: 16.dp (line 160)

While these might be component-specific values, migrating them to DesignToken would provide better consistency with the PR's objective and make future theme adjustments easier.

Also applies to: 72-72, 150-150, 159-160

feature/qr/src/androidMain/kotlin/org/mifos/mobile/feature/qr/Dialogs.kt (1)

61-61: Consider using a design token for the 6.dp spacing.

For consistency with the design system migration, consider replacing the hardcoded 6.dp vertical spacing with an appropriate design token (e.g., DesignToken.spacing.small or similar, if available).

feature/onboarding-language/src/commonMain/kotlin/org/mifos/mobile/feature/onboarding/language/SetOnboardingLanguageScreen.kt (1)

113-113: Consider using a more semantically appropriate design token.

The image displays the app logo, but the height uses DesignToken.sizes.avatarMedium. While this achieves size standardization, a token like logoMedium or iconLarge would better convey intent. If avatarMedium is intentionally being reused for non-avatar elements, this is fine.

feature/client-charge/src/commonMain/kotlin/org/mifos/mobile/feature/charge/components/ClientChargeItem.kt (1)

122-126: Theme migration complete; consider AppColors consistency.

The error color correctly uses KptTheme.colorScheme.error. Note that AppColors.customEnable (line 123) remains unmigrated. If the goal is full KptTheme adoption, consider whether this custom color should also be sourced from KptTheme.

feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/language/LanguageScreen.kt (1)

41-41: Theme migration applied correctly for unselected state.

The unselected radio button text now uses KptTheme.colorScheme.onSurface, aligning with the design-system migration.

Note: Line 140 uses AppColors.primaryBlue for the selected text style. Consider whether this should also migrate to KptTheme.colorScheme.primary for consistency across the theme.

Also applies to: 139-144

feature/recent-transaction/src/commonMain/kotlin/org/mifos/mobile/feature/recent/transaction/screen/RecentTransactionScreen.kt (2)

355-398: Consider using theme colors for consistency.

While the shape correctly uses DesignToken.shapes.medium, several hardcoded colors remain:

  • Line 361: Color.Gray.copy(alpha = 0.5f) for border
  • Line 362: Color.White for card background
  • Line 388: Color.Black for icon tint
  • Line 398: Color.White for dropdown background

For a complete design system migration, consider using KptTheme.colorScheme equivalents (e.g., outline, surface, onSurface) to ensure proper theming support, especially for dark mode compatibility.


449-472: Consider replacing remaining hardcoded dimensions.

A few hardcoded dimension values remain (40.dp on Line 449, 50.dp and 25.dp on Line 460, 24.dp on Line 472) while most of the file has been migrated to use DesignToken.spacing and DesignToken.padding. For consistency with the design system migration, consider replacing these with appropriate design tokens.

feature/savings-account/src/commonMain/kotlin/org/mifos/mobile/feature/savingsaccount/savingsAccountDetails/SavingsAccountDetailsScreen.kt (1)

386-399: Consider updating the preview to use KptTheme for consistency.

The preview function still wraps content in MifosMobileTheme, while the production code now uses KptTheme. This inconsistency means the design-time preview won't accurately reflect the actual theme used at runtime.

🔎 Consider updating the preview theme wrapper:

If KptTheme should be used directly, update the preview:

 @Preview
 @Composable
 private fun Account_Details_Overview() {
-    MifosMobileTheme {
+    KptTheme {
         Column(modifier = Modifier.fillMaxSize()) {
             SavingsAccountDetailsContent(

Alternatively, verify that MifosMobileTheme internally delegates to KptTheme to maintain consistency.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 153fd20 and 7e10ac7.

📒 Files selected for processing (55)
  • feature/accounts/src/commonMain/kotlin/org/mifos/mobile/feature/accounts/accountTransactions/TransactionScreen.kt (3 hunks)
  • feature/accounts/src/commonMain/kotlin/org/mifos/mobile/feature/accounts/component/FilterSection.kt (4 hunks)
  • feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/login/LoginScreen.kt (6 hunks)
  • feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/otpAuthentication/OtpAuthenticationScreen.kt (7 hunks)
  • feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/recoverPassword/RecoverPasswordScreen.kt (6 hunks)
  • feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/registration/RegistrationScreen.kt (6 hunks)
  • feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/setNewPassword/SetPasswordScreen.kt (4 hunks)
  • feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/uploadId/UploadIdScreen.kt (4 hunks)
  • feature/beneficiary/src/commonMain/kotlin/org/mifos/mobile/feature/beneficiary/beneficiaryApplication/BeneficiaryApplicationContent.kt (2 hunks)
  • feature/beneficiary/src/commonMain/kotlin/org/mifos/mobile/feature/beneficiary/beneficiaryDetail/BeneficiaryDetailContent.kt (3 hunks)
  • feature/beneficiary/src/commonMain/kotlin/org/mifos/mobile/feature/beneficiary/beneficiaryList/BeneficiaryListScreen.kt (6 hunks)
  • feature/client-charge/src/commonMain/kotlin/org/mifos/mobile/feature/charge/chargeDetails/ChargeDetailScreen.kt (5 hunks)
  • feature/client-charge/src/commonMain/kotlin/org/mifos/mobile/feature/charge/components/ClientChargeItem.kt (4 hunks)
  • feature/guarantor/src/commonMain/kotlin/org/mifos/mobile/feature/guarantor/screens/guarantorAdd/AddGuarantorScreen.kt (2 hunks)
  • feature/guarantor/src/commonMain/kotlin/org/mifos/mobile/feature/guarantor/screens/guarantorDetails/GuarantorDetailContent.kt (2 hunks)
  • feature/guarantor/src/commonMain/kotlin/org/mifos/mobile/feature/guarantor/screens/guarantorList/GuarantorListScreen.kt (3 hunks)
  • feature/home/src/commonMain/kotlin/org/mifos/mobile/feature/home/HomeScreen.kt (6 hunks)
  • feature/home/src/commonMain/kotlin/org/mifos/mobile/feature/home/components/BottomSheetContent.kt (5 hunks)
  • feature/loan-account/src/commonMain/kotlin/org/mifos/mobile/feature/loanaccount/component/AccountSummaryCard.kt (5 hunks)
  • feature/loan-account/src/commonMain/kotlin/org/mifos/mobile/feature/loanaccount/component/RepaymentPeriodCard.kt (5 hunks)
  • feature/loan-account/src/commonMain/kotlin/org/mifos/mobile/feature/loanaccount/loanAccount/LoanAccountScreen.kt (3 hunks)
  • feature/loan-account/src/commonMain/kotlin/org/mifos/mobile/feature/loanaccount/loanAccountDetails/LoanAccountDetailsScreen.kt (4 hunks)
  • feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/component/ConfirmDetailsCard.kt (2 hunks)
  • feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/component/LoanCard.kt (7 hunks)
  • feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/loanApplication/LoanApplyScreen.kt (2 hunks)
  • feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/uploadDocs/UploadDocsScreen.kt (2 hunks)
  • feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/uploadDocs/component/BottomSheetContent.kt (4 hunks)
  • feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.kt (2 hunks)
  • feature/notification/src/commonMain/kotlin/org/mifos/mobile/feature/notification/NotificationScreen.kt (4 hunks)
  • feature/onboarding-language/src/commonMain/kotlin/org/mifos/mobile/feature/onboarding/language/SetOnboardingLanguageScreen.kt (5 hunks)
  • feature/passcode/src/commonMain/kotlin/org/mifos/mobile/feature/passcode/PasscodeScreen.kt (8 hunks)
  • feature/passcode/src/commonMain/kotlin/org/mifos/mobile/feature/passcode/verifyPasscode/VerifyPasscodeScreen.kt (7 hunks)
  • feature/qr/src/androidMain/kotlin/org/mifos/mobile/feature/qr/CropContent.kt (3 hunks)
  • feature/qr/src/androidMain/kotlin/org/mifos/mobile/feature/qr/Dialogs.kt (2 hunks)
  • feature/qr/src/commonMain/kotlin/org/mifos/mobile/feature/qr/qrCodeDisplay/QrCodeDisplayScreen.kt (3 hunks)
  • feature/recent-transaction/src/commonMain/kotlin/org/mifos/mobile/feature/recent/transaction/screen/RecentTransactionScreen.kt (15 hunks)
  • feature/savings-account/src/commonMain/kotlin/org/mifos/mobile/feature/savingsaccount/savingsAccount/SavingsAccountScreen.kt (3 hunks)
  • feature/savings-account/src/commonMain/kotlin/org/mifos/mobile/feature/savingsaccount/savingsAccountDetails/SavingsAccountDetailsScreen.kt (6 hunks)
  • feature/savings-account/src/commonMain/kotlin/org/mifos/mobile/feature/savingsaccount/savingsAccountUpdate/AccountUpdateScreen.kt (2 hunks)
  • feature/savings-account/src/commonMain/kotlin/org/mifos/mobile/feature/savingsaccount/savingsAccountWithdraw/AccountWithdrawScreen.kt (3 hunks)
  • feature/savings-application/src/commonMain/kotlin/org/mifos/mobile/feature/savings/application/fillApplication/FillApplicationScreen.kt (4 hunks)
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/about/AboutScreen.kt (3 hunks)
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/appInfo/AppInfoScreen.kt (2 hunks)
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/componenets/MifosLogoutDilaog.kt (3 hunks)
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/faq/FaqScreen.kt (2 hunks)
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/help/HelpScreen.kt (1 hunks)
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/language/LanguageScreen.kt (2 hunks)
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/passcode/UpdatePasscodeScreen.kt (2 hunks)
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/settings/SettingsScreen.kt (4 hunks)
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/theme/ChangeThemeScreen.kt (2 hunks)
  • feature/share-account/src/commonMain/kotlin/org/mifos/mobile/feature/shareaccount/shareAccount/ShareAccountScreen.kt (3 hunks)
  • feature/share-application/src/commonMain/kotlin/org/mifos/mobile/feature/share/application/fillApplication/FillApplicationScreen.kt (4 hunks)
  • feature/third-party-transfer/src/commonMain/kotlin/org/mifos/mobile/feature/third/party/transfer/thirdPartyTransfer/TptScreen.kt (6 hunks)
  • feature/transfer-process/src/commonMain/kotlin/org/mifos/mobile/feature/transfer/process/makeTransfer/MakeTransferScreen.kt (3 hunks)
  • feature/transfer-process/src/commonMain/kotlin/org/mifos/mobile/feature/transfer/process/transferProcess/TransferProcessScreen.kt (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
feature/guarantor/src/commonMain/kotlin/org/mifos/mobile/feature/guarantor/screens/guarantorDetails/GuarantorDetailContent.kt (1)
core/ui/src/commonMain/kotlin/org/mifos/mobile/core/ui/component/MifosTexts.kt (1)
  • MifosTextTitleDescDoubleLine (62-83)
⏰ 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 (92)
feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/help/HelpScreen.kt (1)

351-351: Good refactoring to use shape tokens—verify visual consistency.

This change correctly migrates from an inline RoundedCornerShape using a padding value to a predefined shape token, which better aligns with design system best practices. However, since the original implementation used DesignToken.padding.small as the corner radius and the new implementation uses DesignToken.shapes.small, please verify that both produce visually consistent button shapes.

Given that the PR template requested screenshots for UI changes but none were provided, consider adding before/after screenshots to confirm there are no unintended visual regressions in the button appearance.

Verification approach

Compare the button appearance in the Help screen before and after this change to ensure:

  • Corner radius appears identical or intentionally updated
  • Button visual consistency with other buttons using DesignToken.shapes.small
  • Overall Help screen layout remains unchanged
feature/guarantor/src/commonMain/kotlin/org/mifos/mobile/feature/guarantor/screens/guarantorAdd/AddGuarantorScreen.kt (2)

49-49: Good addition of DesignToken import.

The import is correctly added to support the design token usage in the padding modifications below.


152-153: Excellent migration to design tokens.

Replacing hardcoded padding values with DesignToken.padding.large aligns perfectly with the PR objective and improves consistency across the design system.

feature/home/src/commonMain/kotlin/org/mifos/mobile/feature/home/components/BottomSheetContent.kt (3)

47-47: Import correctly updated for theming migration.

The import statement properly adds KptTheme to support the migration from MaterialTheme to the custom design system theme.


96-100: Border colors correctly migrated to KptTheme.

The border color references for both the card container and icon box have been successfully updated to use KptTheme.colorScheme.secondaryContainer, maintaining visual consistency.

Also applies to: 108-114


131-138: Text colors correctly migrated to KptTheme.

The text color references have been properly updated to use KptTheme.colorScheme.onSurface for the account title and KptTheme.colorScheme.secondary for the tip text, maintaining appropriate semantic color usage.

Also applies to: 140-147

feature/client-charge/src/commonMain/kotlin/org/mifos/mobile/feature/charge/chargeDetails/ChargeDetailScreen.kt (2)

50-50: LGTM! Consistent theme migration.

The migration from MaterialTheme to KptTheme is correctly implemented across all modified lines. The import is properly added, and all typography and color scheme references are consistently updated.

Also applies to: 141-141, 155-155, 164-164, 201-201


162-162: Verify if MifosTypography should also be migrated.

While all other typography references were migrated to KptTheme.typography, this line still uses MifosTypography.bodySmallEmphasized. Please confirm whether this is intentional (e.g., if KptTheme doesn't provide an emphasized variant) or if it should also be migrated for consistency.

#!/bin/bash
# Search for other MifosTypography usages to determine if this is a pattern or an outlier
rg -n --type=kotlin 'MifosTypography\.' -C2
feature/qr/src/androidMain/kotlin/org/mifos/mobile/feature/qr/CropContent.kt (1)

36-36: LGTM! Theme migration implemented correctly.

The migration from MaterialTheme to KptTheme is properly executed:

  • KptTheme import added correctly
  • Hardcoded padding (16.dp) replaced with design token (DesignToken.padding.large)
  • Typography style migrated from MaterialTheme to KptTheme

The changes align with the PR objective and maintain consistency with existing DesignToken usage in the file.

Also applies to: 66-66, 89-89

feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/component/LoanCard.kt (4)

39-39: LGTM! Theme import successfully updated.

The KptTheme import has been correctly added to support the theme migration.


92-92: Excellent migration to design tokens!

All spacing and padding values have been correctly migrated from hardcoded dp values to DesignToken properties. The token names are semantically appropriate and consistent with the design system.

Also applies to: 101-101, 118-118, 170-170, 178-178, 186-186, 202-202


134-134: Theme migration successfully applied.

The default backgroundColor parameter has been correctly updated from MaterialTheme.colorScheme.primary to KptTheme.colorScheme.primary, maintaining consistency with the design system migration.


116-125: Verify that preview functions render correctly with KptTheme.

The preview functions don't explicitly wrap their content with KptTheme (or any theme provider). Since LoanCardCustom now defaults to KptTheme.colorScheme.primary at line 134, ensure that the preview infrastructure provides KptTheme automatically, or the previews may fail to render correctly.

If previews don't work, consider wrapping the preview content:

@Preview
@Composable
fun LoanCardPreviewCustom() {
    KptTheme {
        LoanCardCustom(
            modifier = Modifier.padding(DesignToken.padding.large),
            cardImage = UiRes.drawable.ic_icon_dashboard,
            onClick = {},
            title = "title",
            amount = "amount",
            interestRate = "7.5 %",
        )
    }
}

Also applies to: 200-209

feature/qr/src/androidMain/kotlin/org/mifos/mobile/feature/qr/Dialogs.kt (3)

31-32: LGTM: Theme system imports added correctly.

The new imports for DesignToken and KptTheme properly support the migration from MaterialTheme to the custom theme system.


59-59: LGTM: Shape reference migrated to KptTheme.

The shape reference has been correctly updated from MaterialTheme.shapes.small to KptTheme.shapes.small, aligning with the PR's theme migration objective.


63-63: Padding change verified and correct.

The migration from hardcoded 16.dp to DesignToken.padding.large is accurate. DesignToken.padding.large equals 16.dp (line 136 in DesignToken.kt), ensuring no visual regression.

feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/component/ConfirmDetailsCard.kt (2)

44-44: LGTM: Color scheme migration is correct.

The migration from MaterialTheme.colorScheme.secondaryContainer to KptTheme.colorScheme.secondaryContainer correctly aligns with the PR objective to replace MaterialTheme with KptTheme throughout the codebase.


29-29: No issues found with the KptTheme import.

The import template.core.base.designsystem.theme.KptTheme is correct and valid. The template.core.base package structure is the legitimate location of the design system module, not a placeholder. This import pattern is consistently used across the entire codebase in 20+ files. The KptTheme object is properly defined in core-base/designsystem/src/commonMain/kotlin/template/core/base/designsystem/theme/KptColorSchemeImpl.kt.

Likely an incorrect or invalid review comment.

feature/transfer-process/src/commonMain/kotlin/org/mifos/mobile/feature/transfer/process/makeTransfer/MakeTransferScreen.kt (2)

194-194: LGTM! Consistent theming migration for error states.

The migration from MaterialTheme.colorScheme.error to KptTheme.colorScheme.error is correctly applied to both error indicator icons, maintaining consistent error styling across the form validation.

Also applies to: 222-222


58-58: The review comment regarding the KptTheme import package naming cannot be verified without access to the repository source code. To proceed, the actual package structure and KptTheme definition location in the codebase must be confirmed.

feature/transfer-process/src/commonMain/kotlin/org/mifos/mobile/feature/transfer/process/transferProcess/TransferProcessScreen.kt (1)

170-170: LGTM! Consistent typography migration.

The migration from MaterialTheme.typography.labelLarge to KptTheme.typography.labelLarge correctly updates the button text styling to use the custom design system.

feature/loan-account/src/commonMain/kotlin/org/mifos/mobile/feature/loanaccount/component/AccountSummaryCard.kt (2)

51-51: LGTM! KptTheme import added correctly.

The import addition supports the theming migration throughout this file.


78-78: Theme migration to KptTheme needs manual verification.

The migration from MaterialTheme.colorScheme to KptTheme.colorScheme appears consistent across all five identified lines (78, 98, 104, 124, 133), using semantic color tokens secondaryContainer, onSurface, and secondary. However, verification requires access to the repository to confirm:

  • KptTheme is properly defined and available in module dependencies
  • KptTheme.colorScheme provides the expected color tokens
  • No remaining MaterialTheme.colorScheme references exist in the file
feature/savings-account/src/commonMain/kotlin/org/mifos/mobile/feature/savingsaccount/savingsAccount/SavingsAccountScreen.kt (2)

225-225: LGTM! Text color migrations are semantically correct.

The migration to KptTheme.colorScheme.onBackground for the title and KptTheme.colorScheme.secondary for the label appropriately uses semantic color roles from the design system.

Also applies to: 233-233


278-283: Review status colors for consistent theming approach.

The when expression at lines 279-282 mixes AppColors (customEnable, customYellow) with KptTheme.colorScheme (error, onSurface). Verify whether AppColors.customEnable and AppColors.customYellow should migrate to KptTheme equivalents for consistency, or if these custom colors are intentionally preserved due to missing KptTheme definitions.

feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/uploadDocs/component/BottomSheetContent.kt (2)

74-74: LGTM! Import addition supports the theming migration.

The KptTheme import is correctly added to support the migration from MaterialTheme to the custom theme system.


152-152: LGTM! Theming migration is consistent and correct.

The color scheme references have been properly migrated from MaterialTheme to KptTheme across all three locations:

  • Border color in BottomSheetIconContainer (line 152)
  • Text color in BottomSheetIconContainer (line 170)
  • Border color in SignatureContent card (line 220)

No MaterialTheme references remain in the file. The changes maintain the same semantic color roles and align with the PR's objective to standardize on the custom theme system.

feature/share-account/src/commonMain/kotlin/org/mifos/mobile/feature/shareaccount/shareAccount/ShareAccountScreen.kt (2)

223-223: Theme migration verified as correct.

All color properties referenced in ShareAccountScreen.kt are properly defined in the KptColorScheme interface and implemented in KptColorSchemeImpl. The migration from MaterialTheme.colorScheme to KptTheme.colorScheme maintains Material3 compatibility and semantic correctness for:

  • onBackground for primary text (line 223)
  • secondary for secondary text (line 231)
  • error for error states (line 289)
  • onSurface for default surface content (line 290)

59-59: The import is correct. KptTheme is properly defined in the template.core.base.designsystem.theme package, which is the designated design system module for this Kotlin Multiplatform project. The package naming is consistent with the project's architecture, and KptTheme is used throughout the codebase with standard Material 3 color scheme properties (colorScheme, typography, shapes). No changes needed.

Likely an incorrect or invalid review comment.

feature/savings-account/src/commonMain/kotlin/org/mifos/mobile/feature/savingsaccount/savingsAccountUpdate/AccountUpdateScreen.kt (1)

50-50: Theme migration correctly applied.

The import addition (template.core.base.designsystem.theme.KptTheme) and the button color change from MaterialTheme.colorScheme.primary to KptTheme.colorScheme.primary are aligned with the codebase's migration pattern and are correctly implemented.

feature/onboarding-language/src/commonMain/kotlin/org/mifos/mobile/feature/onboarding/language/SetOnboardingLanguageScreen.kt (2)

53-53: LGTM! Import aligns with the theme migration.

The KptTheme import is correctly added to support the MaterialTheme → KptTheme migration throughout this file.


125-125: LGTM! Theme color migration is correct.

The Text color properties have been correctly migrated from MaterialTheme.colorScheme to KptTheme.colorScheme, maintaining the same semantic color roles (onSurface and secondary).

Also applies to: 135-135

feature/third-party-transfer/src/commonMain/kotlin/org/mifos/mobile/feature/third/party/transfer/thirdPartyTransfer/TptScreen.kt (2)

62-62: LGTM! Import added correctly.

The KptTheme import has been added appropriately to support the theme migration.


167-167: Theme migration is complete and correct.

All MaterialTheme.colorScheme references have been consistently replaced with KptTheme.colorScheme. The KptTheme object properly exposes the colorScheme property via Compose's CompositionLocal pattern, and all required color properties (primary, secondary, error, onSurface) are correctly defined in KptColorSchemeImpl. No remaining MaterialTheme.colorScheme references exist in the file.

feature/share-application/src/commonMain/kotlin/org/mifos/mobile/feature/share/application/fillApplication/FillApplicationScreen.kt (2)

228-228: LGTM! Color scheme migration is consistent.

The replacement of MaterialTheme.colorScheme.onSurface with KptTheme.colorScheme.onSurface for the section header Text components is correct and consistent across all three occurrences. The semantic meaning (text color on surface) is preserved.

Also applies to: 287-287, 318-318


63-63: The KptTheme import path at line 63 is correct and standard across the codebase. The package template.core.base.designsystem.theme is the proper location for KptTheme, which is defined in the core-base designsystem module. This import pattern is consistently used in 50+ files throughout the project, including other feature modules. No compilation or correctness issues exist here.

Likely an incorrect or invalid review comment.

feature/client-charge/src/commonMain/kotlin/org/mifos/mobile/feature/charge/components/ClientChargeItem.kt (4)

42-42: LGTM!

The KptTheme import is properly added to support the theming migration.


147-151: Duplicate concern: AppColors usage.

Same observation as lines 122-126—AppColors.customEnable remains unmigrated while KptTheme.colorScheme.error is correctly used.


75-82: Theme migration and design token usage are correct.

The migration from MaterialTheme to KptTheme is consistent, and DesignToken.sizes.iconExtraLarge correctly resolves to 36.dp, maintaining the original icon size.


163-172: Verify that MifosMobileTheme provides KptTheme.

The component now depends on KptTheme, but the preview wraps it with MifosMobileTheme. Ensure that MifosMobileTheme properly provides the KptTheme composition local; otherwise, the preview (and component usage) will fail at runtime.

#!/bin/bash
# Description: Check if MifosMobileTheme provides KptTheme composition local

# Search for MifosMobileTheme definition and check if it provides KptTheme
rg -nP --type=kt -A20 'fun MifosMobileTheme\s*\('
feature/guarantor/src/commonMain/kotlin/org/mifos/mobile/feature/guarantor/screens/guarantorList/GuarantorListScreen.kt (2)

150-167: LGTM! Complete theme migration for GuarantorListItem.

The component has been successfully migrated:

  • Card colors now use KptTheme.colorScheme.background
  • Spacing now uses DesignToken.padding.* instead of hardcoded values
  • Typography now uses KptTheme.typography.*

The migration is mechanically correct and consistent with the PR objectives.

Consider performing visual regression testing to confirm that:

  1. The card background color matches the previous appearance
  2. The padding values (DesignToken.padding.large and DesignToken.padding.small) produce the expected spacing
  3. The typography styles (bodyMedium and labelMedium) render as intended

102-102: Theme migration for FAB contentColor is correct.

The migration from MaterialTheme to KptTheme at line 102 is properly applied. KptTheme is correctly imported and used as the color source for the contentColor parameter.

feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/passcode/UpdatePasscodeScreen.kt (1)

133-133: Incomplete design token migration requires correction with proper token mapping.

Lines 133 and 186 use hardcoded 24.dp values that should be replaced with design tokens. However, the suggested token DesignToken.spacing.large is incorrect—it equals 16.dp, not 24.dp. No existing spacing token matches 24.dp exactly. The closest alternatives are DesignToken.spacing.largeIncreased (20.dp) or DesignToken.spacing.extraLarge (28.dp). Verify the intended spacing value and apply the appropriate token, or add a new token for 24.dp if it's a deliberate design value.

feature/beneficiary/src/commonMain/kotlin/org/mifos/mobile/feature/beneficiary/beneficiaryList/BeneficiaryListScreen.kt (4)

293-350: Theme migration looks correct, pending import fix.

The ActionBar color changes from MaterialTheme to KptTheme are consistent and correct. All text and icon colors properly use KptTheme.colorScheme.primary. However, this depends on fixing the import issue flagged above.


469-527: Color scheme migration is correct.

The FilterSection text color changes to KptTheme.colorScheme.onBackground and KptTheme.colorScheme.secondary are appropriate and consistent with the theme migration.


76-77: No action needed. The import template.core.base.designsystem.theme.KptTheme is correct and consistent with the project's architecture. The template.core.base package is the legitimate designation for the core-base module, not a placeholder. This import pattern is used consistently across 20+ files throughout the codebase.

Likely an incorrect or invalid review comment.


402-402: Hardcoded divider height lacks a corresponding design token. Lines 402 and 537 use 1.dp for HorizontalDivider height, but DesignToken does not currently define a divider thickness constant. Consider adding a divider thickness property to AppSizes (or a new design token class) before replacing these hardcoded values.

Likely an incorrect or invalid review comment.

feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/loanApplication/LoanApplyScreen.kt (2)

252-264: Theme migration applied correctly.

The typography reference has been successfully migrated from MaterialTheme to KptTheme for the "Continue" button label. The change is consistent with the PR objective and maintains the same typography style reference (labelLarge).

Since the PR description indicates no screenshots were provided, consider visually verifying that the button text renders as expected with the new KptTheme typography to ensure UI consistency.


66-66: The import path template.core.base.designsystem.theme.KptTheme is correct and intentional. This refers to the core-base/designsystem module, which uses the template.* package prefix as part of the project's architectural separation between shared template libraries (template.core.base.*) and application-specific modules (org.mifos.mobile.*). KptTheme is properly defined in the codebase and the import is valid.

Likely an incorrect or invalid review comment.

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

39-40: No issues found. The design tokens are correctly configured with padding.large = 16.dp and spacing.large = 16.dp, matching the original hardcoded values.


23-24: Imports are properly cleaned. The old MaterialTheme and dp imports have been completely removed, and the new DesignToken and KptTheme imports are correctly in place. Design token values (DesignToken.padding.large and DesignToken.spacing.large both equal 16.dp) match the original hardcoded values, and KptTheme.typography provides the required typography styles. The migration is clean and complete.


44-48: No changes needed — KptTheme typography styles are equivalent to Material 3 defaults. The bodyLarge and bodyMedium text styles in KptTheme match their Material 3 counterparts exactly (bodyLarge: 16sp/Normal/24sp line height/0.5sp letter spacing; bodyMedium: 14sp/Normal/20sp line height/0.25sp letter spacing), ensuring no visual regressions from this design system migration.

feature/guarantor/src/commonMain/kotlin/org/mifos/mobile/feature/guarantor/screens/guarantorDetails/GuarantorDetailContent.kt (2)

37-37: Design token migration verified—values match original dimensions.

The replacement of hardcoded padding dimensions with DesignToken values is correct: DesignToken.padding.large = 16.dp and DesignToken.padding.small = 8.dp preserve the original visual behavior across all five locations (lines 37, 45, 53, 61, 69).


27-27: No issues found. The import path template.core.base.designsystem.theme.KptTheme is correct and follows the established package structure used consistently throughout the codebase.

Likely an incorrect or invalid review comment.

feature/savings-account/src/commonMain/kotlin/org/mifos/mobile/feature/savingsaccount/savingsAccountWithdraw/AccountWithdrawScreen.kt (2)

48-48: The import is correct. template.core.base.designsystem.theme.KptTheme is the actual package where KptTheme is defined in the designsystem module, and this import pattern is used consistently throughout the codebase.


187-189: Theme migration to KptTheme is correct.

KptTheme.colorScheme provides all required Material3 ColorScheme properties including secondaryContainer, error, and primary. The implementation uses appropriate color values (secondaryContainer: #E8DEF8, error: #BA1A1A, primary: #6750A4) for these UI states.

feature/savings-application/src/commonMain/kotlin/org/mifos/mobile/feature/savings/application/fillApplication/FillApplicationScreen.kt (2)

217-217: LGTM! Theme migration is consistent.

All three Text composables have been correctly updated to use KptTheme.colorScheme.onSurface instead of MaterialTheme.colorScheme.onSurface. The changes are mechanically correct and maintain visual consistency.

Also applies to: 247-247, 279-279


64-64: No action needed—the import is correct.

The import template.core.base.designsystem.theme.KptTheme is valid. The KptTheme object is properly defined in that package, and "template" is the project's intentional package prefix used consistently throughout the codebase (confirmed across core-base modules). The theme migration from MaterialTheme.colorScheme.onSurface to KptTheme.colorScheme.onSurface is mechanically sound and uses the correct API.

feature/notification/src/commonMain/kotlin/org/mifos/mobile/feature/notification/NotificationScreen.kt (5)

191-191: LGTM: Divider color migration is consistent.

The HorizontalDivider color correctly uses KptTheme.colorScheme.surfaceDim, maintaining the same semantic color property from the previous MaterialTheme implementation.


224-228: LGTM: Icon tint colors migrated correctly.

The conditional icon tint logic correctly uses KptTheme.colorScheme.onSurfaceVariant and KptTheme.colorScheme.primary, maintaining the same color semantics as before.


233-242: LGTM: Typography styles migrated correctly.

The text styles correctly use KptTheme.typography.bodyMedium and KptTheme.typography.labelMedium, maintaining the same typography semantics from the previous MaterialTheme implementation.


218-219: Design token migration verified—no visual regressions.

The design token values match the previous hardcoded dimensions: DesignToken.padding.small = 8.dp and DesignToken.spacing.large = 16.dp. The changes are safe.


47-52: KptTheme and DesignToken are properly configured with required properties.

Verification confirms both KptTheme and DesignToken are correctly available and provide all required properties:

  • KptTheme.colorScheme: Includes surfaceDim, onSurfaceVariant, and primary
  • KptTheme.typography: Includes bodyMedium and labelMedium
  • DesignToken.padding: Includes small (8.dp, matching the original hardcoded value)
  • DesignToken.spacing: Includes large (16.dp, matching the original hardcoded value)

The theming migration is properly configured.

feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/uploadDocs/UploadDocsScreen.kt (2)

53-53: The import is correct. The template.core.base.designsystem.theme.KptTheme package is the intentional and consistent naming convention used throughout the core-base modules in the codebase (designsystem, platform, ui, common, database, datastore, analytics). This is not a placeholder.


202-202: No action needed. The typography migration from MaterialTheme.typography.labelLarge to KptTheme.typography.labelLarge is correctly implemented. KptTheme.typography.labelLarge is properly defined with appropriate Material 3 design tokens (Medium weight, 14sp font size), and the change is consistent throughout the codebase.

feature/beneficiary/src/commonMain/kotlin/org/mifos/mobile/feature/beneficiary/beneficiaryDetail/BeneficiaryDetailContent.kt (1)

44-44: No issues found. The import path template.core.base.designsystem.theme.KptTheme is correct and consistent with the project's package structure, which uses "template" as the top-level package prefix throughout the codebase.

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

68-68: LGTM! Theme migration executed correctly.

The import of KptTheme and replacement of MaterialTheme.colorScheme.primary with KptTheme.colorScheme.primary aligns with the PR's design-system migration objectives. The changes maintain visual consistency while adopting the custom theme.

Also applies to: 302-311

feature/beneficiary/src/commonMain/kotlin/org/mifos/mobile/feature/beneficiary/beneficiaryApplication/BeneficiaryApplicationContent.kt (1)

51-51: LGTM! Themed text styling updated correctly.

The KptTheme.colorScheme.primary now provides the accent color for the annotated string, maintaining the visual emphasis while aligning with the new design system.

Also applies to: 175-175

feature/qr/src/commonMain/kotlin/org/mifos/mobile/feature/qr/qrCodeDisplay/QrCodeDisplayScreen.kt (1)

50-50: LGTM! Color scheme migration applied consistently.

Both the title and footer text now use KptTheme.colorScheme.primary, ensuring consistent theming across the QR code display screen.

Also applies to: 128-128, 160-160

feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/componenets/MifosLogoutDilaog.kt (1)

38-38: LGTM! Color scheme references migrated consistently.

All text color assignments in the logout dialog now use KptTheme.colorScheme, maintaining visual hierarchy with appropriate primary and secondary colors.

Also applies to: 87-87, 93-93, 115-115

feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/registration/RegistrationScreen.kt (1)

85-85: LGTM! Comprehensive theming and spacing migration.

The registration screen successfully migrates to KptTheme.colorScheme for all color references (onSurface, secondary, primary, error) and replaces the hardcoded 8.dp with DesignToken.padding.small at line 334, demonstrating consistent adoption of the design-system tokens.

Also applies to: 213-213, 221-221, 266-266, 309-311, 322-322, 334-334

feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/appInfo/AppInfoScreen.kt (1)

49-49: LGTM! Theme migration applied to app title.

The "Mifos" title text now uses KptTheme.colorScheme.primary, ensuring brand consistency with the new design system.

Also applies to: 139-139

feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/login/LoginScreen.kt (1)

71-71: LGTM! Comprehensive theming and sizing migration.

The login screen successfully migrates to KptTheme.colorScheme for all color references (onSurface, secondary, error, primary) and replaces the hardcoded 48.dp with DesignToken.sizes.avatarMedium at line 207, ensuring consistent sizing across the design system.

Also applies to: 207-207, 219-219, 227-227, 258-258, 291-291, 328-328

feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/about/AboutScreen.kt (1)

50-50: LGTM! Theming migration looks good.

The replacement of MaterialTheme.colorScheme.primary with KptTheme.colorScheme.primary is consistent with the broader theming migration across the codebase.

Also applies to: 123-123

feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/uploadId/UploadIdScreen.kt (1)

76-76: LGTM! Consistent theming migration.

All color references have been successfully migrated from MaterialTheme.colorScheme to KptTheme.colorScheme. The changes maintain visual consistency across onBackground, secondary, primary, and border colors.

Also applies to: 162-162, 170-170, 275-275, 337-339

feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/faq/FaqScreen.kt (1)

48-48: LGTM! Theming and design token migration is well-executed.

The migration successfully replaces hardcoded spacing (8.dpDesignToken.spacing.small) and color references (MaterialTheme.colorScheme.primaryKptTheme.colorScheme.primary), aligning with the design system standards.

Also applies to: 156-156, 160-160

feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/settings/SettingsScreen.kt (1)

58-58: LGTM! Profile card theming updated correctly.

The color scheme migration in SettingsProfileCard maintains visual consistency by updating border color and text colors (primary, secondary) to use KptTheme.colorScheme.

Also applies to: 223-223, 240-240, 249-249

feature/home/src/commonMain/kotlin/org/mifos/mobile/feature/home/HomeScreen.kt (1)

70-70: LGTM! Comprehensive theming migration across HomeScreen.

All color references have been successfully migrated to KptTheme.colorScheme, including:

  • Icon color filters (onSurface, tertiary)
  • Text colors (onSurface)
  • Border colors (secondaryContainer)
  • Container colors (surface)

The changes maintain consistent visual theming throughout the home screen.

Also applies to: 143-143, 183-183, 209-209, 278-278, 284-284, 291-291, 328-328

feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/recoverPassword/RecoverPasswordScreen.kt (1)

60-60: LGTM! RecoverPasswordScreen theming migration is complete.

All theming updates are consistent:

  • Text colors migrated to KptTheme.colorScheme (onBackground, secondary, primary)
  • Error icon tints updated to KptTheme.colorScheme.error
  • Spacing standardized with DesignToken.spacing.medium

Also applies to: 130-130, 133-133, 138-138, 186-186, 211-211, 241-241, 250-250

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

46-46: LGTM! FilterSection theming updated correctly.

Text colors for filter titles, counts, and labels have been consistently migrated to use KptTheme.colorScheme (onBackground, secondary).

Also applies to: 95-95, 105-105, 205-205

feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/setNewPassword/SetPasswordScreen.kt (1)

60-60: SetPasswordScreen theming migration is incomplete — hardcoded spacing value requires standardization.

Color references have been successfully migrated to KptTheme.colorScheme (lines 147, 155, 263, 272). However, line 158 contains a hardcoded 24.dp spacing value that breaks the migration. Replace Spacer(modifier = Modifier.height(24.dp)) with an appropriate DesignToken.spacing value (e.g., DesignToken.spacing.extraLarge at 28.dp is the closest match).

Likely an incorrect or invalid review comment.

feature/recent-transaction/src/commonMain/kotlin/org/mifos/mobile/feature/recent/transaction/screen/RecentTransactionScreen.kt (1)

60-67: LGTM! Clean design system migration.

The import changes properly introduce KptTheme and DesignToken to support the design system migration. The overall approach of systematically replacing MaterialTheme references with KptTheme throughout this file is consistent and well-executed.

feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/otpAuthentication/OtpAuthenticationScreen.kt (1)

66-66: LGTM! Comprehensive theming migration.

The file has been thoroughly migrated from MaterialTheme to KptTheme. All color references (onBackground, secondary, error, primary) and typography are consistently updated throughout the authentication screen. The changes maintain the existing functionality while adopting the new design system.

feature/passcode/src/commonMain/kotlin/org/mifos/mobile/feature/passcode/PasscodeScreen.kt (1)

54-317: LGTM! Excellent migration with design tokens.

This file demonstrates a complete migration from MaterialTheme to KptTheme with proper adoption of design tokens:

  • All color references migrated to KptTheme.colorScheme
  • Fixed dimensions replaced with DesignToken.sizes and DesignToken.spacing
  • Consistent theming across all UI elements (backgrounds, borders, text, icons)

The implementation is clean and maintains existing functionality while improving design system compliance.

feature/loan-account/src/commonMain/kotlin/org/mifos/mobile/feature/loanaccount/component/RepaymentPeriodCard.kt (1)

48-172: LGTM! Clean theming update.

The migration updates all MaterialTheme references to KptTheme and replaces the hardcoded 36.dp icon size with DesignToken.sizes.iconExtraLarge. All color references (secondaryContainer, primary, outline, onSurface, error) are consistently updated to use the new theme, maintaining the component's functionality.

feature/passcode/src/commonMain/kotlin/org/mifos/mobile/feature/passcode/verifyPasscode/VerifyPasscodeScreen.kt (1)

53-306: LGTM! Comprehensive migration.

This file mirrors the excellent migration pattern seen in PasscodeScreen.kt:

  • Complete transition from MaterialTheme to KptTheme
  • Hardcoded dimensions (16.dp, 24.dp, 32.dp) properly replaced with DesignToken equivalents
  • All color, surface, and spacing references consistently use the new design system

The verification screen maintains full functionality while adopting the standardized theming approach.

feature/loan-account/src/commonMain/kotlin/org/mifos/mobile/feature/loanaccount/loanAccount/LoanAccountScreen.kt (1)

61-293: LGTM! Targeted theming update.

The migration updates the essential MaterialTheme.colorScheme references to KptTheme.colorScheme for text colors (onBackground, secondary) and account status colors (error, onSurface). The changes are minimal but complete for this screen's theming needs.

feature/loan-account/src/commonMain/kotlin/org/mifos/mobile/feature/loanaccount/loanAccountDetails/LoanAccountDetailsScreen.kt (1)

58-284: LGTM! Clean theming update.

The file properly updates MaterialTheme.colorScheme references to KptTheme.colorScheme for text colors in the account details grid and actions section. The migration is complete and consistent with the PR's design system objectives.

feature/savings-account/src/commonMain/kotlin/org/mifos/mobile/feature/savingsaccount/savingsAccountDetails/SavingsAccountDetailsScreen.kt (4)

249-267: Theme migration applied correctly with conditional logic preserved.

The replacement of MaterialTheme.colorScheme with KptTheme.colorScheme maintains the existing conditional color logic. However, ensure the color values in KptTheme match the expected design to avoid visual regressions.

Consider adding a visual comparison (screenshots) to the PR description to verify the theme colors render as expected.


299-299: Theme migration applied correctly.

The color scheme updates maintain the existing conditional logic for status highlighting. The use of AppColors.customEnable for active status and KptTheme.colorScheme.onBackground for other cases is consistent with the refactoring approach.

Also applies to: 316-322


350-350: Theme migration applied correctly.

The color scheme replacement for the section header is consistent with the overall refactoring.


60-60: No issues found. The import path template.core.base.designsystem.theme.KptTheme is legitimate and correct. The package exists at core-base/designsystem/src/commonMain/kotlin/template/core/base/designsystem/KptTheme.kt and follows the established naming convention of the core-base module. This import is used consistently across 58+ files in the project as the standard way to reference the shared theming system. The changes to use KptTheme.colorScheme are valid.

Likely an incorrect or invalid review comment.

title = stringResource(Res.string.first_name),
description = data.firstname ?: "",
descriptionStyle = MaterialTheme.typography.bodyLarge,
descriptionStyle = KptTheme.typography.bodyLarge,
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for MifosTextTitleDescDoubleLine function definition
find . -name "MifosTexts.kt" -type f

Repository: openMF/mifos-mobile

Length of output: 143


🏁 Script executed:

#!/bin/bash
# Search for MifosTextTitleDescDoubleLine using ast-grep
ast-grep --pattern 'fun MifosTextTitleDescDoubleLine($$$) {
  $$$
}'

Repository: openMF/mifos-mobile

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Also try a simpler ripgrep search for the component
rg -n "MifosTextTitleDescDoubleLine" --type=kotlin

Repository: openMF/mifos-mobile

Length of output: 1585


🏁 Script executed:

#!/bin/bash
# Read the MifosTexts.kt file to check the MifosTextTitleDescDoubleLine implementation
cat -n ./core/ui/src/commonMain/kotlin/org/mifos/mobile/core/ui/component/MifosTexts.kt | head -100

Repository: openMF/mifos-mobile

Length of output: 3904


🏁 Script executed:

#!/bin/bash
# Read GuarantorDetailContent.kt to see how MifosTextTitleDescDoubleLine is called
cat -n ./feature/guarantor/src/commonMain/kotlin/org/mifos/mobile/feature/guarantor/screens/guarantorDetails/GuarantorDetailContent.kt | head -80

Repository: openMF/mifos-mobile

Length of output: 3374


🏁 Script executed:

#!/bin/bash
# Check for other usages of MifosTextTitleDescDoubleLine in the codebase
rg -n "MifosTextTitleDescDoubleLine" --type=kotlin -B2 -A5 | head -80

Repository: openMF/mifos-mobile

Length of output: 9172


Update MifosTextTitleDescDoubleLine to accept titleStyle parameter instead of hardcoding MaterialTheme.

The component currently uses MaterialTheme.typography.labelMedium for the title (line 72 of MifosTexts.kt) while the description accepts a parameterized style. This creates a mixed-theme state where callers pass KptTheme.typography.bodyLarge for descriptions but the title remains bound to MaterialTheme. If the objective is to fully migrate away from MaterialTheme, add a titleStyle parameter with a default value and update the component definition accordingly. Also update the preview at line 171 to use KptTheme for consistency.

Comment on lines 170 to 172
unselectedTextStyle = MifosTypography.titleSmallEmphasized.copy(
MaterialTheme.colorScheme.onSurface,
KptTheme.colorScheme.onSurface,
),
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix compilation error: missing parameter name in copy().

The copy() method requires the parameter name color = before the value. Compose's TextStyle.copy() uses named parameters only.

🔎 Apply this diff to fix the compilation error:
 unselectedTextStyle = MifosTypography.titleSmallEmphasized.copy(
-    KptTheme.colorScheme.onSurface,
+    color = KptTheme.colorScheme.onSurface,
 ),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
unselectedTextStyle = MifosTypography.titleSmallEmphasized.copy(
MaterialTheme.colorScheme.onSurface,
KptTheme.colorScheme.onSurface,
),
unselectedTextStyle = MifosTypography.titleSmallEmphasized.copy(
color = KptTheme.colorScheme.onSurface,
),
🤖 Prompt for AI Agents
In
feature/onboarding-language/src/commonMain/kotlin/org/mifos/mobile/feature/onboarding/language/SetOnboardingLanguageScreen.kt
around lines 170 to 172, the call to TextStyle.copy(...) is missing the named
parameter for the color; update the copy call to use the named argument (e.g.,
color = KptTheme.colorScheme.onSurface) so the code compiles with Compose's
named-parameter copy signature.

Comment on lines 111 to 113
unselectedTextStyle = MifosTypography.titleSmallEmphasized.copy(
MaterialTheme.colorScheme.onSurface,
KptTheme.colorScheme.onSurface,
),
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Critical: Missing parameter name in .copy() call.

Line 112 is missing the color = parameter name. The .copy() method on TextStyle requires named parameters in Compose. This will likely cause a compilation error.

Compare with line 109 where selectedTextStyle correctly uses color = AppColors.primaryBlue.

🔎 Apply this diff to fix the syntax error:
 unselectedTextStyle = MifosTypography.titleSmallEmphasized.copy(
-    KptTheme.colorScheme.onSurface,
+    color = KptTheme.colorScheme.onSurface,
 ),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
unselectedTextStyle = MifosTypography.titleSmallEmphasized.copy(
MaterialTheme.colorScheme.onSurface,
KptTheme.colorScheme.onSurface,
),
unselectedTextStyle = MifosTypography.titleSmallEmphasized.copy(
color = KptTheme.colorScheme.onSurface,
),
🤖 Prompt for AI Agents
In
feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/theme/ChangeThemeScreen.kt
around lines 111 to 113, the unselectedTextStyle.copy(...) call omits the
required named parameter; change the call to use the named parameter (color =
KptTheme.colorScheme.onSurface) so the TextStyle.copy invocation matches
Compose's named-parameter requirement, mirroring how selectedTextStyle uses
color = AppColors.primaryBlue.

@biplab1 biplab1 force-pushed the MM-389-replace-materialtheme-with-kptmaterialtheme branch from 7e10ac7 to 0ab48f7 Compare December 18, 2025 15:54
Copy link
Contributor

@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

Caution

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

⚠️ Outside diff range comments (3)
feature/client-charge/src/commonMain/kotlin/org/mifos/mobile/feature/charge/components/ClientChargeItem.kt (1)

157-157: Replace hardcoded size with DesignToken.

Line 157 uses a hardcoded 20.dp value, which is inconsistent with the PR objective to use DesignToken for sizes. Line 77 already demonstrates the preferred approach using DesignToken.sizes.iconExtraLarge.

🔎 Apply this diff to use DesignToken:
             Icon(
                 imageVector = MifosIcons.ChevronRight,
                 contentDescription = "",
-                modifier = Modifier.size(20.dp),
+                modifier = Modifier.size(DesignToken.sizes.iconSmall),
             )

Note: Verify that DesignToken.sizes.iconSmall (or another appropriate size token) matches the desired 20.dp size.

feature/recent-transaction/src/commonMain/kotlin/org/mifos/mobile/feature/recent/transaction/screen/RecentTransactionScreen.kt (2)

319-348: Inconsistent padding usage.

Line 322 mixes hardcoded 24.dp with DesignToken.padding.large, which is inconsistent with the migration goals.

🔎 Use DesignToken for all padding values
-.padding(horizontal = 24.dp, vertical = DesignToken.padding.large)
+.padding(horizontal = DesignToken.padding.extraLarge, vertical = DesignToken.padding.large)

Verify that DesignToken.padding.extraLarge provides the appropriate 24.dp equivalent, or use the closest available token.


355-391: Multiple hardcoded colors in account selector card.

Lines 361, 362, 382, and 388 use hardcoded colors (Color.Gray, Color.White, Color.Black) instead of KptTheme color tokens, which is inconsistent with the theming migration.

🔎 Migrate hardcoded colors to KptTheme
-border = BorderStroke(1.dp, Color.Gray.copy(alpha = 0.5f)),
-colors = CardDefaults.cardColors(containerColor = Color.White),
+border = BorderStroke(1.dp, KptTheme.colorScheme.outline.copy(alpha = 0.5f)),
+colors = CardDefaults.cardColors(containerColor = KptTheme.colorScheme.surface),
-style = KptTheme.typography.bodySmall.copy(color = Color.Gray),
+style = KptTheme.typography.bodySmall.copy(color = KptTheme.colorScheme.onSurfaceVariant),
-tint = Color.Black,
+tint = KptTheme.colorScheme.onSurface,
♻️ Duplicate comments (1)
feature/guarantor/src/commonMain/kotlin/org/mifos/mobile/feature/guarantor/screens/guarantorDetails/GuarantorDetailContent.kt (1)

42-42: Incomplete theme migration - MifosTextTitleDescDoubleLine still uses MaterialTheme internally.

While the descriptionStyle parameter is correctly updated to KptTheme.typography.bodyLarge, the MifosTextTitleDescDoubleLine component still uses MaterialTheme.typography.labelMedium internally for the title text (see line 72 of MifosTexts.kt in relevant snippets). This creates a mixed-theme state that doesn't fully achieve the PR's objective of replacing MaterialTheme with KptTheme.

As noted in the previous review, the component should accept a titleStyle parameter to allow full theme migration. Based on learnings, this issue was already flagged in a previous review.

Also applies to: 50-50, 58-58, 66-66

🧹 Nitpick comments (9)
feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/recoverPassword/RecoverPasswordScreen.kt (1)

141-141: Consider migrating remaining hardcoded spacing values for consistency.

For consistency with the spacing migration at line 133, consider replacing the remaining hardcoded dp values with DesignToken equivalents (e.g., 24.dp might map to DesignToken.spacing.large or similar, and 6.dp might map to DesignToken.spacing.small).

This would complete the spacing migration and improve maintainability.

Also applies to: 244-244

feature/client-charge/src/commonMain/kotlin/org/mifos/mobile/feature/charge/components/ClientChargeItem.kt (2)

75-79: Consider consolidating the theming approach.

The file now uses three different theme systems:

  • KptTheme.colorScheme.* (lines 75, 79, 125, 150)
  • MifosTypography.* (lines 91, 96, 104, 121, 146)
  • AppColors.* (lines 123, 148)

While this may be intentional during a gradual migration, consider whether typography and custom colors should also be migrated to KptTheme for consistency, or document the intended theming strategy.

Also applies to: 91-91, 121-126, 146-150


163-172: Consider updating the preview theme wrapper.

The preview wraps the component in MifosMobileTheme, while the component itself now uses KptTheme for color scheme properties. This may cause the preview to display differently from the actual runtime appearance.

Verify whether the preview should use a KptTheme-compatible wrapper to ensure accurate preview rendering.

feature/recent-transaction/src/commonMain/kotlin/org/mifos/mobile/feature/recent/transaction/screen/RecentTransactionScreen.kt (2)

186-230: Consider using semantic color tokens for transaction amounts.

The hardcoded colors Color(0xFF0A7E48) (credit/green) and Color.Red (debit) should ideally use KptTheme color tokens to maintain theming consistency.

💡 Consider this approach if semantic tokens exist
-val amountColor = if (isCredit) Color(0xFF0A7E48) else Color.Red
+val amountColor = if (isCredit) KptTheme.colorScheme.success else KptTheme.colorScheme.error

If success color is not available in KptTheme.colorScheme, verify whether these semantic colors should be added to the design system or if they're intentionally custom to this feature.


393-415: Hardcoded background color in dropdown menu.

Line 398 uses Color.White for the dropdown background instead of a KptTheme color token.

🔎 Use theme color for dropdown background
-.background(Color.White),
+.background(KptTheme.colorScheme.surface),
feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/setNewPassword/SetPasswordScreen.kt (1)

158-158: Consider using DesignToken for remaining hardcoded spacing.

Line 158 still uses a hardcoded 24.dp value. If a DesignToken spacing equivalent exists (e.g., DesignToken.spacing.large or similar), consider replacing it for consistency with the migration at line 150.

feature/loan-account/src/commonMain/kotlin/org/mifos/mobile/feature/loanaccount/component/RepaymentPeriodCard.kt (1)

84-88: Consider using DesignToken for border width.

The border width uses hardcoded 1.dp while other sizing/spacing values have been migrated to DesignToken. If a suitable DesignToken for border width exists (e.g., DesignToken.borderWidth.thin or similar), consider using it for consistency.

feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/component/LoanCard.kt (1)

106-107: Consider resolving the TODO comment as part of this theming migration.

Since this PR migrates to KptTheme for color scheme, this might be an opportunity to address the TODO comment about finding the appropriate color from the theme instead of hardcoding Color.White.

Would you like me to help identify the appropriate color token from KptTheme.colorScheme or AppColors that matches the Figma design? I can open a new issue to track this if you'd prefer to address it separately.

feature/qr/src/androidMain/kotlin/org/mifos/mobile/feature/qr/CropContent.kt (1)

78-78: Consider applying KptTheme typography for consistency.

The "No image selected !" text doesn't have a style applied. For consistent theming across the UI, consider using an appropriate KptTheme typography style (e.g., bodyMedium or bodyLarge).

🔎 Suggested change:
-                    Text("No image selected !")
+                    Text(
+                        text = "No image selected !",
+                        style = KptTheme.typography.bodyMedium,
+                    )
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7e10ac7 and 0ab48f7.

📒 Files selected for processing (21)
  • feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/login/LoginScreen.kt (6 hunks)
  • feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/recoverPassword/RecoverPasswordScreen.kt (6 hunks)
  • feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/registration/RegistrationScreen.kt (6 hunks)
  • feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/setNewPassword/SetPasswordScreen.kt (4 hunks)
  • feature/client-charge/src/commonMain/kotlin/org/mifos/mobile/feature/charge/components/ClientChargeItem.kt (4 hunks)
  • feature/guarantor/src/commonMain/kotlin/org/mifos/mobile/feature/guarantor/screens/guarantorAdd/AddGuarantorScreen.kt (2 hunks)
  • feature/guarantor/src/commonMain/kotlin/org/mifos/mobile/feature/guarantor/screens/guarantorDetails/GuarantorDetailContent.kt (2 hunks)
  • feature/guarantor/src/commonMain/kotlin/org/mifos/mobile/feature/guarantor/screens/guarantorList/GuarantorListScreen.kt (3 hunks)
  • feature/loan-account/src/commonMain/kotlin/org/mifos/mobile/feature/loanaccount/component/RepaymentPeriodCard.kt (5 hunks)
  • feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/component/LoanCard.kt (7 hunks)
  • feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.kt (2 hunks)
  • feature/notification/src/commonMain/kotlin/org/mifos/mobile/feature/notification/NotificationScreen.kt (4 hunks)
  • feature/onboarding-language/src/commonMain/kotlin/org/mifos/mobile/feature/onboarding/language/SetOnboardingLanguageScreen.kt (5 hunks)
  • feature/passcode/src/commonMain/kotlin/org/mifos/mobile/feature/passcode/PasscodeScreen.kt (8 hunks)
  • feature/passcode/src/commonMain/kotlin/org/mifos/mobile/feature/passcode/verifyPasscode/VerifyPasscodeScreen.kt (7 hunks)
  • feature/qr/src/androidMain/kotlin/org/mifos/mobile/feature/qr/CropContent.kt (3 hunks)
  • feature/qr/src/androidMain/kotlin/org/mifos/mobile/feature/qr/Dialogs.kt (2 hunks)
  • feature/recent-transaction/src/commonMain/kotlin/org/mifos/mobile/feature/recent/transaction/screen/RecentTransactionScreen.kt (15 hunks)
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/faq/FaqScreen.kt (2 hunks)
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/help/HelpScreen.kt (1 hunks)
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/passcode/UpdatePasscodeScreen.kt (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (12)
  • feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.kt
  • feature/onboarding-language/src/commonMain/kotlin/org/mifos/mobile/feature/onboarding/language/SetOnboardingLanguageScreen.kt
  • feature/passcode/src/commonMain/kotlin/org/mifos/mobile/feature/passcode/PasscodeScreen.kt
  • feature/passcode/src/commonMain/kotlin/org/mifos/mobile/feature/passcode/verifyPasscode/VerifyPasscodeScreen.kt
  • feature/notification/src/commonMain/kotlin/org/mifos/mobile/feature/notification/NotificationScreen.kt
  • feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/registration/RegistrationScreen.kt
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/help/HelpScreen.kt
  • feature/guarantor/src/commonMain/kotlin/org/mifos/mobile/feature/guarantor/screens/guarantorList/GuarantorListScreen.kt
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/faq/FaqScreen.kt
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/passcode/UpdatePasscodeScreen.kt
  • feature/qr/src/androidMain/kotlin/org/mifos/mobile/feature/qr/Dialogs.kt
  • feature/guarantor/src/commonMain/kotlin/org/mifos/mobile/feature/guarantor/screens/guarantorAdd/AddGuarantorScreen.kt
🧰 Additional context used
🧬 Code graph analysis (1)
feature/guarantor/src/commonMain/kotlin/org/mifos/mobile/feature/guarantor/screens/guarantorDetails/GuarantorDetailContent.kt (1)
core/ui/src/commonMain/kotlin/org/mifos/mobile/core/ui/component/MifosTexts.kt (1)
  • MifosTextTitleDescDoubleLine (62-83)
⏰ 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 (24)
feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/recoverPassword/RecoverPasswordScreen.kt (3)

60-60: LGTM! Import correctly added.

The KptTheme import is properly added to support the theming migration throughout the file.


130-130: LGTM! Color scheme migration completed correctly.

All MaterialTheme color references have been successfully migrated to KptTheme with appropriate semantic color properties (onBackground for title, secondary for body/labels, error for validation icons, primary for emphasized links).

Also applies to: 138-138, 186-186, 211-211, 241-241, 250-250


133-133: Token migration is correct — DesignToken.spacing.medium equals 12.dp.

The change from hardcoded 12.dp to the design token maintains the exact same spacing value, ensuring no visual changes to the layout.

feature/guarantor/src/commonMain/kotlin/org/mifos/mobile/feature/guarantor/screens/guarantorDetails/GuarantorDetailContent.kt (3)

24-24: LGTM! Necessary imports added.

The imports for DesignToken and KptTheme are correctly added to support the theme migration.

Also applies to: 27-27


37-37: Change is correct and maintains visual consistency.

The migration from hardcoded 16.dp to DesignToken.padding.large is safe; the token is defined as exactly 16.dp in the AppPadding data class. No visual regression will occur.


45-45: DesignToken.padding.small migration confirmed correct.

The divider padding has been properly migrated from hardcoded 8.dp to DesignToken.padding.small across all four locations (lines 45, 53, 61, 69). The design token is correctly defined as 8.dp, ensuring no visual regression. Migration follows the established pattern and is complete.

feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/login/LoginScreen.kt (2)

71-71: LGTM! Clean migration to design tokens.

The KptTheme import and avatar size migration to DesignToken.sizes.avatarMedium are consistent with the PR objectives.

Also applies to: 207-207


219-219: LGTM! Consistent color scheme migration.

All color references have been cleanly migrated to KptTheme.colorScheme with appropriate semantic tokens.

Also applies to: 227-227, 258-258, 291-291, 328-328

feature/recent-transaction/src/commonMain/kotlin/org/mifos/mobile/feature/recent/transaction/screen/RecentTransactionScreen.kt (3)

60-60: LGTM! Clean theming migration.

The imports and theming updates in the top app bar and filter sheet are consistent with the migration to KptTheme and DesignToken.

Also applies to: 67-67, 95-96, 102-104, 122-124, 164-164


257-297: LGTM! Consistent design token usage.

The transaction list divider styling and error screen color correctly use KptTheme and DesignToken.


417-501: LGTM! Consistent design token usage.

The Apply Filters button and filter chips correctly use KptTheme color schemes and DesignToken shapes/spacing throughout.

feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/setNewPassword/SetPasswordScreen.kt (4)

60-60: LGTM! Import addition is necessary for KptTheme usage.

The import correctly supports the migration from MaterialTheme to KptTheme throughout this file.


155-155: LGTM! Color scheme migrations are consistent.

The replacements of MaterialTheme.colorScheme.secondary (lines 155, 263) and MaterialTheme.colorScheme.primary (line 272) with their KptTheme equivalents are correctly applied. Ensure color compatibility as noted in the earlier comment for line 147.

Also applies to: 263-263, 272-272


150-150: DesignToken.spacing.medium correctly equals 12.dp. The replacement maintains visual consistency with the original hardcoded value and aligns with the PR's migration to design tokens.


147-147: KptTheme.colorScheme.onBackground is properly defined and compatible.

The color value Color(0xFF1C1B1F) matches Material 3 standards and is consistently applied throughout the codebase. The migration from MaterialTheme.colorScheme.onBackground to KptTheme.colorScheme.onBackground is correct with no visual regression risk.

feature/loan-account/src/commonMain/kotlin/org/mifos/mobile/feature/loanaccount/component/RepaymentPeriodCard.kt (3)

48-48: LGTM: Import statement correctly added for KptTheme.

The import aligns with the PR objective to migrate theming from MaterialTheme to KptTheme.


99-99: No action needed. The change from hardcoded 36.dp to DesignToken.sizes.iconExtraLarge is correct—the design token is defined as 36.dp and maintains the intended size for the period number indicator.


86-86: Color scheme migration verified and correct.

KptTheme.colorScheme properly provides all referenced color properties (secondaryContainer, primary, outline, onSurface, error) with Material3-compatible semantics. The migration from MaterialTheme.colorScheme is consistent throughout the file.

feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/component/LoanCard.kt (4)

39-39: LGTM! Import addition supports the theming migration.

The KptTheme import is appropriately added to support the migration from MaterialTheme to the design system's theming.


92-92: Verify DesignToken spacing values match original hardcoded values.

The spacing token replacements require verification of the underlying DesignToken definitions to ensure visual consistency with original hardcoded values. Confirm that:

  • extraSmall = 4.dp
  • small = 8.dp
  • large = 16.dp
  • extraLargeIncreased = 24.dp

This applies to lines 92, 101, 178, and 186 in LoanCard.kt.


82-82: No action needed; preview modifier padding is separate from component content padding.

Lines 82 and 170 (the actual component implementations) both consistently use DesignToken.padding.largeIncreased (20.dp) for internal content padding. Lines 118 and 202 are in @Preview functions and use DesignToken.padding.large (16.dp) for the preview wrapper modifier—this is intentional preview display spacing, not component content padding. The apparent inconsistency does not exist in the production component code.

Likely an incorrect or invalid review comment.


134-134: No issues identified. The default parameter change from MaterialTheme.colorScheme.primary to KptTheme.colorScheme.primary is consistent with the app's design system. KptTheme is the established custom theme used throughout the codebase and is properly initialized in all contexts. The only usage of LoanCardCustom is in the preview function, which correctly uses the new default without requiring any changes.

feature/qr/src/androidMain/kotlin/org/mifos/mobile/feature/qr/CropContent.kt (2)

87-90: Typography migration looks good.

The change from MaterialTheme.typography.labelLarge to KptTheme.typography.labelLarge correctly follows the theming migration pattern.


66-66: Padding value migration is correct.

The change from 16.dp to DesignToken.padding.large is verified. The design token defines large as 16.dp, maintaining the original spacing with no visual changes.

import com.attafitamim.krop.ui.ImageCropperDialog
import org.mifos.mobile.core.designsystem.component.MifosButton
import org.mifos.mobile.core.designsystem.theme.DesignToken
import template.core.base.designsystem.theme.KptTheme
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Check if the feature/qr module exists and its structure
find . -type f -name "CropContent.kt" 2>/dev/null | head -5

Repository: openMF/mifos-mobile

Length of output: 141


🏁 Script executed:

# Find build.gradle files in feature/qr module
fd -t f 'build.gradle' feature/qr 2>/dev/null | head -10

Repository: openMF/mifos-mobile

Length of output: 90


🏁 Script executed:

# Check the actual CropContent.kt file
fd -t f 'CropContent.kt' 2>/dev/null | xargs cat -n 2>/dev/null

Repository: openMF/mifos-mobile

Length of output: 4127


🏁 Script executed:

# Search for KptTheme definition in the codebase
rg -t kotlin 'KptTheme' --max-count 20 2>/dev/null

Repository: openMF/mifos-mobile

Length of output: 50375


🏁 Script executed:

# Read the feature/qr/build.gradle.kts file to verify dependencies
cat feature/qr/build.gradle.kts

Repository: openMF/mifos-mobile

Length of output: 1755


🏁 Script executed:

# Check another feature module's build.gradle.kts for comparison
cat feature/auth/build.gradle.kts | head -50

Repository: openMF/mifos-mobile

Length of output: 1269


🏁 Script executed:

# Check core/qrcode/build.gradle.kts for dependencies
cat core/qrcode/build.gradle.kts | head -60

Repository: openMF/mifos-mobile

Length of output: 1882


🏁 Script executed:

# Check core/ui/build.gradle.kts for dependencies  
cat core/ui/build.gradle.kts | head -60

Repository: openMF/mifos-mobile

Length of output: 2027


🏁 Script executed:

# Search for where core.designsystem or template.core.base.designsystem is explicitly used
rg "projects\.core\.designsystem" --type gradle | head -20

Repository: openMF/mifos-mobile

Length of output: 45


🏁 Script executed:

# Check if there's a convention plugin that adds designsystem automatically
fd -t f 'convention.gradle' -o -name '*convention*.gradle.kts' | xargs cat | grep -A5 -B5 designsystem | head -50

Repository: openMF/mifos-mobile

Length of output: 293


🏁 Script executed:

# Fix the fd command - search for convention gradle files
fd 'convention' -t f | grep gradle | head -20

Repository: openMF/mifos-mobile

Length of output: 45


🏁 Script executed:

# Search for core-base/designsystem references
rg "core-base" --type gradle | head -20

Repository: openMF/mifos-mobile

Length of output: 45


🏁 Script executed:

# Check gradle settings file for module definitions
cat settings.gradle.kts | grep -i designsystem

Repository: openMF/mifos-mobile

Length of output: 127


🏁 Script executed:

# Find which modules depend on core-base:designsystem
rg "projects\.core\.base\.designsystem\|projects\.coreba" --type gradle | head -20

Repository: openMF/mifos-mobile

Length of output: 45


🏁 Script executed:

# Check if cmp.feature.convention plugin includes core-base:designsystem
find . -name '*.gradle.kts' -path '*/buildLogic/*' -o -name '*.gradle.kts' -path '*/build/*' | xargs grep -l "cmp.feature" 2>/dev/null | head -5

Repository: openMF/mifos-mobile

Length of output: 45


🏁 Script executed:

# List all gradle plugin definitions
find . -type f -name '*.gradle.kts' -path '*/buildLogic/*' 2>/dev/null | head -10

Repository: openMF/mifos-mobile

Length of output: 45


🏁 Script executed:

# Check the build-logic directory structure
find . -type d -name buildLogic -o -name build-logic 2>/dev/null

Repository: openMF/mifos-mobile

Length of output: 76


🏁 Script executed:

# Look for gradle files in common locations
find . -path "*/gradle/*" -name "*.gradle.kts" 2>/dev/null | head -20

Repository: openMF/mifos-mobile

Length of output: 45


🏁 Script executed:

# Check settings.gradle.kts to see if it includes buildLogic
cat settings.gradle.kts | head -30

Repository: openMF/mifos-mobile

Length of output: 842


🏁 Script executed:

# List contents of build-logic directory
ls -la build-logic/

Repository: openMF/mifos-mobile

Length of output: 435


🏁 Script executed:

# Find gradle files in build-logic
find build-logic -name "*.gradle.kts" | head -20

Repository: openMF/mifos-mobile

Length of output: 134


🏁 Script executed:

# Check the convention build.gradle.kts
cat build-logic/convention/build.gradle.kts

Repository: openMF/mifos-mobile

Length of output: 3978


🏁 Script executed:

# Look for plugin definitions in convention directory
find build-logic/convention -type f -name "*.kt" | head -20

Repository: openMF/mifos-mobile

Length of output: 1531


🏁 Script executed:

# Check the CMPFeatureConventionPlugin implementation
cat build-logic/convention/src/main/kotlin/CMPFeatureConventionPlugin.kt

Repository: openMF/mifos-mobile

Length of output: 3409


🏁 Script executed:

# Check if core-base:designsystem is included somewhere or if it's missing
rg "core.base.designsystem\|core-base.*designsystem" --type gradle | head -20

Repository: openMF/mifos-mobile

Length of output: 45


🏁 Script executed:

# Verify the package path of KptTheme definition
cat core-base/designsystem/src/commonMain/kotlin/template/core/base/designsystem/theme/KptColorSchemeImpl.kt | head -30

Repository: openMF/mifos-mobile

Length of output: 1329


Add explicit dependency for KptTheme module.

The feature/qr module imports KptTheme from template.core.base.designsystem.theme, but the core-base:designsystem module is not declared as a dependency in build.gradle.kts. Add the explicit dependency to ensure proper module resolution and avoid relying on transitive dependencies:

implementation(projects.core.base.designsystem)
🤖 Prompt for AI Agents
In feature/qr/src/androidMain/kotlin/org/mifos/mobile/feature/qr/CropContent.kt
around line 36, the file imports KptTheme from
template.core.base.designsystem.theme but the feature/qr module doesn't declare
the core-base:designsystem dependency; open feature/qr/build.gradle.kts and add
implementation(projects.core.base.designsystem) inside the dependencies block
(alongside other implementation entries) so the module is explicitly referenced
and resolves correctly.

@biplab1 biplab1 marked this pull request as draft December 19, 2025 14:11
@biplab1
Copy link
Contributor Author

biplab1 commented Dec 19, 2025

DesignToken ↔ KptTheme Parameter Mapping

This document maps DesignToken parameters to their closest equivalents in KptTheme, focusing on Shapes, Spacing, Padding, Sizes and Elevations.

Key Constraints

  • KptTheme does not have a Padding system
  • KptTheme does not have a Sizes system
  • Padding in DesignToken must be mapped to KptTheme.spacing
  • Mapping is lossy in several places due to different abstraction levels

1. Shapes Mapping

DesignToken (AppShapes) Value (dp) KptTheme (KptShapes) Value (dp) Notes
none 0 ❌ Not available No sharp-corner equivalent in KptTheme
extraSmall 4 extraSmall 4 Direct match
small 8 small 8 Direct match
medium 12 medium 12 Direct match
large 16 large 16 Direct match
largeIncreased 20 ❌ Not available No 20dp shape
extraLarge 28 extraLarge 28 Direct match
extraLargeIncreased 32 ❌ Not available No 32dp shape
extraExtraLarge 48 ❌ Not available No 48dp shape
full 1000 ❌ Not available Capsule shape not modeled
circle 50% ❌ Not available No circle abstraction
bottomSheet 24 (top only) ❌ Not available Component-specific
topBar 16 (bottom only) ❌ Not available Component-specific

Conclusion:
KptShapes is a strict subset of AppShapes.


2. Spacing Mapping (Primary Shared Axis)

DesignToken (AppSpacing) Value (dp) KptTheme (KptSpacing) Value (dp) Match Type
none 0 ❌ Not available No zero spacing token
extraSmall 4 xs 4 Exact
small 8 sm 8 Exact
medium 12 ❌ Not available 12dp missing
large 16 md 16 Semantic match
largeIncreased 20 ❌ Not available Gap
extraLarge 28 ❌ Not available Gap
extraLargeIncreased 32 xl 32 Exact
extraExtraLarge 48 ❌ Not available Gap
full 1000 ❌ Not available No equivalent
lg 24 Exists only in KptTheme
xxl 64 Exists only in KptTheme

Conclusion:
DesignToken.spacing is more granular, while KptTheme.spacing is coarser and opinionated.


3. Padding Mapping (DesignToken → KptTheme.spacing)

Important: KptTheme has no padding system.
All padding values must be derived from KptTheme.spacing.

DesignToken (AppPadding) Value (dp) Use KptTheme Equivalent
none 0 No zero spacing
extraSmall 4 spacing.xs Exact
small 8 spacing.sm Exact
medium 12 No equivalent
large 16 spacing.md Exact
largeIncreased 20 No equivalent
extraLarge 28 No equivalent
extraLargeIncreased 32 spacing.xl Exact
extraExtraLarge 48 No equivalent
full 1000 No equivalent

Conclusion:
Padding → Spacing is a forced but practical abstraction, with loss of expressiveness.


4. Sizes Mapping

DesignToken (AppSizes) Value (dp) KptTheme Equivalent Notes
iconMiny 12 No size tokens
iconSmall 16
iconMedium 24
iconLarge 32
iconExtraLarge 36
avatarSmall 32
avatarMedium 48
avatarLarge 64
buttonHeight 56
inputHeight 56
cardMinHeight 120
profile 72
headerToContentHeight 28

Conclusion:
AppSizes has no conceptual home in KptTheme and must remain DesignToken-only.


5. Elevation Mapping

Both systems define elevation, but they differ conceptually and semantically.

  • DesignToken models elevation as semantic intent
  • KptTheme models elevation as Material-style discrete levels

Elevation Token Comparison

DesignToken (AppElevation) Value (dp) KptTheme (KptElevation) Value (dp) Mapping Notes
none 0 level0 0 Direct match
elevation 25 ❌ No exact match Higher than any KptTheme level
level1 1 Exists only in KptTheme
level2 3 Exists only in KptTheme
level3 6 Exists only in KptTheme
level4 8 Exists only in KptTheme
level5 12 Exists only in KptTheme

Overall Summary

  • Shapes: Partial overlap (KptTheme ⊂ DesignToken)
  • Spacing: Closest shared abstraction, but DesignToken is richer
  • Padding: Must map to KptTheme.spacing (lossy mapping)
  • Sizes: Exclusive to DesignToken
  • Elevation: Partial overlap; KptTheme provides granular layered levels, while DesignToken exposes only coarse, high-intent elevation values that cannot be mapped 1:1

This explains why mixing DesignToken and KptTheme in feature modules is sometimes unavoidable without expanding KptTheme’s surface area.

@biplab1 biplab1 force-pushed the MM-389-replace-materialtheme-with-kptmaterialtheme branch from a1e4296 to 2236195 Compare December 23, 2025 13:25
@biplab1 biplab1 force-pushed the MM-389-replace-materialtheme-with-kptmaterialtheme branch from 60b5e8d to 74fd263 Compare December 23, 2025 14:40
@biplab1 biplab1 marked this pull request as ready for review December 23, 2025 15:24
Copy link
Contributor

@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: 8

Caution

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

⚠️ Outside diff range comments (2)
feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/otpAuthentication/OtpAuthenticationScreen.kt (1)

265-265: Complete the spacing token migration.

This line still uses DesignToken.spacing.medium while the rest of the file has migrated to KptTheme tokens. For consistency, use KptTheme.spacing.md.

🔎 Proposed fix
         Column(
-            verticalArrangement = Arrangement.spacedBy(DesignToken.spacing.medium),
+            verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
         ) {
core/designsystem/src/commonMain/kotlin/org/mifos/mobile/core/designsystem/theme/DesignToken.kt (1)

426-441: Missing LocalStrokes in DesignTokenTheme provider.

LocalStrokes is declared at line 386 but is not provided in DesignTokenTheme. This means DesignToken.strokes will always return the default AppStrokes() and cannot be customized via the theme. For consistency with other tokens, add LocalStrokes to the provider.

🔎 Proposed fix
 @Composable
 internal fun DesignTokenTheme(
     spacing: AppSpacing = AppSpacing(),
     padding: AppPadding = AppPadding(),
     shapes: AppShapes = AppShapes(),
     elevation: AppElevation = AppElevation(),
     sizes: AppSizes = AppSizes(),
+    strokes: AppStrokes = AppStrokes(),
     content: @Composable () -> Unit,
 ) {
     CompositionLocalProvider(
         LocalSpacing provides spacing,
         LocalPadding provides padding,
         LocalShapes provides shapes,
         LocalElevation provides elevation,
         LocalSizes provides sizes,
+        LocalStrokes provides strokes,
         content = content,
     )
 }
♻️ Duplicate comments (3)
feature/onboarding-language/src/commonMain/kotlin/org/mifos/mobile/feature/onboarding/language/SetOnboardingLanguageScreen.kt (1)

169-171: Fix compilation error: missing parameter name in copy().

The copy() method requires the parameter name color = before the value. This issue was already flagged in a previous review.

🔎 Apply this diff to fix the compilation error:
 unselectedTextStyle = MifosTypography.titleSmallEmphasized.copy(
-    KptTheme.colorScheme.onSurface,
+    color = KptTheme.colorScheme.onSurface,
 ),
feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/theme/ChangeThemeScreen.kt (1)

111-113: Critical: Missing parameter name in .copy() call.

This issue was already flagged in a previous review: Line 112 is missing the color = parameter name. The .copy() method on TextStyle requires named parameters in Compose, which will cause a compilation error.

🔎 Apply this diff to fix the syntax error
 unselectedTextStyle = MifosTypography.titleSmallEmphasized.copy(
-    KptTheme.colorScheme.onSurface,
+    color = KptTheme.colorScheme.onSurface,
 ),
feature/qr/src/androidMain/kotlin/org/mifos/mobile/feature/qr/CropContent.kt (1)

36-36: Dependency issue already flagged in previous review.

As noted in the prior review, the feature/qr module imports KptTheme but lacks an explicit dependency on core-base:designsystem in its build.gradle.kts. Please ensure this dependency is added.

🧹 Nitpick comments (17)
feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/component/TermsAndConditionItem.kt (1)

36-50: Consider simplifying the spacing pattern.

The Column uses Arrangement.spacedBy for inter-child spacing and then adds a trailing Spacer for bottom padding. While functional, this pattern mixes two spacing approaches.

Consider one of these alternatives for clarity:

  • Apply bottom padding directly to the Column modifier: modifier.padding(bottom = KptTheme.spacing.sm)
  • Let the parent layout handle spacing between terms items
🔎 Alternative approach using padding
     Column(
-        modifier = modifier,
+        modifier = modifier.padding(bottom = KptTheme.spacing.sm),
         verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.sm),
     ) {
         Text(
             text = stringResource(title),
             style = MifosTypography.titleSmallEmphasized,
         )

         Text(
             text = stringResource(description),
             style = MifosTypography.bodySmall,
         )
-        Spacer(modifier = Modifier.height(KptTheme.spacing.sm))
     }
feature/savings-account/src/commonMain/kotlin/org/mifos/mobile/feature/savingsaccount/savingsAccountUpdate/AccountUpdateScreen.kt (1)

192-194: Consider aligning padding tokens for consistency.

Line 192 migrates to KptTheme.spacing.md, but line 193 still uses DesignToken.padding.medium for top padding. This mixes both token systems in sequential modifiers. Since the PR objectives indicate padding should be mapped to KptTheme.spacing (as KptTheme lacks a dedicated padding system), consider migrating line 193 as well for consistency.

🔎 Suggested alignment

If the intent is to apply uniform spacing on all sides plus additional top padding, and both values can be expressed via KptTheme.spacing:

 .padding(KptTheme.spacing.md)
-.padding(top = DesignToken.padding.medium)
+.padding(top = KptTheme.spacing.md)

Alternatively, if the top padding intentionally requires a value not available in KptTheme (e.g., 12dp or 20dp per PR constraints), then retaining DesignToken.padding.medium is appropriate and this comment can be disregarded.

feature/passcode/src/commonMain/kotlin/org/mifos/mobile/feature/passcode/verifyPasscode/VerifyPasscodeScreen.kt (1)

111-111: Consider using KptTheme.spacing.lg for consistency.

Per PR objectives, KptTheme.spacing.lg maps to 24dp. Using KptTheme.spacing.lg here would maintain consistency with other spacing tokens in this file that use KptTheme.

🔎 Suggested change
-                Spacer(modifier = Modifier.height(DesignToken.spacing.dp24))
+                Spacer(modifier = Modifier.height(KptTheme.spacing.lg))
feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/otpAuthentication/OtpAuthenticationScreen.kt (1)

282-282: Inconsistent typography token usage.

This is the only text style in the file that uses KptTheme.typography.labelLarge while all other text styles use MifosTypography.* (lines 159, 167, 175, 214, 243, 298, 310, 322). Consider using MifosTypography.labelLarge for consistency unless there's a specific reason to prefer KptTheme here.

🔎 Proposed fix for consistency
                 Text(
                     text = stringResource(Res.string.feature_common_cancel),
-                    style = KptTheme.typography.labelLarge,
+                    style = MifosTypography.labelLarge,
                 )
feature/passcode/src/commonMain/kotlin/org/mifos/mobile/feature/passcode/PasscodeScreen.kt (1)

118-118: Use KptTheme.spacing.lg for consistency.

The rest of the file uses KptTheme.spacing.* tokens, but this line uses DesignToken.spacing.dp24. Per the mapping discussion, KptTheme.spacing.lg equals 24dp, so this can be unified.

🔎 Suggested fix
-                Spacer(modifier = Modifier.height(DesignToken.spacing.dp24))
+                Spacer(modifier = Modifier.height(KptTheme.spacing.lg))
feature/beneficiary/src/commonMain/kotlin/org/mifos/mobile/feature/beneficiary/beneficiaryApplication/BeneficiaryApplicationContent.kt (1)

159-159: Optional: Consider typography consistency.

Line 159 correctly retains DesignToken.sizes.buttonHeight since KptTheme lacks size tokens (as documented in PR comments).

However, line 182 still uses MifosTypography rather than KptTheme.typography. If the PR goal includes migrating typography references to KptTheme, this instance may have been missed. If MifosTypography already delegates to KptTheme or if typography migration is out of scope here, this can be ignored.

Also applies to: 182-182

feature/recent-transaction/src/commonMain/kotlin/org/mifos/mobile/feature/recent/transaction/screen/RecentTransactionScreen.kt (4)

211-211: Inconsistent token usage for padding.

The horizontal padding uses KptTheme.spacing.md (16dp) while the vertical padding uses DesignToken.padding.medium (12dp). While this may be intentional for asymmetric padding, mixing token sources for the same modifier type can reduce maintainability. Consider using consistent token sources or adding a comment clarifying the intent.


377-377: Hardcoded colors may break dark mode support.

Color.White is hardcoded for the card container. This could cause visual issues in dark mode and is inconsistent with the theming migration. Consider using KptTheme.colorScheme.surface or KptTheme.colorScheme.surfaceContainer instead.

🔎 Proposed fix
-                colors = CardDefaults.cardColors(containerColor = Color.White),
+                colors = CardDefaults.cardColors(containerColor = KptTheme.colorScheme.surface),

403-403: Hardcoded Color.Black for icon tint.

Similar to the card color, using a hardcoded black tint may cause accessibility issues in dark mode. Consider using KptTheme.colorScheme.onSurface for proper theme adaptation.

🔎 Proposed fix
-                        tint = Color.Black,
+                        tint = KptTheme.colorScheme.onSurface,

413-413: Hardcoded background color in DropdownMenu.

The Color.White background should be replaced with a theme-aware color for dark mode compatibility.

🔎 Proposed fix
-                    .background(Color.White),
+                    .background(KptTheme.colorScheme.surface),
core/designsystem/src/commonMain/kotlin/org/mifos/mobile/core/designsystem/theme/DesignToken.kt (2)

330-330: Unusual fractional dp value.

boxDp107 = 107.33333.dp is an unusual fractional value. While Compose handles this, fractional dp values can cause subpixel rendering inconsistencies across different screen densities. Consider rounding to a whole number (107.dp) unless there's a specific design requirement.


99-104: Consider semantic naming for custom tokens.

The new custom tokens use numeric naming (e.g., dp6, dp24, imageDp48). While this is clear for values, it couples the token name to its implementation. If the design system evolves and values change, the names become misleading. Consider adding semantic aliases for frequently-used custom tokens (e.g., formFieldSpacing for dp24) in future iterations.

Also applies to: 152-156, 212-215, 254-255, 316-332

feature/share-account/src/commonMain/kotlin/org/mifos/mobile/feature/shareaccount/shareAccount/ShareAccountScreen.kt (1)

254-254: Consider using KptTheme.spacing.md for consistency.

Line 254 uses DesignToken.spacing.medium (16dp), while line 200 migrated to KptTheme.spacing.md (also 16dp). For consistency with the KptTheme migration strategy in this file, consider replacing this with KptTheme.spacing.md.

🔎 Proposed change
-                Spacer(modifier = Modifier.height(DesignToken.spacing.medium))
+                Spacer(modifier = Modifier.height(KptTheme.spacing.md))
feature/qr/src/commonMain/kotlin/org/mifos/mobile/feature/qr/qr/QrCodeReaderScreen.kt (3)

148-149: Consider consolidating padding modifiers for clarity.

The current pattern applies padding to all sides, then adds additional top padding via a second modifier. While functionally correct, it can be less obvious at a glance. Consider using a single padding call with explicit side parameters if the intent is asymmetric padding.

🔎 Alternative approach
-                .padding(KptTheme.spacing.md)
-                .padding(top = KptTheme.spacing.md),
+                .padding(
+                    horizontal = KptTheme.spacing.md,
+                    top = KptTheme.spacing.md * 2,
+                    bottom = KptTheme.spacing.md
+                ),

Note: This assumes the intent is 32dp top and 16dp on other sides. Adjust if different spacing is needed.


172-172: Transparent border appears unnecessary.

The border is styled with Color.Transparent, which renders it invisible and without functional purpose. Consider removing the border modifier entirely, or clarify the intent if this is needed for layout calculations or future styling.

🔎 Proposed simplification
                        .clip(KptTheme.shapes.medium)
                        .drawQrCorners()
-                        .border(DesignToken.strokes.thin, Color.Transparent, KptTheme.shapes.medium),

244-253: TODO: Hardcoded dp values remain in drawQrCorners.

The TODO comment indicates that replacing these hardcoded values (5dp, 40dp, 50dp, 200dp) with DesignToken values encountered "some error." These custom values don't align with standard design tokens and leave technical debt.

Consider either:

  1. Debugging the error to complete the token migration
  2. Adding custom tokens to DesignToken for these specific QR corner drawing values
  3. Documenting why these specific pixel values are required for QR code rendering

Do you want me to help investigate potential token replacements or create a follow-up issue to track this work?

feature/loan-account/src/commonMain/kotlin/org/mifos/mobile/feature/loanaccount/loanAccount/LoanAccountScreen.kt (1)

285-293: Reconsider color semantics for withdrawn and matured loan statuses.

The mapping of KptTheme.colorScheme.error (Material Design red) to WITHDRAWN and MATURED statuses is semantically problematic:

  • WITHDRAWN ("Withdrawn by applicant") represents a user action, not a system error
  • MATURED represents normal loan completion, not a failure state

Similarly, KptTheme.colorScheme.onSurface is a text color meant for foreground content, not a status indicator. Consider using dedicated status colors (AppColors.customEnable or a neutral variant) that semantically convey withdrawn/matured as non-error states.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0ab48f7 and 5ae413b.

📒 Files selected for processing (71)
  • core/designsystem/src/commonMain/kotlin/org/mifos/mobile/core/designsystem/theme/DesignToken.kt
  • feature/accounts/src/commonMain/kotlin/org/mifos/mobile/feature/accounts/accountTransactions/TransactionScreen.kt
  • feature/accounts/src/commonMain/kotlin/org/mifos/mobile/feature/accounts/accounts/AccountsScreen.kt
  • feature/accounts/src/commonMain/kotlin/org/mifos/mobile/feature/accounts/component/FilterSection.kt
  • feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/login/LoginScreen.kt
  • feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/otpAuthentication/OtpAuthenticationScreen.kt
  • feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/recoverPassword/RecoverPasswordScreen.kt
  • feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/registration/RegistrationScreen.kt
  • feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/setNewPassword/SetPasswordScreen.kt
  • feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/uploadId/UploadIdScreen.kt
  • feature/beneficiary/src/commonMain/kotlin/org/mifos/mobile/feature/beneficiary/beneficiaryApplication/BeneficiaryApplicationContent.kt
  • feature/beneficiary/src/commonMain/kotlin/org/mifos/mobile/feature/beneficiary/beneficiaryApplicationConfirmation/BeneficiaryApplicationConfirmationScreen.kt
  • feature/beneficiary/src/commonMain/kotlin/org/mifos/mobile/feature/beneficiary/beneficiaryDetail/BeneficiaryDetailContent.kt
  • feature/beneficiary/src/commonMain/kotlin/org/mifos/mobile/feature/beneficiary/beneficiaryList/BeneficiaryListScreen.kt
  • feature/client-charge/src/commonMain/kotlin/org/mifos/mobile/feature/charge/chargeDetails/ChargeDetailScreen.kt
  • feature/client-charge/src/commonMain/kotlin/org/mifos/mobile/feature/charge/charges/ClientChargeScreen.kt
  • feature/client-charge/src/commonMain/kotlin/org/mifos/mobile/feature/charge/components/ClientChargeItem.kt
  • feature/guarantor/src/commonMain/kotlin/org/mifos/mobile/feature/guarantor/screens/guarantorAdd/AddGuarantorScreen.kt
  • feature/guarantor/src/commonMain/kotlin/org/mifos/mobile/feature/guarantor/screens/guarantorDetails/GuarantorDetailContent.kt
  • feature/guarantor/src/commonMain/kotlin/org/mifos/mobile/feature/guarantor/screens/guarantorList/GuarantorListScreen.kt
  • feature/home/src/commonMain/kotlin/org/mifos/mobile/feature/home/HomeScreen.kt
  • feature/home/src/commonMain/kotlin/org/mifos/mobile/feature/home/components/BottomSheetContent.kt
  • feature/loan-account/src/commonMain/kotlin/org/mifos/mobile/feature/loanaccount/component/AccountSummaryCard.kt
  • feature/loan-account/src/commonMain/kotlin/org/mifos/mobile/feature/loanaccount/component/RepaymentPeriodCard.kt
  • feature/loan-account/src/commonMain/kotlin/org/mifos/mobile/feature/loanaccount/loanAccount/LoanAccountScreen.kt
  • feature/loan-account/src/commonMain/kotlin/org/mifos/mobile/feature/loanaccount/loanAccountDetails/LoanAccountDetailsScreen.kt
  • feature/loan-account/src/commonMain/kotlin/org/mifos/mobile/feature/loanaccount/loanAccountRepaymentSchedule/RepaymentScheduleScreen.kt
  • feature/loan-account/src/commonMain/kotlin/org/mifos/mobile/feature/loanaccount/loanAccountSummary/AccountSummaryScreen.kt
  • feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/component/ApplyLoanBottomBar.kt
  • feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/component/ConfirmDetailsCard.kt
  • feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/component/LoanCard.kt
  • feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/component/TermsAndConditionItem.kt
  • feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/confirmDetails/ConfirmDetailsScreen.kt
  • feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/loanApplication/LoanApplyScreen.kt
  • feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/loanProductDescription/LoanProductDetailsScren.kt
  • feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/loanType/SelectLoanTypeSceen.kt
  • feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/uploadDocs/UploadDocsScreen.kt
  • feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/uploadDocs/component/BottomSheetContent.kt
  • feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.kt
  • feature/notification/src/commonMain/kotlin/org/mifos/mobile/feature/notification/NotificationScreen.kt
  • feature/onboarding-language/src/commonMain/kotlin/org/mifos/mobile/feature/onboarding/language/SetOnboardingLanguageScreen.kt
  • feature/passcode/src/commonMain/kotlin/org/mifos/mobile/feature/passcode/PasscodeScreen.kt
  • feature/passcode/src/commonMain/kotlin/org/mifos/mobile/feature/passcode/verifyPasscode/VerifyPasscodeScreen.kt
  • feature/qr/src/androidMain/kotlin/org/mifos/mobile/feature/qr/CropContent.kt
  • feature/qr/src/androidMain/kotlin/org/mifos/mobile/feature/qr/Dialogs.kt
  • feature/qr/src/commonMain/kotlin/org/mifos/mobile/feature/qr/qr/QrCodeReaderScreen.kt
  • feature/qr/src/commonMain/kotlin/org/mifos/mobile/feature/qr/qrCodeDisplay/QrCodeDisplayScreen.kt
  • feature/recent-transaction/src/commonMain/kotlin/org/mifos/mobile/feature/recent/transaction/screen/RecentTransactionScreen.kt
  • feature/savings-account/src/commonMain/kotlin/org/mifos/mobile/feature/savingsaccount/savingsAccount/SavingsAccountScreen.kt
  • feature/savings-account/src/commonMain/kotlin/org/mifos/mobile/feature/savingsaccount/savingsAccountDetails/SavingsAccountDetailsScreen.kt
  • feature/savings-account/src/commonMain/kotlin/org/mifos/mobile/feature/savingsaccount/savingsAccountUpdate/AccountUpdateScreen.kt
  • feature/savings-account/src/commonMain/kotlin/org/mifos/mobile/feature/savingsaccount/savingsAccountWithdraw/AccountWithdrawScreen.kt
  • feature/savings-application/src/commonMain/kotlin/org/mifos/mobile/feature/savings/application/fillApplication/FillApplicationScreen.kt
  • feature/savings-application/src/commonMain/kotlin/org/mifos/mobile/feature/savings/application/savingsApplication/SavingsApplyScreen.kt
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/about/AboutScreen.kt
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/appInfo/AppInfoScreen.kt
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/componenets/MifosLogoutDilaog.kt
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/faq/FaqScreen.kt
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/help/HelpScreen.kt
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/language/LanguageScreen.kt
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/passcode/UpdatePasscodeScreen.kt
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/password/ChangePasswordScreen.kt
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/settings/SettingsScreen.kt
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/theme/ChangeThemeScreen.kt
  • feature/share-account/src/commonMain/kotlin/org/mifos/mobile/feature/shareaccount/shareAccount/ShareAccountScreen.kt
  • feature/share-application/src/commonMain/kotlin/org/mifos/mobile/feature/share/application/fillApplication/FillApplicationScreen.kt
  • feature/share-application/src/commonMain/kotlin/org/mifos/mobile/feature/share/application/shareApplication/ShareApplyScreen.kt
  • feature/status/src/commonMain/kotlin/org/mifos/mobile/feature/status/Components.kt
  • feature/third-party-transfer/src/commonMain/kotlin/org/mifos/mobile/feature/third/party/transfer/thirdPartyTransfer/TptScreen.kt
  • feature/transfer-process/src/commonMain/kotlin/org/mifos/mobile/feature/transfer/process/makeTransfer/MakeTransferScreen.kt
  • feature/transfer-process/src/commonMain/kotlin/org/mifos/mobile/feature/transfer/process/transferProcess/TransferProcessScreen.kt
🚧 Files skipped from review as they are similar to previous changes (26)
  • feature/client-charge/src/commonMain/kotlin/org/mifos/mobile/feature/charge/chargeDetails/ChargeDetailScreen.kt
  • feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/registration/RegistrationScreen.kt
  • feature/loan-account/src/commonMain/kotlin/org/mifos/mobile/feature/loanaccount/loanAccountDetails/LoanAccountDetailsScreen.kt
  • feature/beneficiary/src/commonMain/kotlin/org/mifos/mobile/feature/beneficiary/beneficiaryDetail/BeneficiaryDetailContent.kt
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/help/HelpScreen.kt
  • feature/savings-application/src/commonMain/kotlin/org/mifos/mobile/feature/savings/application/fillApplication/FillApplicationScreen.kt
  • feature/client-charge/src/commonMain/kotlin/org/mifos/mobile/feature/charge/components/ClientChargeItem.kt
  • feature/location/src/commonMain/kotlin/org/mifos/mobile/feature/location/LocationScreen.kt
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/language/LanguageScreen.kt
  • feature/savings-account/src/commonMain/kotlin/org/mifos/mobile/feature/savingsaccount/savingsAccountWithdraw/AccountWithdrawScreen.kt
  • feature/savings-account/src/commonMain/kotlin/org/mifos/mobile/feature/savingsaccount/savingsAccount/SavingsAccountScreen.kt
  • feature/qr/src/commonMain/kotlin/org/mifos/mobile/feature/qr/qrCodeDisplay/QrCodeDisplayScreen.kt
  • feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/uploadId/UploadIdScreen.kt
  • feature/guarantor/src/commonMain/kotlin/org/mifos/mobile/feature/guarantor/screens/guarantorAdd/AddGuarantorScreen.kt
  • feature/beneficiary/src/commonMain/kotlin/org/mifos/mobile/feature/beneficiary/beneficiaryList/BeneficiaryListScreen.kt
  • feature/share-application/src/commonMain/kotlin/org/mifos/mobile/feature/share/application/fillApplication/FillApplicationScreen.kt
  • feature/third-party-transfer/src/commonMain/kotlin/org/mifos/mobile/feature/third/party/transfer/thirdPartyTransfer/TptScreen.kt
  • feature/savings-account/src/commonMain/kotlin/org/mifos/mobile/feature/savingsaccount/savingsAccountDetails/SavingsAccountDetailsScreen.kt
  • feature/guarantor/src/commonMain/kotlin/org/mifos/mobile/feature/guarantor/screens/guarantorList/GuarantorListScreen.kt
  • feature/transfer-process/src/commonMain/kotlin/org/mifos/mobile/feature/transfer/process/makeTransfer/MakeTransferScreen.kt
  • feature/qr/src/androidMain/kotlin/org/mifos/mobile/feature/qr/Dialogs.kt
  • feature/notification/src/commonMain/kotlin/org/mifos/mobile/feature/notification/NotificationScreen.kt
  • feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/uploadDocs/component/BottomSheetContent.kt
  • feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/about/AboutScreen.kt
  • feature/loan-account/src/commonMain/kotlin/org/mifos/mobile/feature/loanaccount/component/RepaymentPeriodCard.kt
  • feature/accounts/src/commonMain/kotlin/org/mifos/mobile/feature/accounts/component/FilterSection.kt

Comment on lines +149 to +150
.padding(KptTheme.spacing.md)
.padding(top = KptTheme.spacing.md),
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

git log -p --all -- feature/accounts/src/commonMain/kotlin/org/mifos/mobile/feature/accounts/accounts/AccountsScreen.kt | grep -B 5 -A 15 "padding" | head -100

Repository: openMF/mifos-mobile

Length of output: 182


🏁 Script executed:

cat -n feature/accounts/src/commonMain/kotlin/org/mifos/mobile/feature/accounts/accounts/AccountsScreen.kt | sed -n '140,160p'

Repository: openMF/mifos-mobile

Length of output: 885


🏁 Script executed:

# Also search for similar double-padding patterns in the codebase
rg '\.padding\(' feature/accounts/src/commonMain/kotlin/org/mifos/mobile/feature/accounts/accounts/AccountsScreen.kt -A 1 -B 1

Repository: openMF/mifos-mobile

Length of output: 212


🏁 Script executed:

# Find KptTheme.spacing definitions to confirm spacing values
fd -e kt -e kts | xargs grep -l "spacing\s*=" | head -5

Repository: openMF/mifos-mobile

Length of output: 448


🏁 Script executed:

grep -n "spacing" core/designsystem/src/commonMain/kotlin/org/mifos/mobile/core/designsystem/theme/Theme.kt | head -20

Repository: openMF/mifos-mobile

Length of output: 168


🏁 Script executed:

grep -n "val md\|spacing.md\|\.md\s*=" core/designsystem/src/commonMain/kotlin/org/mifos/mobile/core/designsystem/theme/DesignToken.kt | head -30

Repository: openMF/mifos-mobile

Length of output: 45


🏁 Script executed:

# Search for the specific pattern of double padding in the codebase
rg '\.padding\([^)]+\)\s*\.\s*padding\(' feature/ core/ -A 2 -B 2 | head -50

Repository: openMF/mifos-mobile

Length of output: 45


🏁 Script executed:

cat -n core/designsystem/src/commonMain/kotlin/org/mifos/mobile/core/designsystem/theme/DesignToken.kt | head -150

Repository: openMF/mifos-mobile

Length of output: 6504


🏁 Script executed:

# Look for where spacing values are defined
rg "val\s+spacing|object.*spacing" core/designsystem/src/commonMain/kotlin/org/mifos/mobile/core/designsystem/theme/ -A 5

Repository: openMF/mifos-mobile

Length of output: 772


🏁 Script executed:

# Search for similar Column padding patterns in feature/accounts
rg "Column\(" feature/accounts/src/commonMain/kotlin/org/mifos/mobile/feature/accounts/ -A 8 | head -80

Repository: openMF/mifos-mobile

Length of output: 10825


🏁 Script executed:

rg "object KptTheme|val spacing" core/designsystem/ -A 3 | head -40

Repository: openMF/mifos-mobile

Length of output: 532


🏁 Script executed:

# Search for KptTheme in the entire codebase
fd -e kt | xargs grep -l "object KptTheme" | head -5

Repository: openMF/mifos-mobile

Length of output: 167


🏁 Script executed:

# Look for md property definition
rg "\.md\s*=" core/ feature/ -B 2 -A 1 | grep -A 3 "spacing"

Repository: openMF/mifos-mobile

Length of output: 45


🏁 Script executed:

find . -name "*.kt" -type f | xargs grep -l "KptTheme\s*=" | head -10

Repository: openMF/mifos-mobile

Length of output: 45


🏁 Script executed:

# Search for KptTheme directly
rg "KptTheme\s*=" -t kt | head -20

Repository: openMF/mifos-mobile

Length of output: 89


🏁 Script executed:

# Look for where md is defined in spacing context
rg "val md\|\.md\s*=" -t kt -B 2 | grep -B 5 "spacing" | head -40

Repository: openMF/mifos-mobile

Length of output: 89


🏁 Script executed:

# Find where KptTheme is imported/defined
grep -r "KptTheme" feature/accounts/src/commonMain/kotlin/org/mifos/mobile/feature/accounts/accounts/AccountsScreen.kt | head -5

Repository: openMF/mifos-mobile

Length of output: 207


🏁 Script executed:

# Get imports from AccountsScreen.kt
head -50 feature/accounts/src/commonMain/kotlin/org/mifos/mobile/feature/accounts/accounts/AccountsScreen.kt | grep -i "import"

Repository: openMF/mifos-mobile

Length of output: 2392


🏁 Script executed:

# Find KptTheme definition anywhere in the repo
find . -type f -name "*.kt" | xargs grep "object KptTheme\|val KptTheme\|KptTheme =" 2>/dev/null | head -10

Repository: openMF/mifos-mobile

Length of output: 187


🏁 Script executed:

cat core-base/designsystem/src/commonMain/kotlin/template/core/base/designsystem/theme/KptColorSchemeImpl.kt | head -200

Repository: openMF/mifos-mobile

Length of output: 7654


Simplify redundant padding modifier.

The chained padding() calls result in inconsistent spacing: 32dp on top (16dp + 16dp) and 16dp on other sides. This pattern doesn't appear elsewhere in the codebase. Use a single .padding(KptTheme.spacing.md) call or explicitly specify all sides if 32dp top was intended: .padding(horizontal = KptTheme.spacing.md, vertical = KptTheme.spacing.xl).

🤖 Prompt for AI Agents
In
feature/accounts/src/commonMain/kotlin/org/mifos/mobile/feature/accounts/accounts/AccountsScreen.kt
around lines 149-150, the chained .padding(KptTheme.spacing.md).padding(top =
KptTheme.spacing.md) creates inconsistent top spacing (double 16dp) — replace
the chained calls with a single .padding(KptTheme.spacing.md) to make all sides
consistent, or if the intent was a larger top padding, replace with an explicit
call such as .padding(horizontal = KptTheme.spacing.md, vertical =
KptTheme.spacing.xl) so spacing is unambiguous.

Spacer(Modifier.height(DesignToken.spacing.largeIncreased))

HorizontalDivider(modifier = Modifier.height(1.dp))
HorizontalDivider(modifier = Modifier.height(DesignToken.strokes.thin))
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find DesignToken file
fd -e kt -e kts | xargs rg -l "DesignToken" | grep -i "design\|token"

Repository: openMF/mifos-mobile

Length of output: 758


🏁 Script executed:

#!/bin/bash
# Search for strokes definition in Kotlin files
rg -n "strokes" --type kotlin -C 3

Repository: openMF/mifos-mobile

Length of output: 26698


🏁 Script executed:

#!/bin/bash
# Look for DesignToken object/class definition
fd -e kt | xargs rg -n "object DesignToken|class DesignToken" -A 20

Repository: openMF/mifos-mobile

Length of output: 2589


🏁 Script executed:

cat -n core/designsystem/src/commonMain/kotlin/org/mifos/mobile/core/designsystem/theme/DesignToken.kt

Repository: openMF/mifos-mobile

Length of output: 19868


DesignToken.strokes.thin is properly defined with value 1.dp. The migration from hard-coded sizing is a good semantic improvement.

However, note that LocalStrokes is not provided in the DesignTokenTheme composable (lines 434-441), unlike other design tokens. This means stroke values cannot be customized through the theme, though the defaults will still function correctly.

🤖 Prompt for AI Agents
In
feature/accounts/src/commonMain/kotlin/org/mifos/mobile/feature/accounts/accounts/AccountsScreen.kt
around line 167, you use DesignToken.strokes.thin but the DesignTokenTheme
(lines 434-441) does not provide LocalStrokes, so stroke values can't be
overridden via the theme; fix by updating the DesignTokenTheme composable to
provide LocalStrokes (backed by the current theme strokes instance), add a
strokes parameter/default to DesignTokenTheme so callers can override strokes,
and wrap content with CompositionLocalProvider(LocalStrokes provides strokes)
while keeping the existing defaults unchanged.

style = MifosTypography.headlineMedium,
)

Spacer(modifier = Modifier.height(DesignToken.spacing.medium))
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Inconsistent spacing token usage.

These lines still use DesignToken.spacing.medium while the rest of the file has been migrated to KptTheme.spacing.md for equivalent spacing. This creates inconsistency in the design system migration.

🔎 Proposed fix
-                    Spacer(modifier = Modifier.height(DesignToken.spacing.medium))
+                    Spacer(modifier = Modifier.height(KptTheme.spacing.md))

Apply the same change to both occurrences at lines 162 and 170.

Also applies to: 170-170

🤖 Prompt for AI Agents
In
feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/otpAuthentication/OtpAuthenticationScreen.kt
around lines 162 and 170, the Spacer usages still reference
DesignToken.spacing.medium while the rest of the file uses KptTheme.spacing.md;
update both occurrences to use KptTheme.spacing.md to make spacing tokens
consistent with the migrated design system.

)

Spacer(modifier = Modifier.height(24.dp))
Spacer(modifier = Modifier.height(DesignToken.spacing.dp24))
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Use KptTheme.spacing.lg for 24dp spacing.

According to the PR objectives, DesignToken.spacing.dp24 (24dp) maps directly to KptTheme.spacing.lg. This line should be migrated to use the KptTheme equivalent.

🔎 Proposed fix
-                    Spacer(modifier = Modifier.height(DesignToken.spacing.dp24))
+                    Spacer(modifier = Modifier.height(KptTheme.spacing.lg))
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Spacer(modifier = Modifier.height(DesignToken.spacing.dp24))
Spacer(modifier = Modifier.height(KptTheme.spacing.lg))
🤖 Prompt for AI Agents
In
feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/otpAuthentication/OtpAuthenticationScreen.kt
around line 178, replace the hardcoded 24dp spacing that uses
DesignToken.spacing.dp24 with the theme token KptTheme.spacing.lg; update the
Spacer modifier to use KptTheme.spacing.lg so the component follows the theme
spacing mapping instead of the DesignToken constant.

)

Spacer(modifier = Modifier.height(12.dp))
Spacer(modifier = Modifier.height(DesignToken.spacing.medium))
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Find DesignToken and KptTheme spacing definitions to verify consistency

echo "=== Looking for DesignToken definitions (any file) ==="
fd -e kt | head -20 | xargs rg -l "DesignToken" | head -5

echo -e "\n=== Looking for spacing token definitions ==="
rg -nP --type=kt "object\s+DesignToken|class\s+DesignToken" -A 50 | head -100

echo -e "\n=== Searching for 'spacing' property in design tokens ==="
rg -nP --type=kt "val spacing|object.*[Ss]pacing" | head -20

echo -e "\n=== Looking for KptTheme definition ==="
rg -nP --type=kt "object\s+KptTheme|class\s+KptTheme" -A 30 | head -80

Repository: openMF/mifos-mobile

Length of output: 492


🏁 Script executed:

#!/bin/bash
# Description: Find DesignToken and KptTheme spacing definitions

echo "=== Finding all DesignToken files ==="
fd "\.kt$" | xargs rg -l "object DesignToken|class DesignToken" 2>/dev/null | head -5

echo -e "\n=== Finding all KptTheme files ==="
fd "\.kt$" | xargs rg -l "object KptTheme|class KptTheme" 2>/dev/null | head -5

echo -e "\n=== Searching for spacing definitions in common theme/design ==="
fd "\.kt$" "design\|theme" | head -10

echo -e "\n=== Looking for SetPasswordScreen.kt file ==="
fd "SetPasswordScreen.kt"

echo -e "\n=== Searching for 'spacing' definitions across codebase ==="
fd "\.kt$" | xargs rg -l "val spacing" 2>/dev/null | head -10

Repository: openMF/mifos-mobile

Length of output: 1124


🏁 Script executed:

#!/bin/bash
# Read DesignToken.kt to see spacing definitions
echo "=== Reading DesignToken.kt ==="
cat core/designsystem/src/commonMain/kotlin/org/mifos/mobile/core/designsystem/theme/DesignToken.kt

echo -e "\n=== Searching for KptTheme object (not just KptColorSchemeImpl) ==="
fd "\.kt$" | xargs rg -l "object KptTheme" 2>/dev/null

echo -e "\n=== Searching for Spacing definitions in KptTheme area ==="
fd "\.kt$" "core-base/designsystem" | xargs rg "val spacing|object.*Spacing" 2>/dev/null | head -20

Repository: openMF/mifos-mobile

Length of output: 17709


🏁 Script executed:

#!/bin/bash
# Find KptSpacing definitions to see what spacing values are available

echo "=== Reading KptColorSchemeImpl.kt to see spacing implementation ==="
cat core-base/designsystem/src/commonMain/kotlin/template/core/base/designsystem/theme/KptColorSchemeImpl.kt | head -200

echo -e "\n=== Searching for KptSpacingImpl ==="
fd "\.kt$" | xargs rg -l "class KptSpacingImpl|object KptSpacingImpl|data class KptSpacing"

echo -e "\n=== Looking for KptSpacing definition ==="
fd "\.kt$" | xargs rg "interface KptSpacing|class KptSpacing|data class KptSpacing" -A 30 | head -100

Repository: openMF/mifos-mobile

Length of output: 19849


🏁 Script executed:

#!/bin/bash
# Read SetPasswordScreen.kt to verify the exact spacing usage at lines 149, 157, 188, 265

echo "=== Reading SetPasswordScreen.kt lines around 149, 157, 188, 265 ==="
wc -l feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/setNewPassword/SetPasswordScreen.kt

echo -e "\n=== Checking lines 140-160 (covering 149, 157) ==="
sed -n '140,160p' feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/setNewPassword/SetPasswordScreen.kt

echo -e "\n=== Checking lines 180-195 (covering 188) ==="
sed -n '180,195p' feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/setNewPassword/SetPasswordScreen.kt

echo -e "\n=== Checking lines 260-270 (covering 265) ==="
sed -n '260,270p' feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/setNewPassword/SetPasswordScreen.kt

Repository: openMF/mifos-mobile

Length of output: 2503


🏁 Script executed:

#!/bin/bash
# Final verification: confirm the exact spacing values match our understanding

echo "=== Summary of spacing definitions ==="
echo "DesignToken.spacing values:"
grep -A2 "val medium:\|val dp24:\|val largeIncreased:" core/designsystem/src/commonMain/kotlin/org/mifos/mobile/core/designsystem/theme/DesignToken.kt | head -10

echo -e "\nKptTheme.spacing values:"
grep "override val xs:\|override val sm:\|override val md:\|override val lg:" core-base/designsystem/src/commonMain/kotlin/template/core/base/designsystem/theme/KptColorSchemeImpl.kt | head -10

echo -e "\n=== Exact lines from SetPasswordScreen.kt ==="
echo "Line 149:"
sed -n '149p' feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/setNewPassword/SetPasswordScreen.kt

echo "Line 157:"
sed -n '157p' feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/setNewPassword/SetPasswordScreen.kt

echo "Line 188:"
sed -n '188p' feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/setNewPassword/SetPasswordScreen.kt

echo "Line 265:"
sed -n '265p' feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/setNewPassword/SetPasswordScreen.kt

Repository: openMF/mifos-mobile

Length of output: 928


Migrate line 157 to KptTheme.spacing.lg for consistency with other spacing token usage.

Line 157 uses DesignToken.spacing.dp24 (24.dp), but KptTheme.spacing.lg also equals 24.dp and is already used elsewhere in the file (lines 188, 265). For consistency with the KptTheme migration pattern, change line 157 to KptTheme.spacing.lg.

Line 149 correctly retains DesignToken.spacing.medium (12.dp) since KptTheme lacks a 12dp equivalent.

🤖 Prompt for AI Agents
In
feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/setNewPassword/SetPasswordScreen.kt
around lines 149-157, replace the spacing token at line 157 that currently uses
DesignToken.spacing.dp24 (24.dp) with KptTheme.spacing.lg to match the rest of
the file and KptTheme usage; retain DesignToken.spacing.medium at line 149 as-is
since KptTheme has no 12dp equivalent.

Comment on lines +72 to 73
modifier = Modifier.padding(horizontal = KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(DesignToken.spacing.medium),
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Inconsistent spacing token usage.

Line 72 uses KptTheme.spacing.md while line 73 still uses DesignToken.spacing.medium. For consistency with the migration pattern applied throughout this file, line 73 should also use KptTheme spacing.

🔎 Proposed fix for consistency
         Column(
             modifier = Modifier.padding(horizontal = KptTheme.spacing.md),
-            verticalArrangement = Arrangement.spacedBy(DesignToken.spacing.medium),
+            verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
         ) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
modifier = Modifier.padding(horizontal = KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(DesignToken.spacing.medium),
Column(
modifier = Modifier.padding(horizontal = KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
🤖 Prompt for AI Agents
In
feature/home/src/commonMain/kotlin/org/mifos/mobile/feature/home/components/BottomSheetContent.kt
around lines 72 to 73, the spacing tokens are inconsistent: the modifier uses
KptTheme.spacing.md while verticalArrangement uses DesignToken.spacing.medium;
update the verticalArrangement spacing to use KptTheme.spacing.md (or the
corresponding KptTheme.spacing value matching DesignToken.spacing.medium) so
both lines use the KptTheme spacing tokens consistently.

label = stringResource(Res.string.feature_apply_loan_label_applicant_name),
shape = DesignToken.shapes.medium,
shape = KptTheme.shapes.medium,
textStyle = MifosTypography.bodyLarge,
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for MifosTypography usages in feature modules
echo "=== MifosTypography usages in feature modules ==="
rg -nP 'MifosTypography\.' --type=kt -g 'feature/**' | head -30

echo -e "\n=== MifosTypography definition ==="
rg -nP 'object MifosTypography|class MifosTypography' --type=kt -A 10

echo -e "\n=== KptTheme typography definition ==="
rg -nP 'object KptTheme|class KptTheme' --type=kt -A 15 | head -50

echo -e "\n=== Check if MifosTypography imports or references KptTheme ==="
rg -nP 'MifosTypography' --type=kt -B 5 -A 5 | grep -E '(import|KptTheme|MaterialTheme)' | head -20

Repository: openMF/mifos-mobile

Length of output: 378


🏁 Script executed:

#!/bin/bash
# Search for MifosTypography definition
echo "=== MifosTypography definition ==="
fd -e kt | xargs rg -l 'object MifosTypography|class MifosTypography'
fd -e kt | xargs rg -B 2 -A 15 'object MifosTypography|class MifosTypography'

echo -e "\n=== MifosTypography usages in feature modules ==="
fd -e kt feature/ | xargs rg 'MifosTypography\.' -c | head -20

echo -e "\n=== Check imports in LoanApplyScreen.kt ==="
fd -e kt -p 'LoanApplyScreen.kt' | xargs cat -n | head -100

echo -e "\n=== Search for KptTheme typography ==="
fd -e kt | xargs rg 'KptTheme\.typography|object KptTheme' -B 2 -A 10 | head -50

Repository: openMF/mifos-mobile

Length of output: 17297


🏁 Script executed:

#!/bin/bash
# Get the file path for LoanApplyScreen.kt
FILE=$(fd -e kt -p 'LoanApplyScreen.kt')

echo "=== Lines around 216 in LoanApplyScreen.kt ==="
sed -n '210,225p' "$FILE" | cat -n

echo -e "\n=== Lines around 287 in LoanApplyScreen.kt ==="
sed -n '280,295p' "$FILE" | cat -n

echo -e "\n=== All typography usages in LoanApplyScreen.kt ==="
rg 'MifosTypography\.|KptTheme\.typography' "$FILE" -n

Repository: openMF/mifos-mobile

Length of output: 2216


🏁 Script executed:

#!/bin/bash
# Get MifosTypography definition
echo "=== MifosTypography.bodyLarge definition ==="
fd -e kt 'Type.kt' core/designsystem | xargs grep -A 10 'val bodyLarge'

echo -e "\n=== KptTypography definition and bodyLarge ==="
fd -e kt | xargs grep -l 'class KptTypography\|object KptTypography' | head -3
fd -e kt | xargs grep -B 5 -A 10 'val bodyLarge' | grep -E '(KptTypography|bodyLarge|fontSize|lineHeight)' | head -20

Repository: openMF/mifos-mobile

Length of output: 2045


🏁 Script executed:

#!/bin/bash
# Get KptTheme.typography.labelLarge definition
echo "=== KptTheme.typography.labelLarge definition ==="
fd -e kt | xargs grep -B 2 -A 5 'val labelLarge' | grep -E '(labelLarge|fontSize|lineHeight)' | head -15

# Get MifosTypography.labelLarge definition
echo -e "\n=== MifosTypography.labelLarge definition ==="
fd -e kt 'Type.kt' core/designsystem | xargs grep -A 5 'val labelLarge'

# Check if bodyLarge and labelLarge are different
echo -e "\n=== Compare MifosTypography styles ==="
fd -e kt 'Type.kt' core/designsystem | xargs grep -E 'val (bodyLarge|labelLarge|labelSmall)' -A 6 | grep -E '(val|fontSize|lineHeight)' | head -20

Repository: openMF/mifos-mobile

Length of output: 2405


Migrate MifosTypography to KptTheme typography for consistency.

Line 216 uses MifosTypography.bodyLarge while line 287 uses KptTheme.typography.labelLarge. The file mixes typography from two different design systems. Per the PR objectives to replace MaterialTheme with KptTheme, update line 216 to use KptTheme.typography.bodyLarge to maintain consistency within the file.

🤖 Prompt for AI Agents
In
feature/loan-application/src/commonMain/kotlin/org/mifos/mobile/feature/loan/application/loanApplication/LoanApplyScreen.kt
around line 216, replace the direct use of MifosTypography.bodyLarge with
KptTheme.typography.bodyLarge to keep typography consistent with the rest of the
file; update the import if necessary and ensure any references to
MifosTypography are swapped to KptTheme.typography so the component uses the
KptTheme design system.

style = MifosTypography.bodySmall,
)
Spacer(modifier = Modifier.height(8.dp))
Spacer(modifier = Modifier.height(KptTheme.spacing.sm))
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix incorrect Spacer modifier in Row layout.

The Spacer uses height modifier inside a Row, which creates vertical spacing rather than horizontal spacing. To add horizontal space between the two Text elements, use width instead.

🔎 Proposed fix
-                Spacer(modifier = Modifier.height(KptTheme.spacing.sm))
+                Spacer(modifier = Modifier.width(KptTheme.spacing.sm))
🤖 Prompt for AI Agents
In
feature/settings/src/commonMain/kotlin/org/mifos/mobile/feature/settings/faq/FaqScreen.kt
around line 156, the Spacer inside a Row is using Modifier.height which creates
vertical space; replace Modifier.height(KptTheme.spacing.sm) with
Modifier.width(KptTheme.spacing.sm) so the spacing between the two Text
composables is horizontal; ensure the correct width modifier is used from
androidx.compose.ui.Modifier (no other changes needed).

@therajanmaurya therajanmaurya merged commit bdb6b33 into openMF:development Dec 23, 2025
8 checks passed
Naman-kr404 pushed a commit to Naman-kr404/mifos-mobile that referenced this pull request Jan 15, 2026
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.

3 participants