Skip to content

Conversation

@AndreaDiazCorreia
Copy link
Member

@AndreaDiazCorreia AndreaDiazCorreia commented Jul 4, 2025

Changes Made:
1.Visual Consistency:

  • Updated background color in both screens to use AppTheme.backgroundDark
  • Standardized card color to Color(0xFF1D212C) to match "My Trades" screen
  • Modified CustomCard to use the new color by default
  1. Shared Components:
  • Extracted common UI components to
  • lib/shared/widgets/order_cards.dart
  • Implemented OrderIdCard with consistent title label
  • Fixed reviews icon in creator info card
  1. Date/Time Format Improvement:
  • Simplified date/time format for better clarity
  • Replaced verbose format with more user-friendly: "Thu, Jul 03 2025 at 23:56 (GMT-03)"
  1. Creator Reputation Data:
  • Implemented extraction of creator rating information from Nostr event in take_order_screen.dart
  • Prepared structure for similar implementation in trade_detail_screen.dart

Benefits:

  • Greater visual consistency throughout the app
  • More maintainable code through reusable components
  • Better user experience with clearer date formats
    -Display of real creator reputation data when available

image
image
image

Summary by CodeRabbit

  • New Features

    • Introduced new card widgets for payment methods, creation date, creator reputation, order amount, order ID (with copy feature), and notification messages.
    • Enhanced order and trade detail screens with dynamic titles, specialized UI for pending orders created by the user, and clearer layout of order information.
    • Added localized strings supporting trade detail screen actions, labels, and messages in English, Spanish, and Italian.
  • Improvements

    • Reformatted seller amount and date/time displays for improved clarity and user-friendliness.
    • Modularized UI components for consistency and reuse across screens.
    • Updated background and card colors for better visual consistency.
    • Refined user input handling with validation and error feedback for range orders.
    • Simplified button text and dialog messages for clearer user communication.
    • Adjusted navigation behavior for back button to improve user flow.
    • Updated trade list item colors and premium/discount indicators to use theme-based colors.
    • Enhanced fiat amount display to show ranges when applicable.
    • Added new theme colors for role and status chips to support consistent UI theming.
    • Improved button widgets with dynamic font sizing and width control for better text fit.
  • Bug Fixes

    • Improved validation and error feedback for entering amounts within order ranges.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 4, 2025

"""

Walkthrough

These changes refactor and enhance order and trade detail screens by introducing modular card widgets for displaying order information, updating background colors, improving date formatting, and refining the UI for pending orders. A new shared file provides reusable cards for order amount, payment method, creation date, order ID, creator reputation, and notifications, streamlining the codebase.

Changes

File(s) Change Summary
lib/features/order/screens/take_order_screen.dart Refactored UI to use modular card widgets for order info, improved button logic, updated background color, enhanced date formatting, and clarified range order input.
lib/features/trades/screens/trade_detail_screen.dart Added specialized UI and cards for pending creator orders, improved date formatting, refactored order ID and reputation display, updated background color.
lib/shared/widgets/custom_card.dart Changed default card color and border side color from AppTheme.dark2 to AppTheme.dark1.
lib/shared/widgets/order_cards.dart New file introducing reusable card widgets for order amount, payment method, creation date, order ID, creator reputation, and notifications.
lib/features/order/widgets/order_app_bar.dart Changed back button navigation from /order_book route to root / route.
lib/l10n/intl_en.arb Added new English localization keys for trade detail screen UI texts, buttons, messages, and dialogs; removed two unused keys.
lib/l10n/intl_es.arb Added new Spanish localization keys corresponding to trade detail screen UI texts, buttons, messages, and dialogs.
lib/l10n/intl_it.arb Added new Italian localization keys corresponding to trade detail screen UI texts, buttons, messages, and dialogs.
lib/core/app_theme.dart Added new color constants for role chips and status chips, plus secondary text color for UI theming.
lib/features/trades/widgets/trades_list_item.dart Replaced hardcoded colors with AppTheme colors for backgrounds, text, and chips; improved fiat amount display formatting.
lib/shared/widgets/custom_button.dart Added minFontSize and width properties; wrapped button in SizedBox; replaced Text with AutoSizeText for dynamic font sizing.
lib/shared/widgets/custom_elevated_button.dart Added optional minFontSize, width, and textStyle parameters; replaced Text with AutoSizeText; wrapped button in SizedBox if width given.
pubspec.yaml Added new dependency auto_size_text version ^3.0.0.
test/mocks.mocks.dart Added // ignore: must_be_immutable comment above MockSharedPreferencesAsync class declaration.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant TakeOrderScreen
  participant OrderCards
  participant OrderIdCard
  participant Clipboard
  participant Snackbar
  participant Notifier

  User->>TakeOrderScreen: View order details
  TakeOrderScreen->>OrderCards: Display order info (amount, payment, date, reputation, ID)
  User->>OrderIdCard: Tap copy button
  OrderIdCard->>Clipboard: Copy order ID
  OrderIdCard->>Snackbar: Show "Copied" notification
  User->>TakeOrderScreen: Tap action button
  TakeOrderScreen->>TakeOrderScreen: If range order, prompt for amount input dialog
  User->>TakeOrderScreen: Enter amount (if prompted)
  TakeOrderScreen->>Notifier: takeBuyOrder/takeSellOrder(amount)
Loading

Possibly related PRs

Suggested reviewers

  • Catrya
  • chebizarro
  • grunch

Poem

🐇 Hopping through cards with a joyful cheer,
Orders and trades now crystal clear.
Amounts and dates in tidy rows,
Reputation shines and action flows.
Copy IDs with just one click,
Smooth UI hops, so smart and quick!
🌟✨
"""


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2e40c89 and c3998ce.

