-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Mobile App] Code Cleanup & Enhancements #1037
Conversation
used enhanced enum for payment status ui fixed golden tests
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
📝 WalkthroughWalkthroughThis pull request refactors localization and dependency injection throughout the codebase. The primary changes include updating localization from using explicit Changes
Sequence Diagram(s)sequenceDiagram
participant W as Widget
participant C as BuildContext
participant L as Localization Extension (l10n)
W->>C: Request localized string
C->>L: Invoke l10n getter
L-->>C: Return localized string
C-->>W: Localized string delivered
sequenceDiagram
participant A as MyApp
participant M as MultiRepositoryProvider
participant R as Repository (User/Payment/Survey/Organization)
participant DS as DataSource (Remote/Demo)
A->>M: Inject data sources (remote & demo)
M->>R: Instantiate repository with injected data sources
R->>DS: Interact with appropriate data source via demoManager logic
DS-->>R: Return data
R-->>M: Provide repository instance for UI consumption
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🔭 Outside diff range comments (5)
recipients_app/lib/view/widgets/income/balance_card/balance_card_header.dart (1)
72-72
: Update method parameter type to match usage.The method signature still uses
AppLocalizations
but is called withcontext.l10n
.Apply this diff to fix the parameter type:
- String _getNextDateText(AppLocalizations localizations) { + String _getNextDateText(BuildContext context) {Then update the method body to use
context.l10n
:- daysText = localizations.paymentsSuspended; + daysText = context.l10n.paymentsSuspended; - daysText = localizations.nextMonth; + daysText = context.l10n.nextMonth; - daysText = localizations.today; + daysText = context.l10n.today; - daysText = localizations.oneDay; + daysText = context.l10n.oneDay; - daysText = localizations.inDays(daysTo); + daysText = context.l10n.inDays(daysTo);recipients_app/lib/view/widgets/survey/survey_list_card.dart (1)
75-79
: Fix type mismatch in _formatDate parameter.The method expects AppLocalizations but receives context.l10n. Update the parameter type to match the new localization pattern.
Apply this fix:
String _formatDate( DateTime? dateTime, - AppLocalizations localizations, + BuildContext localizations, String locale, ) {recipients_app/lib/view/widgets/survey/survey_status_chip.dart (1)
68-72
: Fix method signature mismatchThe method signature still uses
AppLocalizations
but receivescontext.l10n
from the build method.Apply this diff:
- AppLocalizations localizations, + L10n l10n,recipients_app/lib/view/pages/payment_tile.dart (1)
60-64
: Fix method signature mismatchThe method signature still uses
AppLocalizations
but receivescontext.l10n
from the build method.Apply this diff:
- AppLocalizations localizations, + L10n l10n,recipients_app/lib/view/widgets/survey/survey_card_bottom_action.dart (1)
114-118
: Update method signature to use BuildContext.The
_getStatusLabel
method still expectsAppLocalizations
as a parameter while the rest of the code usescontext.l10n
. Consider updating the method signature to:String _getStatusLabel( MappedSurvey mappedSurvey, - AppLocalizations localizations, + BuildContext context, String locale, ) { - var daysText = localizations.day; + var daysText = context.l10n.day;
🧹 Nitpick comments (10)
recipients_app/lib/view/widgets/income/balance_card/balance_card_bottom_action.dart (1)
152-169
: Consider updating method signatures.The
_getStatusLabel
and_getPrimaryActionLabel
methods still acceptAppLocalizations
as a parameter, but they could be simplified since we're using the context extension pattern.- String _getStatusLabel( - PaymentsUiState paymentsUiState, - AppLocalizations localizations, - ) { + String _getStatusLabel( + PaymentsUiState paymentsUiState, + BuildContext context, + ) { switch (paymentsUiState.status) { case BalanceCardStatus.allConfirmed: - return "${paymentsUiState.confirmedPaymentsCount} ${localizations.paymentsConfirmedCount}"; + return "${paymentsUiState.confirmedPaymentsCount} ${context.l10n.paymentsConfirmedCount}"; case BalanceCardStatus.recentToReview: - return localizations.paymentsInReview; + return context.l10n.paymentsInReview; // ... similar changes for other cases } } - String _getPrimaryActionLabel( - PaymentsUiState paymentsUiState, - AppLocalizations localizations, - ) { + String _getPrimaryActionLabel( + PaymentsUiState paymentsUiState, + BuildContext context, + ) { // ... similar changes in the method body }Also applies to: 171-189
recipients_app/lib/view/pages/terms_and_conditions_page.dart (1)
56-63
: Consider extracting the privacy policy URL as a constant.The URL is duplicated in both the launch attempt and clipboard fallback.
+ static const privacyPolicyUrl = "https://socialincome.org/privacy"; // ... - const url = "https://socialincome.org/privacy"; + const url = privacyPolicyUrl; // ... - text: "https://socialincome.org/privacy", + text: privacyPolicyUrl,recipients_app/lib/data/repositories/payment_repository.dart (1)
11-13
: Double-check the const constructor usage.If the data source fields aren’t all compile-time constants, consider removing
const
from the constructor to avoid confusion.recipients_app/lib/data/models/payment/payment_ui_status.dart (1)
5-67
: Consider consolidating repeating icon assignments.Some statuses (e.g.,
contested
andtoReview
) share identical icon and color settings. If they depict different states but rely on the same visuals, you might consider consolidating or clarifying them for better maintainability.recipients_app/lib/data/repositories/organization_repository.dart (1)
4-4
: Remove unused import.The cloud_firestore import is no longer needed after the refactoring.
-import "package:cloud_firestore/cloud_firestore.dart";
recipients_app/lib/main.dart (1)
2-9
: LGTM! Well-structured dependency injection implementation.The changes improve the architecture by:
- Properly separating demo and remote data sources
- Implementing dependency injection for better testability and maintainability
- Initializing data sources with required dependencies
Also applies to: 45-56, 78-86
recipients_app/test/golden_tests/balance_card_container_golden_test.dart (2)
64-64
: Update test descriptions for clarity.Multiple tests use the same description "renders correctly". Consider using more specific descriptions that reflect each test's unique scenario.
- "renders correctly", + "renders correctly with confirmed and paid payments",- "renders correctly", + "renders correctly with confirmed and contested payments",- "renders correctly", + "renders correctly with confirmed and triple in-review payments",- "renders correctly", + "renders correctly with confirmed and triple contested payments",Also applies to: 107-107, 150-150, 207-207
201-201
: Fix inconsistent test names.The name in the GoldenTestDeviceScenario doesn't match the actual test scenario for these cases.
- name: "confirmed and contested payments", + name: "confirmed and triple in-review payments",- name: "confirmed and contested payments", + name: "confirmed and triple contested payments",Also applies to: 258-258
recipients_app/lib/view/pages/account_page.dart (2)
119-127
: Consider adding error details to failure messages.While the success/failure messages are now localized, the error message could be more informative by including specific error details from the failure state.
} else if (state.status == AuthStatus.updateRecipientFailure) { FlushbarHelper.showFlushbar( context, - message: context.l10n.profileUpdateError, + message: "${context.l10n.profileUpdateError}: ${state.error ?? ''}", type: FlushbarType.error, ); }
308-316
: Consider using a constant for the email regex pattern.The email validation regex pattern should be defined as a constant to improve maintainability and reusability.
+ static const String _emailRegexPattern = r"^[\w-]+(\.[\w-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,})$"; + validator: (value) { if (value == null || value.isEmpty) return null; - final emailRegex = RegExp( - r"^[\w-]+(\.[\w-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,})$", - ); + final emailRegex = RegExp(_emailRegexPattern); if (!emailRegex.hasMatch(value)) { return context.l10n.errorEmailInvalid; }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (31)
recipients_app/pubspec.lock
is excluded by!**/*.lock
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_contested_isolatedDiff.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_contested_maskedDiff.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_contested_masterImage.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_contested_testImage.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_paid_isolatedDiff.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_paid_maskedDiff.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_paid_masterImage.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_paid_testImage.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_triple_contested_isolatedDiff.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_triple_contested_maskedDiff.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_triple_contested_masterImage.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_triple_contested_testImage.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_triple_inreview_isolatedDiff.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_triple_inreview_maskedDiff.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_triple_inreview_masterImage.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_triple_inreview_testImage.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_isolatedDiff.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_maskedDiff.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_masterImage.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_testImage.png
is excluded by!**/*.png
recipients_app/test/golden_tests/goldens/ci/balance_card_confirmed.png
is excluded by!**/*.png
recipients_app/test/golden_tests/goldens/ci/balance_card_confirmed_and_contested.png
is excluded by!**/*.png
recipients_app/test/golden_tests/goldens/ci/balance_card_confirmed_and_paid.png
is excluded by!**/*.png
recipients_app/test/golden_tests/goldens/ci/balance_card_confirmed_and_triple_contested.png
is excluded by!**/*.png
recipients_app/test/golden_tests/goldens/ci/balance_card_confirmed_and_triple_inreview.png
is excluded by!**/*.png
recipients_app/test/golden_tests/goldens/windows/balance_card_confirmed.png
is excluded by!**/*.png
recipients_app/test/golden_tests/goldens/windows/balance_card_confirmed_and_contested.png
is excluded by!**/*.png
recipients_app/test/golden_tests/goldens/windows/balance_card_confirmed_and_paid.png
is excluded by!**/*.png
recipients_app/test/golden_tests/goldens/windows/balance_card_confirmed_and_triple_contested.png
is excluded by!**/*.png
recipients_app/test/golden_tests/goldens/windows/balance_card_confirmed_and_triple_inreview.png
is excluded by!**/*.png
📒 Files selected for processing (42)
recipients_app/README.md
(1 hunks)recipients_app/android/app/build.gradle
(2 hunks)recipients_app/l10n.yaml
(1 hunks)recipients_app/lib/data/models/payment/payment_ui_status.dart
(1 hunks)recipients_app/lib/data/repositories/crash_reporting_repository.dart
(1 hunks)recipients_app/lib/data/repositories/organization_repository.dart
(1 hunks)recipients_app/lib/data/repositories/payment_repository.dart
(1 hunks)recipients_app/lib/data/repositories/survey_repository.dart
(1 hunks)recipients_app/lib/data/repositories/user_repository.dart
(1 hunks)recipients_app/lib/l10n/l10n.dart
(1 hunks)recipients_app/lib/main.dart
(3 hunks)recipients_app/lib/my_app.dart
(3 hunks)recipients_app/lib/ui/icons/payment_status_icon.dart
(1 hunks)recipients_app/lib/ui/icons/payment_status_icon_with_text.dart
(2 hunks)recipients_app/lib/view/pages/account_page.dart
(15 hunks)recipients_app/lib/view/pages/main_app_page.dart
(2 hunks)recipients_app/lib/view/pages/payment_tile.dart
(2 hunks)recipients_app/lib/view/pages/payment_tile_bottom_action.dart
(3 hunks)recipients_app/lib/view/pages/payments_page.dart
(7 hunks)recipients_app/lib/view/pages/survey_page.dart
(2 hunks)recipients_app/lib/view/pages/surveys_page.dart
(3 hunks)recipients_app/lib/view/pages/terms_and_conditions_page.dart
(4 hunks)recipients_app/lib/view/pages/welcome_page.dart
(2 hunks)recipients_app/lib/view/widgets/account/organization_info.dart
(3 hunks)recipients_app/lib/view/widgets/dialogs/social_income_contact_dialog.dart
(4 hunks)recipients_app/lib/view/widgets/empty_item.dart
(1 hunks)recipients_app/lib/view/widgets/income/balance_card/balance_card_bottom_action.dart
(6 hunks)recipients_app/lib/view/widgets/income/balance_card/balance_card_container.dart
(4 hunks)recipients_app/lib/view/widgets/income/balance_card/balance_card_header.dart
(3 hunks)recipients_app/lib/view/widgets/income/balance_card/on_hold_bottom_card.dart
(3 hunks)recipients_app/lib/view/widgets/income/review_payment_header.dart
(2 hunks)recipients_app/lib/view/widgets/income/review_payment_modal.dart
(3 hunks)recipients_app/lib/view/widgets/survey/survey_card_bottom_action.dart
(2 hunks)recipients_app/lib/view/widgets/survey/survey_card_container.dart
(3 hunks)recipients_app/lib/view/widgets/survey/survey_list_card.dart
(2 hunks)recipients_app/lib/view/widgets/survey/survey_status_chip.dart
(2 hunks)recipients_app/lib/view/widgets/survey/surveys_overview_card.dart
(3 hunks)recipients_app/lib/view/widgets/welcome/otp_input_page.dart
(3 hunks)recipients_app/lib/view/widgets/welcome/phone_input_page.dart
(5 hunks)recipients_app/pubspec.yaml
(1 hunks)recipients_app/test/golden_tests/balance_card_container_golden_test.dart
(1 hunks)recipients_app/test/helpers/pump_app.dart
(2 hunks)
✅ Files skipped from review due to trivial changes (2)
- recipients_app/l10n.yaml
- recipients_app/lib/data/repositories/crash_reporting_repository.dart
🧰 Additional context used
📓 Learnings (1)
recipients_app/lib/view/widgets/welcome/phone_input_page.dart (1)
Learnt from: KarinBerg
PR: socialincome-san/public#960
File: recipients_app/lib/view/widgets/welcome/phone_input_page.dart:51-62
Timestamp: 2024-12-07T14:29:17.814Z
Learning: In `phone_input_page.dart`, enhancements to the demo button UX are unnecessary because the user sees this page only once.
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Prettify
🔇 Additional comments (53)
recipients_app/lib/view/pages/surveys_page.dart (1)
2-2
: LGTM! Consistent localization updates.The changes correctly implement the new localization pattern using
context.l10n
extension.Also applies to: 25-25, 47-47
recipients_app/lib/view/widgets/income/review_payment_modal.dart (2)
3-3
: LGTM: Import for l10n extension.The import aligns with the PR's objective to streamline localization access.
85-85
: LGTM: Consistent localization access pattern.The changes from
AppLocalizations.of(context)!
tocontext.l10n
improve code readability while maintaining functionality.Also applies to: 91-91, 112-112, 119-119
recipients_app/lib/view/pages/payment_tile_bottom_action.dart (2)
3-3
: LGTM: Import added for new localization approach.The addition of the l10n import aligns with the PR's objective to streamline localization access.
33-33
: LGTM: Consistent localization updates.The localization calls have been consistently updated to use
context.l10n
, improving code maintainability without changing functionality.Also applies to: 41-42, 50-50
recipients_app/lib/view/pages/welcome_page.dart (2)
4-4
: LGTM: Import addition aligns with localization updates.The new l10n import supports the transition to context.l10n extension method.
37-37
: LGTM: Consistent error message localization.Error handling now uses context.l10n consistently across both failure cases.
Also applies to: 43-43
recipients_app/lib/view/widgets/income/balance_card/balance_card_header.dart (2)
2-2
: LGTM: Import for new localization approach added.The import for the l10n extension is correctly added.
33-33
: LGTM: Localization calls updated consistently.The localization calls have been correctly updated to use
context.l10n
instead ofAppLocalizations.of(context)
.Also applies to: 38-38, 49-49
recipients_app/lib/view/widgets/income/balance_card/balance_card_bottom_action.dart (3)
3-3
: LGTM: Import for localization extension.The import aligns with the PR objective of transitioning to
context.l10n
.
37-37
: LGTM: Consistent use of context.l10n.The changes correctly implement the localization access pattern using
context.l10n
.Also applies to: 48-48, 57-57
77-77
: LGTM: Lambda expression formatting.The formatting changes improve code readability while maintaining functionality.
Also applies to: 89-89
recipients_app/pubspec.yaml (1)
9-9
: SDK Version Update ConfirmedThe Flutter SDK version has been updated to 3.27.3. This minor update appears consistent with the overall project enhancements. Please ensure thorough testing across devices and configurations to confirm that all dependencies and plugins remain compatible.
recipients_app/lib/view/widgets/survey/survey_list_card.dart (2)
2-2
: LGTM: Import aligns with localization updates.The new import supports the transition to using context.l10n.
50-50
: LGTM: Updated to new localization pattern.Successfully migrated to context.l10n as per project-wide updates.
recipients_app/lib/view/pages/terms_and_conditions_page.dart (3)
4-4
: LGTM! Import added for l10n extension.The import enables the new context.l10n localization approach.
18-18
: LGTM! Simplified DemoManager access.Using context.read is more concise than RepositoryProvider.of.
23-23
: LGTM! Consistent localization updates.All text strings now use the streamlined context.l10n approach.
Also applies to: 41-41, 48-48, 69-69, 99-99
recipients_app/lib/view/widgets/welcome/phone_input_page.dart (5)
3-3
: LGTM!The import enables the new context.l10n extension usage.
55-55
: LGTM!Clean localization update for the demo button label.
71-71
: LGTM!Clean localization update for the mobile phone text.
111-111
: LGTM!Clean localization update for the phone number input label.
149-149
: LGTM!Clean localization update for the continue button label.
recipients_app/android/app/build.gradle (2)
17-18
: Updated Namespace and SDK Version
The addition of thenamespace = 'org.socialincome.app'
line and updatingcompileSdkVersion
to 35 are clear improvements that align with modern Android build practices.
33-40
: Streamlined DefaultConfig Setup
Directly assigning properties such asapplicationId
,minSdkVersion
,targetSdkVersion
,versionCode
, andversionName
from theflutter
object simplifies the configuration. Please ensure that theflutter
object is correctly initialized so these values are available during the build process.recipients_app/lib/data/repositories/payment_repository.dart (1)
6-7
: Great job using final fields and constructor injection.This approach improves testability and maintainability by decoupling the repository from the data source creation flow.
recipients_app/lib/data/models/payment/payment_ui_status.dart (2)
1-3
: Imports are appropriate.No issues found. These imports are necessary for color constants and icon references.
69-79
: Nice use of inline color and icon definitions in the enum.This design centralizes UI properties and enhances code readability.
recipients_app/lib/l10n/l10n.dart (2)
1-5
: Clean approach to localizations.Exporting
app_localizations.dart
ensures other files can easily import the necessary localization utilities.
6-8
: Extension method is straightforward and concise.Using
context.l10n
simplifies the code and aligns with best practices for retrieving localized strings.recipients_app/lib/ui/icons/payment_status_icon.dart (1)
18-23
: Great refactoring!Accessing properties directly from PaymentUiStatus enum improves maintainability and reduces code duplication.
recipients_app/lib/view/widgets/empty_item.dart (1)
1-1
: Clean localization update!Using context.l10n extension improves code readability.
Also applies to: 17-17
recipients_app/lib/data/repositories/survey_repository.dart (1)
7-8
: Excellent dependency injection implementation!Making data sources injectable improves testability and follows SOLID principles.
Also applies to: 12-16, 18-18
recipients_app/lib/data/repositories/organization_repository.dart (1)
7-8
: Good consistency with repository pattern!Matches the dependency injection pattern used in other repositories.
Also applies to: 12-16
recipients_app/lib/ui/icons/payment_status_icon_with_text.dart (1)
24-24
: LGTM! Good encapsulation of visual properties.The refactoring to use status object properties directly improves maintainability and reduces complexity.
Also applies to: 33-33, 39-40
recipients_app/test/helpers/pump_app.dart (1)
2-2
: LGTM! Proper localization setup for tests.The addition of localization delegates ensures widgets can be properly tested with translations.
Also applies to: 7-7, 29-34
recipients_app/lib/view/widgets/income/review_payment_header.dart (1)
1-1
: LGTM! Consistent localization pattern.The update to use context.l10n improves code consistency across the codebase.
Also applies to: 13-13, 34-34
recipients_app/lib/view/widgets/income/balance_card/on_hold_bottom_card.dart (1)
1-1
: LGTM! Consistent localization pattern.The update to use context.l10n improves code consistency across the codebase.
Also applies to: 29-29, 38-38
recipients_app/lib/view/pages/survey_page.dart (1)
3-3
: LGTM! Clean localization update.The changes correctly implement the new localization pattern using
context.l10n
.Also applies to: 47-47
recipients_app/lib/view/widgets/welcome/otp_input_page.dart (1)
2-2
: LGTM! Clean localization updates and formatting.The changes correctly implement the new localization pattern and improve code formatting.
Also applies to: 38-38, 47-47, 53-53
recipients_app/lib/view/widgets/survey/survey_card_container.dart (1)
2-2
: LGTM! Clean localization updates.The changes correctly implement the new localization pattern, maintaining proper string interpolation.
Also applies to: 34-34, 53-53
recipients_app/lib/view/widgets/account/organization_info.dart (1)
2-2
: LGTM! Clean localization updates and style improvements.The changes correctly implement the new localization pattern and enhance text styling.
Also applies to: 23-23, 42-42, 47-47
recipients_app/lib/data/repositories/user_repository.dart (1)
9-18
: Great refactoring to improve dependency injection!The changes enhance testability and maintainability by:
- Using constructor injection instead of late initialization
- Making fields final for immutability
- Removing direct Firebase dependencies
recipients_app/lib/view/pages/main_app_page.dart (1)
3-3
: LGTM!Clean update to use context.l10n for localization.
Also applies to: 40-40
recipients_app/lib/view/widgets/survey/surveys_overview_card.dart (1)
3-3
: LGTM! Clean localization updates.The changes consistently replace
AppLocalizations.of(context)
withcontext.l10n
, improving code readability and maintainability.Also applies to: 44-44, 51-54, 64-64
recipients_app/lib/view/widgets/income/balance_card/balance_card_container.dart (1)
3-3
: LGTM! Clean localization and formatting updates.The changes improve code readability through:
- Consistent use of
context.l10n
for localization- Cleaner conditional statement formatting
Also applies to: 25-25, 51-51, 55-55, 73-74, 78-79
recipients_app/lib/view/widgets/dialogs/social_income_contact_dialog.dart (1)
2-2
: LGTM! Localization updates are consistent.The changes correctly implement the new localization pattern using
context.l10n
.Also applies to: 35-35, 39-39, 53-53, 59-59, 67-67, 85-85
recipients_app/lib/view/pages/payments_page.dart (1)
4-4
: LGTM! Localization updates are consistent.The changes correctly implement the new localization pattern using
context.l10n
.Also applies to: 28-28, 49-49, 68-68, 87-87, 96-96, 119-119
recipients_app/lib/my_app.dart (3)
3-10
: Well-structured data source declarations.The clear separation between remote and demo data sources improves code organization.
Also applies to: 33-43
51-58
: Good use of dependency injection.Required parameters in the constructor ensure proper initialization of data sources.
76-77
: Clean repository instantiation.The repositories are correctly initialized with their respective data sources.
Also applies to: 86-87, 93-94, 100-101
recipients_app/lib/view/pages/account_page.dart (1)
5-5
: LGTM! Clean localization import.The new import
package:app/l10n/l10n.dart
aligns with the updated localization strategy.recipients_app/README.md (1)
145-147
: LGTM! Clear documentation update.The documentation clearly explains the new localization approach using
context.l10n
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
recipients_app/lib/my_app.dart (1)
41-53
: Consider grouping related parameters in the constructor.The constructor parameters could be more maintainable if grouped using a configuration object.
const MyApp({ super.key, required this.messaging, required this.demoManager, - required this.userRemoteDataSource, - required this.userDemoDataSource, - required this.paymentRemoteDataSource, - required this.paymentDemoDataSource, - required this.surveyRemoteDataSource, - required this.surveyDemoDataSource, - required this.organizationRemoteDataSource, - required this.organizationDemoDataSource, + required DataSourceConfig dataSources, }) : + userRemoteDataSource = dataSources.userRemote, + userDemoDataSource = dataSources.userDemo, + paymentRemoteDataSource = dataSources.paymentRemote, + paymentDemoDataSource = dataSources.paymentDemo, + surveyRemoteDataSource = dataSources.surveyRemote, + surveyDemoDataSource = dataSources.surveyDemo, + organizationRemoteDataSource = dataSources.organizationRemote, + organizationDemoDataSource = dataSources.organizationDemo;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
recipients_app/lib/my_app.dart
(3 hunks)
🔇 Additional comments (3)
recipients_app/lib/my_app.dart (3)
3-10
: LGTM! Clean import organization for data sources.The imports are well-organized, clearly separating demo and remote data sources.
29-39
: LGTM! Clear field organization with good separation.Fields are well-organized with logical grouping and spacing between different types of data sources.
69-96
: LGTM! Clean repository initialization with dependency injection.The repositories are properly initialized with their respective data sources, following good dependency injection practices.
…and "FirebaseFirestore"
…ntStatusIconWithText
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
recipients_app/lib/ui/design_components_screen.dart (1)
90-133
: Use standard spacing and localization.Two improvements needed:
- Replace hardcoded
SizedBox(height: 5)
withAppSpacings.a8
for consistent spacing- Use localized strings instead of hardcoded text
Example for one status:
PaymentStatusIconWithText( status: PaymentUiStatus.confirmed, - text: "Confirmed", + text: context.l10n.paymentStatusConfirmed, ),
🧹 Nitpick comments (1)
recipients_app/lib/ui/design_components_screen.dart (1)
27-62
: Use standard spacing constant for consistency.Replace the hardcoded
SizedBox(height: 5)
withAppSpacings.a8
to maintain consistency with the app's spacing system.- SizedBox(height: 5), + SizedBox(height: AppSpacings.a8),
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
recipients_app/lib/ui/design_components_screen.dart
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Prettify
- GitHub Check: Security checks (typescript)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
recipients_app/lib/data/models/payment/payment_ui_status.dart (1)
53-54
: Fix typo in documentation comments."visbible" should be "visible" in the documentation comments.
- /// backgroundColor label, dark font, no visbible icon (That's why iconColor is same as color) + /// backgroundColor label, dark font, no visible icon (That's why iconColor is same as color)Also applies to: 61-62
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
recipients_app/lib/data/models/payment/payment_ui_status.dart
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Prettify
- GitHub Check: Security checks (typescript)
🔇 Additional comments (2)
recipients_app/lib/data/models/payment/payment_ui_status.dart (2)
1-3
: LGTM!Clean and minimal imports that provide the necessary dependencies.
69-79
: LGTM!Well-structured properties and constructor that enforce proper initialization of all UI elements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
recipients_app/README.md (1)
145-147
: Enhancement: Updated Localization Instructions with Minor Punctuation SuggestionThe updated snippet correctly reflects the new localization approach using
context.l10n.helloWorld
and aligns well with the overall code cleanup. As a minor refinement, consider adding a comma after "code" for improved readability, e.g., "in the code, use:context.l10n.helloWorld
".🧰 Tools
🪛 LanguageTool
[uncategorized] ~145-~145: Possible missing comma found.
Context: ... ``` To use a translated string in the code use:context.l10n.helloWorld
and impo...(AI_HYDRA_LEO_MISSING_COMMA)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
recipients_app/README.md
(2 hunks)
🧰 Additional context used
🪛 LanguageTool
recipients_app/README.md
[uncategorized] ~145-~145: Possible missing comma found.
Context: ... ``` To use a translated string in the code use: context.l10n.helloWorld
and impo...
(AI_HYDRA_LEO_MISSING_COMMA)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Prettify
- GitHub Check: Security checks (typescript)
Visit the preview URL for this PR (updated for commit 2b2d830): https://si-admin-staging--pr1037-verena-cleanup-b87wshrc.web.app (expires Sun, 23 Feb 2025 15:57:26 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: b7b0969384059dce6ea8fad1ee1d1737e54e6676 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
recipients_app/lib/data/repositories/messaging_repository.dart (1)
27-62
: 🛠️ Refactor suggestionAdd error handling for notification initialization.
The
initNotifications
method should handle potential failures in permission requests and token retrieval.Future<void> initNotifications() async { + try { await messaging.requestPermission( criticalAlert: true, ); final token = await getToken(); log("PUSHNOTIFICATION: Current FCM token: $token"); // ... rest of the method + } catch (e) { + log( + "Failed to initialize notifications", + name: "PUSHNOTIFICATION", + error: e, + ); + rethrow; + } }
🧹 Nitpick comments (4)
recipients_app/lib/data/repositories/messaging_repository.dart (3)
22-24
: Consider structured logging for token refresh events.The current log message could be enhanced with structured logging to facilitate better monitoring and debugging.
- log("PUSHNOTIFICATION: FCM Token refreshed: $event"); + log( + "FCM Token refreshed", + name: "PUSHNOTIFICATION", + error: null, + time: DateTime.now(), + zone: Zone.current, + sequenceNumber: 0, + level: 0, + );
64-80
: Track TODOs for notification display implementation.Multiple TODO comments indicate pending implementation for notification display in different states (foreground, background, initial).
Would you like me to create tracking issues for implementing notification display in these different states?
86-98
: Enhance message logging with structured format.The
logRemoteMessage
method could benefit from structured logging for better parsing and monitoring.static void logRemoteMessage(RemoteMessage message) { + final Map<String, dynamic> logData = { + 'notification': message.notification?.toMap(), + 'messageType': message.messageType, + 'messageId': message.messageId, + 'category': message.category, + 'from': message.from, + 'data': message.data, + 'sentTime': message.sentTime?.toIso8601String(), + }; + if (message.notification != null) { - log("RemoteMessage message.notification: ${message.notification}"); - log('RemoteMessage message.notification?.title: ${message.notification?.title ?? ''}'); - log('RemoteMessage message.notification?.body: ${message.notification?.body ?? ''}'); + log( + 'Remote Message Notification', + name: 'PUSHNOTIFICATION', + error: null, + zone: Zone.current, + time: DateTime.now(), + sequenceNumber: 0, + level: 0, + ); } - log("RemoteMessage message.messageType: ${message.messageType}"); - log("RemoteMessage message.messageId: ${message.messageId}"); - log("RemoteMessage message.category: ${message.category}"); - log("RemoteMessage message.from: ${message.from}"); - log("RemoteMessage message.data: ${message.data}"); - log("RemoteMessage message.sentTime: ${message.sentTime}"); + log( + 'Remote Message Details', + name: 'PUSHNOTIFICATION', + error: null, + zone: Zone.current, + time: DateTime.now(), + sequenceNumber: 0, + level: 0, + ); }recipients_app/ios/Podfile (1)
33-33
: Document the use of pre-compiled SDK.Consider adding a comment explaining why the pre-compiled SDK from invertase is being used instead of the official pod.
+ # Using pre-compiled SDK to improve build times pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '11.7.0'
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (22)
recipients_app/ios/Podfile.lock
is excluded by!**/*.lock
recipients_app/pubspec.lock
is excluded by!**/*.lock
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_contested_masterImage.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_contested_testImage.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_paid_masterImage.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_paid_testImage.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_triple_contested_masterImage.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_triple_contested_testImage.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_triple_inreview_masterImage.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_and_triple_inreview_testImage.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_masterImage.png
is excluded by!**/*.png
recipients_app/test/golden_tests/failures/balance_card_confirmed_testImage.png
is excluded by!**/*.png
recipients_app/test/golden_tests/goldens/ci/balance_card_confirmed.png
is excluded by!**/*.png
recipients_app/test/golden_tests/goldens/ci/balance_card_confirmed_and_contested.png
is excluded by!**/*.png
recipients_app/test/golden_tests/goldens/ci/balance_card_confirmed_and_paid.png
is excluded by!**/*.png
recipients_app/test/golden_tests/goldens/ci/balance_card_confirmed_and_triple_contested.png
is excluded by!**/*.png
recipients_app/test/golden_tests/goldens/ci/balance_card_confirmed_and_triple_inreview.png
is excluded by!**/*.png
recipients_app/test/golden_tests/goldens/macos/balance_card_confirmed.png
is excluded by!**/*.png
recipients_app/test/golden_tests/goldens/macos/balance_card_confirmed_and_contested.png
is excluded by!**/*.png
recipients_app/test/golden_tests/goldens/macos/balance_card_confirmed_and_paid.png
is excluded by!**/*.png
recipients_app/test/golden_tests/goldens/macos/balance_card_confirmed_and_triple_contested.png
is excluded by!**/*.png
recipients_app/test/golden_tests/goldens/macos/balance_card_confirmed_and_triple_inreview.png
is excluded by!**/*.png
📒 Files selected for processing (4)
recipients_app/ios/Podfile
(1 hunks)recipients_app/lib/data/datasource/demo/no_op_document_reference.dart
(1 hunks)recipients_app/lib/data/repositories/messaging_repository.dart
(1 hunks)recipients_app/pubspec.yaml
(2 hunks)
✅ Files skipped from review due to trivial changes (1)
- recipients_app/lib/data/datasource/demo/no_op_document_reference.dart
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Prettify
- GitHub Check: Security checks (typescript)
🔇 Additional comments (8)
recipients_app/pubspec.yaml (6)
14-14
: Dependency Update:cloud_firestore
Version Change
The dependency has been updated to^5.6.3
. Please verify that this version is fully compatible with your Firestore integration and that any breaking changes are addressed.
17-17
: Dependency Update:firebase_app_check
Version Change
The version is now^0.3.2+2
. Confirm that the updated App Check functionality works seamlessly with your current configuration and that any new API modifications are properly handled.
18-18
: Dependency Update:firebase_auth
Version Change
The dependency update to^5.4.2
should be tested to ensure that existing authentication flows function correctly and that any updated error handling is integrated.
19-19
: Dependency Update:firebase_core
Version Change
Upgraded to^3.11.0
, this update requires that the initialization and configuration for Firebase work without issues. Double-check configurations for potential changes in setup or defaults.
20-20
: Dependency Update:firebase_messaging
Version Change
The version has been bumped to^15.2.2
. Ensure that messaging notifications and related configuration behave as expected following this upgrade.
46-46
: Dev Dependency Update:alchemist
Version Change
The dev dependencyalchemist
has been updated to^0.11.0
. Please confirm that all tests utilizing this package are compatible with any API changes and that your test suite remains stable.recipients_app/lib/data/repositories/messaging_repository.dart (1)
8-14
: Consider initializing Firebase for background operations.The commented code suggests initializing Firebase before using other services. This initialization might be necessary for certain background operations.
Please confirm if Firebase initialization is required for your background message handling needs.
recipients_app/ios/Podfile (1)
33-33
:✅ Verification successful
Verify Firebase SDK version compatibility.
The FirebaseFirestore pod has been updated to version 11.7.0 and is now sourced from the pre-compiled SDK repository.
🌐 Web query:
What is the latest version of FirebaseFirestore iOS SDK and are there any known issues with version 11.7.0?
💡 Result:
The latest stable version of the FirebaseFirestore iOS SDK as of February 2025 is v11.8.x (with v11.8.1 being a patch release addressing distribution-specific issues)[1][7]. For v11.7.x specifically:
Key Details for FirebaseFirestore v11.7.x (Jan 13, 2025)
Critical Fixes:
- Resolved a use-after-free memory bug related to internal string formatting operations (#14306)[1]. This addressed potential crashes during Firestore operations involving string manipulation.
Known Issues:
- No unresolved Firestore-specific issues are documented for v11.7.x in official release notes[1][9].
- Some developers reported Xcode build failures when using newer Firebase SDK versions (like v11.8.x) with Unity projects[2], though these appear unrelated to v11.7.x specifically.
For production use:
- v11.x requires Xcode ≥15 and iOS ≥13[1][4]
- Version compatibility warnings exist for macOS <12 and visionOS development requiring source-based Firestore integration[1]
The recommended upgrade path remains v11.x latest stable (currently v11.x) unless encountering Unity-specific build chain issues[2][5].
Citations:
- 1: https://firebase.google.com/support/release-notes/ios
- 2: https://forums.developer.apple.com/forums/thread/747221
- 3: https://github.com/invertase/react-native-firebase/blob/main/CHANGELOG.md
- 4: https://rnfirebase.io
- 5: https://groups.google.com/g/firebase-talk/c/GJQH_0rvmHM
- 6: https://cocoapods.org/pods/FirebaseAuth
- 7: https://github.com/firebase/firebase-ios-sdk/releases
- 8: App crash at launch observed in macOS version below 11.7 firebase/firebase-ios-sdk#12836
- 9: https://firebase.google.com/support/releases
- 10: https://github.com/invertase/firestore-ios-sdk-frameworks
FirebaseFirestore v11.7.0 Verified & Documentation Suggestion
The FirebaseFirestore pod updated to version 11.7.0 (sourced from the invertase pre-compiled SDK) is compatible and stable—no unresolved issues have been reported with this version. Note that the latest stable release is now v11.8.x, but v11.7.0 remains valid, especially given its critical use-after-free bug fix.
- Ensure your project meets the Xcode and iOS version requirements for FirebaseFirestore v11.x (Xcode ≥15, iOS ≥13).
- Consider adding a comment in the Podfile or project documentation explaining the choice of the pre-compiled SDK (from the invertase repository) for improved build performance.
Summary by CodeRabbit
Documentation
New Features
Refactor
Tests