📒 Files selected for processing (1)
  • lib/features/trades/screens/trade_detail_screen.dart (13 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • lib/features/trades/screens/trade_detail_screen.dart
⏰ 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: build

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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

🧹 Nitpick comments (3)
lib/shared/widgets/order_cards.dart (1)

267-271: Add const keyword for consistency.

The Icon widget should use const for consistency with other icons in this file and for performance optimization.

-                          Icon(
+                          const Icon(
                            Icons.star,
                            color: AppTheme.mostroGreen,
                            size: 16,
                          ),
lib/features/trades/screens/trade_detail_screen.dart (1)

645-650: Address TODO: Implement creator rating extraction.

The hardcoded values should be replaced with actual data extraction from the creator's information.

Would you like me to help implement the rating data extraction logic or create an issue to track this TODO?

lib/features/order/screens/take_order_screen.dart (1)

132-133: Consider adding null safety checks.

The code accesses order properties without checking for null values. While these might be guaranteed by the data model, adding defensive checks would make the code more robust.

-    final methods = order.paymentMethods.isNotEmpty
-        ? order.paymentMethods.join(', ')
+    final methods = order.paymentMethods?.isNotEmpty == true
+        ? order.paymentMethods!.join(', ')
         : 'No payment method';
-      createdDate: formatDateTime(order.createdAt!),
+      createdDate: formatDateTime(order.createdAt ?? DateTime.now()),

Also applies to: 142-143

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2a4404f and 9a96f9c.

📒 Files selected for processing (4)
  • lib/features/order/screens/take_order_screen.dart (4 hunks)
  • lib/features/trades/screens/trade_detail_screen.dart (6 hunks)
  • lib/shared/widgets/custom_card.dart (1 hunks)
  • lib/shared/widgets/order_cards.dart (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
lib/shared/widgets/custom_card.dart (1)
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/shared/widgets/mostro_reactive_button.dart:22-32
Timestamp: 2025-05-08T15:39:07.322Z
Learning: In the Mostro Mobile codebase, WidgetStateProperty is used instead of the deprecated MaterialStateProperty for styling buttons with state-dependent properties.
lib/features/trades/screens/trade_detail_screen.dart (6)
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/features/trades/models/trade_state.dart:1-15
Timestamp: 2025-05-08T16:06:33.665Z
Learning: In the context of the Mostro Mobile app, the `TradeState` class is specifically constructed using the `tradeStateProvider`. While some fields are nullable (`lastAction` and `orderPayload`), they are still marked as required parameters to ensure they are explicitly considered during state construction.
Learnt from: chebizarro
PR: MostroP2P/mobile#110
File: lib/features/trades/widgets/mostro_message_detail_widget.dart:134-141
Timestamp: 2025-06-08T23:54:09.987Z
Learning: In the OrderState refactor, public keys should be accessed via `tradeState.peer?.publicKey` from the OrderState instance rather than through `session?.peer?.publicKey`, as the OrderState encapsulates peer information directly.
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/services/mostro_service.dart:70-76
Timestamp: 2025-05-06T15:49:26.443Z
Learning: In the Mostro Mobile codebase, `eventStorageProvider` is exported from `package:mostro_mobile/shared/providers/mostro_service_provider.dart` and not from a separate `event_storage_provider.dart` file.
Learnt from: chebizarro
PR: MostroP2P/mobile#110
File: test/notifiers/take_order_notifier_test.dart:72-74
Timestamp: 2025-06-04T19:35:20.209Z
Learning: MostroService methods like takeBuyOrder() and takeSellOrder() return Future<void> and trigger side effects through other mechanisms rather than direct return values. When testing these methods, focus on verifying method calls and testing state changes through the provider system rather than mocking return values.
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/services/mostro_service.dart:70-76
Timestamp: 2025-05-06T15:49:26.443Z
Learning: In the Mostro Mobile codebase, Riverpod code generation is used with `@Riverpod` annotations. Providers like `eventStorageProvider` are generated in `.g.dart` files from annotated functions in the main provider files. These providers are accessible by importing the main provider file (e.g., `mostro_service_provider.dart`), not by importing a separate provider file.
Learnt from: chebizarro
PR: MostroP2P/mobile#127
File: lib/features/order/notfiers/abstract_mostro_notifier.dart:45-54
Timestamp: 2025-06-26T15:03:23.529Z
Learning: In AbstractMostroNotifier, state updates occur for all messages regardless of timestamp to hydrate the OrderNotifier from MostroStorage during sync, while handleEvent is only called for recent messages (within 60 seconds) to prevent re-triggering side effects like notifications and navigation for previously handled messages. This design prevents displaying stale notifications when the app is reopened or brought to the foreground.
lib/features/order/screens/take_order_screen.dart (3)
Learnt from: chebizarro
PR: MostroP2P/mobile#110
File: test/notifiers/take_order_notifier_test.dart:72-74
Timestamp: 2025-06-04T19:35:20.209Z
Learning: MostroService methods like takeBuyOrder() and takeSellOrder() return Future<void> and trigger side effects through other mechanisms rather than direct return values. When testing these methods, focus on verifying method calls and testing state changes through the provider system rather than mocking return values.
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/services/mostro_service.dart:70-76
Timestamp: 2025-05-06T15:49:26.443Z
Learning: In the Mostro Mobile codebase, Riverpod code generation is used with `@Riverpod` annotations. Providers like `eventStorageProvider` are generated in `.g.dart` files from annotated functions in the main provider files. These providers are accessible by importing the main provider file (e.g., `mostro_service_provider.dart`), not by importing a separate provider file.
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/services/mostro_service.dart:70-76
Timestamp: 2025-05-06T15:49:26.443Z
Learning: In the Mostro Mobile codebase, `eventStorageProvider` is exported from `package:mostro_mobile/shared/providers/mostro_service_provider.dart` and not from a separate `event_storage_provider.dart` file.

Copy link
Member

@grunch grunch left a comment

Choose a reason for hiding this comment

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

Re-write comments to english

Copy link
Member

@grunch grunch left a comment

Choose a reason for hiding this comment

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

Please pay attention to rabbit comments and apply changes if needed, fix conflicts and rebase

Copy link
Member

@Catrya Catrya left a comment

Choose a reason for hiding this comment

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

Aunque la orden no tenga rango, de todas formas pide seleccionar la cantidad que vas a tomar. Esta orden es de 1 USD
image

Copy link
Member

@Catrya Catrya left a comment

Choose a reason for hiding this comment

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

Al dar a la flecha de ir para atrás, siempre lleva a la pantalla de My Trades, pero debería ir al libro de ordenes
image

Al seleccionar el botón de Close, sí funciona bien y lleva al libro de órdenes

Copy link
Member

@grunch grunch left a comment

Choose a reason for hiding this comment

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

Since now we are not having hardcoded text strings, text strings are now moved to ARB files in l10n directory, please with each new text string you need to add, also add a key in ARB files in spanish, italian and english

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

🧹 Nitpick comments (1)
lib/features/trades/screens/trade_detail_screen.dart (1)

518-532: TODO comment needs attention for creator reputation.

The creator reputation display currently uses placeholder values with a TODO comment indicating the need to implement extraction of creator rating data.

The TODO comment indicates that extraction of creator rating data from Nostr events needs to be implemented. This is important for displaying actual reputation data instead of hardcoded values.

Would you like me to help implement the creator rating extraction logic or open a new issue to track this task?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5870f84 and 6799d4c.

📒 Files selected for processing (3)
  • lib/features/order/screens/take_order_screen.dart (3 hunks)
  • lib/features/trades/screens/trade_detail_screen.dart (19 hunks)
  • lib/shared/widgets/order_cards.dart (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • lib/features/order/screens/take_order_screen.dart
🧰 Additional context used
🧠 Learnings (1)
lib/features/trades/screens/trade_detail_screen.dart (3)
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/features/trades/models/trade_state.dart:1-15
Timestamp: 2025-05-08T16:06:33.665Z
Learning: In the context of the Mostro Mobile app, the `TradeState` class is specifically constructed using the `tradeStateProvider`. While some fields are nullable (`lastAction` and `orderPayload`), they are still marked as required parameters to ensure they are explicitly considered during state construction.
Learnt from: chebizarro
PR: MostroP2P/mobile#110
File: lib/features/trades/widgets/mostro_message_detail_widget.dart:134-141
Timestamp: 2025-06-08T23:54:09.987Z
Learning: In the OrderState refactor, public keys should be accessed via `tradeState.peer?.publicKey` from the OrderState instance rather than through `session?.peer?.publicKey`, as the OrderState encapsulates peer information directly.
Learnt from: chebizarro
PR: MostroP2P/mobile#110
File: test/notifiers/take_order_notifier_test.dart:72-74
Timestamp: 2025-06-04T19:35:20.209Z
Learning: MostroService methods like takeBuyOrder() and takeSellOrder() return Future<void> and trigger side effects through other mechanisms rather than direct return values. When testing these methods, focus on verifying method calls and testing state changes through the provider system rather than mocking return values.
🔇 Additional comments (16)
lib/shared/widgets/order_cards.dart (7)

1-6: Good import organization and comprehensive dependencies.

The imports are well-organized with proper separation of Flutter core, services, and app-specific modules. All necessary dependencies are included for the widgets' functionality.


8-89: Well-structured OrderAmountCard with good flexibility.

The OrderAmountCard widget is well-designed with:

  • Clear parameter interface with appropriate optional fields
  • Proper null safety handling with conditional rendering
  • Consistent text styling and layout
  • Good use of Flutter's conditional widget rendering with spread operators

The implementation follows Flutter best practices and provides good flexibility for different use cases.


92-135: Clean and consistent PaymentMethodCard implementation.

The widget follows the same design pattern as other cards with:

  • Proper use of localization (S.of(context)!.paymentMethod)
  • Consistent styling and layout
  • Clear visual hierarchy with icon and text

138-181: Consistent CreatedDateCard implementation.

The widget maintains consistency with other cards and properly uses localization for the label text.


184-237: OrderIdCard with good UX for copy functionality.

The widget provides excellent user experience with:

  • Clear visual indication of the order ID using AppTheme.mostroGreen
  • Proper clipboard functionality
  • User feedback via SnackBar with localized message
  • Clean layout with copy button

240-380: CreatorReputationCard with well-structured layout.

The widget provides a comprehensive reputation display with:

  • Three-column layout for rating, reviews, and days
  • Proper use of icons for visual context
  • Consistent text styling and spacing
  • Good use of MainAxisAlignment.spaceAround for even distribution

383-421: Flexible NotificationMessageCard with good defaults.

The widget provides good flexibility with:

  • Customizable icon and color with sensible defaults
  • Proper layout with icon and expandable text
  • Consistent padding and styling
lib/features/trades/screens/trade_detail_screen.dart (9)

8-20: Good import organization with new dependencies.

The imports are properly organized with the addition of necessary dependencies for the new card widgets and utilities.


35-47: Consistent background color update.

The background color has been updated to use AppTheme.backgroundDark for consistency with other screens, and proper localization is used for the app bar title.


40-44: Clean logic for creator determination.

The logic to determine if the current user is the creator of a pending order is clear and properly separated into variables for readability.


61-68: Good conditional rendering for creator reputation.

The conditional rendering properly handles the different UI states for pending orders created by the user versus other states.


98-153: Excellent refactoring with reusable card widgets.

The refactoring successfully replaces inline card implementations with the new reusable card widgets. The implementation properly handles:

  • Conditional logic for pending orders created by the user
  • Proper data formatting and preparation
  • Clean separation of concerns
  • Consistent spacing and layout

This addresses the previous review comment about refactoring to use reusable card widgets.


185-207: Consistent use of new card widgets for non-pending orders.

The implementation maintains consistency by using the new card widgets even for non-pending orders, ensuring a unified UI experience.


212-214: Simplified OrderIdCard integration.

The order ID display has been successfully simplified by using the new OrderIdCard widget, removing the need for inline card implementation.


534-543: Excellent helper method for DRY principle.

The _isUserCreator helper method successfully eliminates code duplication and provides a clean, reusable way to determine creator status. This addresses the previous review comment about extracting duplicate creator check logic.


547-557: Improved date formatting for better readability.

The date formatting has been updated to provide a clearer, more user-friendly format with separate date and time components and simplified timezone offset display.

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

🧹 Nitpick comments (3)
lib/features/trades/screens/trade_detail_screen.dart (3)

186-188: Remove unused variable

The amountString variable is declared but never used, as indicated by the pipeline failure.

-    final amountString =
-        '${tradeState.order!.fiatAmount} ${tradeState.order!.fiatCode} $currencyFlag';

196-196: Fix dead null-aware expression

The session is already null-checked above (line 165), so the null-aware operator is unnecessary here.

-          : session.startTime ?? DateTime.now(),
+          : session!.startTime ?? DateTime.now(),

538-552: Creator reputation placeholder needs implementation

The TODO comment indicates that the creator rating data extraction is not yet implemented. The placeholder values (3.1, 15, 7) should be replaced with actual data when available.

The static values are acceptable for now, but consider implementing the actual creator rating extraction from Nostr events as mentioned in the PR objectives. Do you want me to help implement this functionality or create an issue to track this work?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6799d4c and 621f7cf.

📒 Files selected for processing (2)
  • lib/features/order/screens/take_order_screen.dart (3 hunks)
  • lib/features/trades/screens/trade_detail_screen.dart (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • lib/features/order/screens/take_order_screen.dart
🧰 Additional context used
🧠 Learnings (1)
lib/features/trades/screens/trade_detail_screen.dart (5)
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/features/trades/models/trade_state.dart:1-15
Timestamp: 2025-05-08T16:06:33.665Z
Learning: In the context of the Mostro Mobile app, the `TradeState` class is specifically constructed using the `tradeStateProvider`. While some fields are nullable (`lastAction` and `orderPayload`), they are still marked as required parameters to ensure they are explicitly considered during state construction.
Learnt from: chebizarro
PR: MostroP2P/mobile#110
File: lib/features/trades/widgets/mostro_message_detail_widget.dart:134-141
Timestamp: 2025-06-08T23:54:09.987Z
Learning: In the OrderState refactor, public keys should be accessed via `tradeState.peer?.publicKey` from the OrderState instance rather than through `session?.peer?.publicKey`, as the OrderState encapsulates peer information directly.
Learnt from: chebizarro
PR: MostroP2P/mobile#110
File: test/notifiers/take_order_notifier_test.dart:72-74
Timestamp: 2025-06-04T19:35:20.209Z
Learning: MostroService methods like takeBuyOrder() and takeSellOrder() return Future<void> and trigger side effects through other mechanisms rather than direct return values. When testing these methods, focus on verifying method calls and testing state changes through the provider system rather than mocking return values.
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/services/mostro_service.dart:70-76
Timestamp: 2025-05-06T15:49:26.443Z
Learning: In the Mostro Mobile codebase, Riverpod code generation is used with `@Riverpod` annotations. Providers like `eventStorageProvider` are generated in `.g.dart` files from annotated functions in the main provider files. These providers are accessible by importing the main provider file (e.g., `mostro_service_provider.dart`), not by importing a separate provider file.
Learnt from: chebizarro
PR: MostroP2P/mobile#127
File: lib/features/order/notfiers/abstract_mostro_notifier.dart:45-54
Timestamp: 2025-06-26T15:03:23.529Z
Learning: In AbstractMostroNotifier, state updates occur for all messages regardless of timestamp to hydrate the OrderNotifier from MostroStorage during sync, while handleEvent is only called for recent messages (within 60 seconds) to prevent re-triggering side effects like notifications and navigation for previously handled messages. This design prevents displaying stale notifications when the app is reopened or brought to the foreground.
🪛 GitHub Actions: Flutter
lib/features/trades/screens/trade_detail_screen.dart

[error] 140-140: The getter 'youCreatedThisOffer' isn't defined for the type 'S' (undefined_getter)


[error] 145-145: The method 'someoneIsSelling' isn't defined for the type 'S' (undefined_method)


[warning] 186-186: The value of the local variable 'amountString' isn't used (unused_local_variable)


[warning] 196-196: The left operand can't be null, so the right operand is never executed (dead_null_aware_expression)


[error] 204-204: The getter 'youAreSelling' isn't defined for the type 'S' (undefined_getter)


[error] 205-205: The getter 'youAreBuying' isn't defined for the type 'S' (undefined_getter)

🔇 Additional comments (10)
lib/features/trades/screens/trade_detail_screen.dart (10)

8-8: Import organization looks good

The new imports for OrderType, order_cards.dart, currency_utils.dart, and Session are properly organized and necessary for the new functionality.

Also applies to: 14-14, 19-21


37-37: Background color update aligns with theme consistency

The change from AppTheme.dark1 to AppTheme.backgroundDark maintains consistency with the app's dark theme as mentioned in the PR objectives.

Also applies to: 49-49


42-46: Creator logic implementation is correct

The logic to determine if the user is the creator and if the order is pending is well-implemented and uses the extracted _isUserCreator helper method.


65-72: Conditional rendering logic is appropriate

The use of spread operators and conditional rendering for showing creator reputation vs. message details based on pending status and creator role is well-structured.


75-80: Countdown time formatting is properly handled

The null check for expiresAt and proper timestamp conversion ensures safe date handling.


116-162: Excellent refactoring to use reusable card widgets

The refactoring to use NotificationMessageCard, OrderAmountCard, PaymentMethodCard, and CreatedDateCard from the shared order_cards.dart greatly improves code maintainability and consistency. The conditional rendering for pending orders created by the user provides a better user experience.


200-223: Good refactoring to use reusable card widgets

The non-pending order display has been successfully refactored to use the new reusable card widgets, improving consistency with the rest of the application.


229-232: OrderIdCard refactoring is clean

The replacement of the manually constructed card with the reusable OrderIdCard widget improves maintainability and consistency.


554-563: Helper method implementation is correct

The _isUserCreator helper method properly addresses the DRY principle concern from the past review comment. The null checks ensure safe access to session and order properties.


566-577: Date formatting improvement is user-friendly

The simplified date/time format with timezone offset provides better clarity as mentioned in the PR objectives. The format "Thu, Jul 03 2025 at 23:56 (GMT-03)" is much more readable than the previous verbose format.

@Catrya
Copy link
Member

Catrya commented Jul 8, 2025

lo de la hora que te mostraba a ti que se creaba las ordenes no se por que pasa, puede ser que tu emulador este usando una hora diferente, lo probe en el emulador y en el celu y concuerda bien la hora de creacion, arregle lo que me habias pedido, la internacionalizacion tiene detalles eso si

Hola @AndreaDiazCorreia ya reviso. Si te refieresa esto:

En esta pantalla de Detalle de las órdenes, hay que revisar bien y arreglar que en algunas órdenes sale el tiempo restante en 0 pero la orden aún está en pending, como esta, que fue publicada hace solamente 4 horas, además verifiqué que la orden sigue en status pending

No es cosa de mi emulador, lo veía también en mi móvil con la ultima release que se lanzó, pasa con frecuencia, y varios usuarios lo han reportado en el grupo de soporte de Mostro. No tiene exactamente que ver con los diseños, pero como es un error que ocurre en esta pantalla quizás sea bueno ya resolverlo aquí, no sé si @chebizarro @grunch crean mejor revisarlo luego y resolverlo en otro PR, a mí me parece bien cualquiera
image

@Catrya
Copy link
Member

Catrya commented Jul 8, 2025

Esto no es un error, pero creo que mejor quitamos la referencia de zona horaria para que quede más simple la hora
image

@Catrya
Copy link
Member

Catrya commented Jul 8, 2025

@AndreaDiazCorreia mira esta orden, sale el reloj con tiempo restante 0, pero la orden esta pending, id 76c91fe1-10aa-422b-9a68-8af64a6aa2f2
image

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

♻️ Duplicate comments (2)
lib/l10n/intl_es.arb (1)

449-449: Remove duplicate "done" key.

The "done" key is duplicated (already exists at line 125: "done": "Hecho"). This will cause JSON parsing issues and potential runtime errors.

-  "done": "HECHO"
+  "doneButton": "HECHO"
lib/l10n/intl_it.arb (1)

449-449: Remove duplicate "done" key.

The "done" key is duplicated (already exists at line 125: "done": "Fatto"). This will cause JSON parsing issues and potential runtime errors.

-  "done": "FATTO"
+  "doneButton": "FATTO"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between afc5938 and 10b4071.

📒 Files selected for processing (3)
  • lib/l10n/intl_en.arb (1 hunks)
  • lib/l10n/intl_es.arb (1 hunks)
  • lib/l10n/intl_it.arb (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • lib/l10n/intl_en.arb
🧰 Additional context used
📓 Path-based instructions (2)
`lib/l10n/intl_{en,es,it}.arb`: Add new localization keys to all three ARB files (en, es, it)

lib/l10n/intl_{en,es,it}.arb: Add new localization keys to all three ARB files (en, es, it)

📄 Source: CodeRabbit Inference Engine (CLAUDE.md)

List of files the instruction was applied to:

  • lib/l10n/intl_es.arb
  • lib/l10n/intl_it.arb
`lib/l10n/*.arb`: Use proper ARB metadata for strings with parameters

lib/l10n/*.arb: Use proper ARB metadata for strings with parameters

📄 Source: CodeRabbit Inference Engine (CLAUDE.md)

List of files the instruction was applied to:

  • lib/l10n/intl_es.arb
  • lib/l10n/intl_it.arb
🧠 Learnings (2)
lib/l10n/intl_es.arb (2)
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.501Z
Learning: Applies to lib/l10n/intl_{en,es,it}.arb : Add new localization keys to all three ARB files (en, es, it)
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.501Z
Learning: Applies to lib/l10n/*.arb : Use proper ARB metadata for strings with parameters
lib/l10n/intl_it.arb (2)
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.501Z
Learning: Applies to lib/l10n/intl_{en,es,it}.arb : Add new localization keys to all three ARB files (en, es, it)
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.501Z
Learning: Applies to lib/l10n/*.arb : Use proper ARB metadata for strings with parameters
🪛 RuboCop (1.75.5)
lib/l10n/intl_es.arb

[fatal] 443-443: unexpected token tSTRING
(Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)

(Lint/Syntax)

lib/l10n/intl_it.arb

[fatal] 443-443: unexpected token tSTRING
(Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)

(Lint/Syntax)

🪛 GitHub Actions: Flutter
lib/l10n/intl_es.arb

[error] 443-443: Flutter pub get failed due to formatting issue in ARB file: FormatException: Unexpected character at line 443, character 3.

Comment on lines 413 to 415
"youAreSellingTitle": "Estás vendiendo{sats} sats",
"youAreBuyingTitle": "Estás comprando{sats} sats",
"forAmount": "por {amount}",
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

Add missing ARB metadata for additional parameterized strings.

These strings also contain placeholders but lack the required metadata.

  "youAreSellingTitle": "Estás vendiendo{sats} sats",
+ "@youAreSellingTitle": {
+   "placeholders": {
+     "sats": {
+       "type": "String"
+     }
+   }
+ },
  "youAreBuyingTitle": "Estás comprando{sats} sats",
+ "@youAreBuyingTitle": {
+   "placeholders": {
+     "sats": {
+       "type": "String"
+     }
+   }
+ },
  "forAmount": "por {amount}",
+ "@forAmount": {
+   "placeholders": {
+     "amount": {
+       "type": "String"
+     }
+   }
+ },
📝 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
"youAreSellingTitle": "Estás vendiendo{sats} sats",
"youAreBuyingTitle": "Estás comprando{sats} sats",
"forAmount": "por {amount}",
"youAreSellingTitle": "Estás vendiendo{sats} sats",
"@youAreSellingTitle": {
"placeholders": {
"sats": {
"type": "String"
}
}
},
"youAreBuyingTitle": "Estás comprando{sats} sats",
"@youAreBuyingTitle": {
"placeholders": {
"sats": {
"type": "String"
}
}
},
"forAmount": "por {amount}",
"@forAmount": {
"placeholders": {
"amount": {
"type": "String"
}
}
},
🤖 Prompt for AI Agents
In lib/l10n/intl_es.arb around lines 413 to 415, the parameterized strings
"youAreSellingTitle" and "youAreBuyingTitle" are missing the necessary ARB
metadata that describes their placeholders. Add metadata entries for these keys
specifying the placeholders used (e.g., "sats") and their types to ensure proper
localization handling.

@Catrya
Copy link
Member

Catrya commented Jul 9, 2025

@AndreaDiazCorreia

Aquí no se tradujo "You are selling" tampoco el "You are buying"
image

En mi telefono se esta viendo el boton de Comprar Bitcoin asi, no qued bien en español
image

@AndreaDiazCorreia
Copy link
Member Author

@Catrya le agregue algo para que haga auto size con la tipografia y que los botones se vean bien pero prueba porque en mi emulador y en mi celu se ven bien los botones

@Catrya
Copy link
Member

Catrya commented Jul 10, 2025

@Catrya le agregue algo para que haga auto size con la tipografia y que los botones se vean bien pero prueba porque en mi emulador y en mi celu se ven bien los botones

sigue saliendo igual en mi telefono 😓

@Catrya
Copy link
Member

Catrya commented Jul 10, 2025

También me di cuenta que la fecha no se está traduciendo
image

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

♻️ Duplicate comments (2)
lib/l10n/intl_it.arb (1)

492-492: Remove duplicate localization key.

The "done" key at line 492 conflicts with the existing key at line 125. This duplicate will cause JSON parsing errors and potential runtime issues.

Remove the duplicate key:

-  "done": "FATTO",
lib/l10n/intl_es.arb (1)

484-484: Remove duplicate localization key.

The "done" key at line 484 conflicts with the existing key at line 125. This duplicate will cause JSON parsing errors and potential runtime issues.

Remove the duplicate key:

-  "done": "HECHO",
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aca0f03 and 2e40c89.

⛔ Files ignored due to path filters (1)
  • pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • lib/features/order/screens/take_order_screen.dart (2 hunks)
  • lib/features/trades/screens/trade_detail_screen.dart (14 hunks)
  • lib/features/trades/widgets/trades_list_item.dart (9 hunks)
  • lib/l10n/intl_en.arb (1 hunks)
  • lib/l10n/intl_es.arb (1 hunks)
  • lib/l10n/intl_it.arb (1 hunks)
  • pubspec.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • pubspec.yaml
  • lib/features/trades/widgets/trades_list_item.dart
  • lib/l10n/intl_en.arb
  • lib/features/trades/screens/trade_detail_screen.dart
  • lib/features/order/screens/take_order_screen.dart
🧰 Additional context used
📓 Path-based instructions (2)
`lib/l10n/intl_{en,es,it}.arb`: Add new localization keys to all three ARB files (en, es, it)

lib/l10n/intl_{en,es,it}.arb: Add new localization keys to all three ARB files (en, es, it)

📄 Source: CodeRabbit Inference Engine (CLAUDE.md)

List of files the instruction was applied to:

  • lib/l10n/intl_es.arb
  • lib/l10n/intl_it.arb
`lib/l10n/*.arb`: Use proper ARB metadata for strings with parameters

lib/l10n/*.arb: Use proper ARB metadata for strings with parameters

📄 Source: CodeRabbit Inference Engine (CLAUDE.md)

List of files the instruction was applied to:

  • lib/l10n/intl_es.arb
  • lib/l10n/intl_it.arb
🧠 Learnings (2)
lib/l10n/intl_es.arb (5)
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Applies to lib/l10n/intl_{en,es,it}.arb : Add new localization keys to all three ARB files (en, es, it)
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Applies to lib/l10n/*.arb : Use proper ARB metadata for strings with parameters
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Target zero `flutter analyze` issues
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Regenerate localization files after ARB modifications by running `dart run build_runner build -d`
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Always maintain zero Flutter analyze issues
lib/l10n/intl_it.arb (4)
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Applies to lib/l10n/intl_{en,es,it}.arb : Add new localization keys to all three ARB files (en, es, it)
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Applies to lib/l10n/*.arb : Use proper ARB metadata for strings with parameters
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Regenerate localization files after ARB modifications by running `dart run build_runner build -d`
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Target zero `flutter analyze` issues
🪛 RuboCop (1.75.5)
lib/l10n/intl_es.arb

[warning] 484-484: Duplicated key in hash literal.

(Lint/DuplicateHashKey)

lib/l10n/intl_it.arb

[warning] 492-492: Duplicated key in hash literal.

(Lint/DuplicateHashKey)

⏰ 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: build
🔇 Additional comments (2)
lib/l10n/intl_it.arb (1)

411-483: LGTM for new localization keys.

The comprehensive set of new Italian localization keys properly supports the trade detail screen UI enhancements. The translations are appropriate and maintain consistency with the existing Italian translations.

lib/l10n/intl_es.arb (1)

411-473: LGTM for new localization keys.

The comprehensive set of new Spanish localization keys properly supports the trade detail screen UI enhancements. The translations are appropriate and maintain consistency with the existing Spanish translations.

Copy link
Member

@Catrya Catrya left a comment

Choose a reason for hiding this comment

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

Copy link
Member

@grunch grunch left a comment

Choose a reason for hiding this comment

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

utACK

@grunch grunch merged commit 02ec008 into MostroP2P:main Jul 11, 2025
2 checks passed
@AndreaDiazCorreia AndreaDiazCorreia deleted the feat/issue-119 branch July 16, 2025 20:40
@coderabbitai coderabbitai bot mentioned this pull request Aug 28, 2025
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