Skip to content

feat: improve UI/UX for order amount input and lightning invoice screens#265

Merged
Catrya merged 2 commits into
mainfrom
ui-modal-add-invoice
Aug 6, 2025
Merged

feat: improve UI/UX for order amount input and lightning invoice screens#265
Catrya merged 2 commits into
mainfrom
ui-modal-add-invoice

Conversation

@Catrya
Copy link
Copy Markdown
Member

@Catrya Catrya commented Aug 6, 2025

  • Enhance amount input dialog with better styling and proper theming
  • Improve AddLightningInvoiceScreen UI with modern card design and proper localization
  • Add currency display to amount range hints for better user context
  • Update styling to use consistent theme colors and spacing

Summary by CodeRabbit

  • Style

    • Refreshed the visual appearance of the Add Lightning Invoice screen and amount entry dialog, including updated colors, borders, padding, and button styles for a more polished look.
    • Improved the styling and layout of the Lightning invoice input field and action buttons.
  • Localization

    • Updated and streamlined the "enter amount between" message in English, Spanish, and Italian, now displaying the range with currency.
    • Added new localized strings for "Add Lightning Invoice" in English, Spanish, and Italian.

  - Enhance amount input dialog with better styling and proper theming
  - Improve AddLightningInvoiceScreen UI with modern card design and proper localization
  - Add currency display to amount range hints for better user context
  - Update styling to use consistent theme colors and spacing
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 6, 2025

Walkthrough

The changes focus on updating UI styling and localization for Lightning invoice and order-related screens and widgets. Dialogs and input fields receive visual enhancements, including new colors, borders, and text styles. Localization files are updated to refine messages and add new strings. No business logic or control flow is altered.

Changes

Cohort / File(s) Change Summary
Add Lightning Invoice Screen UI & Localization
lib/features/order/screens/add_lightning_invoice_screen.dart
Updated app bar title to use localization, changed background and container colors, adjusted border radius, and added a subtle border for improved visual appearance.
Order Amount Dialog UI
lib/features/order/screens/take_order_screen.dart
Enhanced the AlertDialog's styling, including background, border, title, text field, and action buttons; no functional or logic changes.
Localization: English, Spanish, Italian
lib/l10n/intl_en.arb, lib/l10n/intl_es.arb, lib/l10n/intl_it.arb
Modified "enterAmountBetween" to use a concise range format with a new "currency" placeholder; added "addLightningInvoice" string in all three languages.
Add Lightning Invoice Widget Styling
lib/shared/widgets/add_lightning_invoice_widget.dart
Updated text styles, input field decoration, and button appearances for a more modern and consistent UI; no changes to widget logic or callbacks.

Sequence Diagram(s)

No sequence diagram generated as changes are limited to UI styling and localization, with no modifications to control flow or feature logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • grunch

Poem

In a world of invoices, bright and neat,
New colors and borders make screens a treat.
With words refined in every tongue,
The Lightning flows, the UI’s young.
Buttons and fields now gleam with pride—
A rabbit’s delight, with style as its guide!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 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 b0834e2 and d695964.

📒 Files selected for processing (3)
  • lib/l10n/intl_en.arb (2 hunks)
  • lib/l10n/intl_es.arb (2 hunks)
  • lib/l10n/intl_it.arb (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • lib/l10n/intl_es.arb
  • lib/l10n/intl_it.arb
  • lib/l10n/intl_en.arb
⏰ 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
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ui-modal-add-invoice

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.
  • 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.

Support

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

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 generate unit tests to generate unit tests for 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
Copy Markdown
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 (3)
lib/l10n/intl_en.arb (1)

497-508: Add placeholder descriptions for full ARB metadata compliance

Guidelines require “proper ARB metadata” for parameterized strings.
min, max, and the newly-added currency placeholder expose only the type field. For consistency with the rest of the file (e.g. @payInvoice, @addInvoice) and to aid translators, please add a brief description for each placeholder.

       "min": {
         "type": "String",
+        "description": "Minimum amount that can be entered"
       },
       "max": {
         "type": "String",
+        "description": "Maximum amount that can be entered"
       },
       "currency": {
-        "type": "String"
+        "type": "String",
+        "description": "Currency code or symbol shown after the range"
       }

After updating, remember to re-run flutter gen-l10n (or your intl code-gen task) so the generated delegates include the new placeholder.

lib/l10n/intl_es.arb (1)

450-461: Añadir descripciones a los placeholders

Para cumplir con la regla de “metadata ARB apropiada”, agrega description a min, max y currency, igual que en el archivo en inglés.

lib/l10n/intl_it.arb (1)

455-466: Manca la descrizione dei placeholder

Come negli altri file, aggiungi un breve description per min, max e currency all’interno di @enterAmountBetween per uniformità e per aiutare i traduttori.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8f9e642 and b0834e2.

📒 Files selected for processing (6)
  • lib/features/order/screens/add_lightning_invoice_screen.dart (2 hunks)
  • lib/features/order/screens/take_order_screen.dart (2 hunks)
  • lib/l10n/intl_en.arb (2 hunks)
  • lib/l10n/intl_es.arb (2 hunks)
  • lib/l10n/intl_it.arb (2 hunks)
  • lib/shared/widgets/add_lightning_invoice_widget.dart (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
lib/features/*/{screens,providers,notifiers,widgets}/**

📄 CodeRabbit Inference Engine (CLAUDE.md)

Feature-based organization: features/{feature}/{screens|providers|notifiers|widgets}/

Files:

  • lib/features/order/screens/add_lightning_invoice_screen.dart
  • lib/features/order/screens/take_order_screen.dart
lib/**/*.dart

📄 CodeRabbit Inference Engine (CLAUDE.md)

lib/**/*.dart: Use S.of(context).yourKey for all user-facing strings
Always check mounted before using context after async operations

Files:

  • lib/features/order/screens/add_lightning_invoice_screen.dart
  • lib/features/order/screens/take_order_screen.dart
  • lib/shared/widgets/add_lightning_invoice_widget.dart
**/*.dart

📄 CodeRabbit Inference Engine (CLAUDE.md)

**/*.dart: Remove unused imports and dependencies
Use const constructors where possible

Files:

  • lib/features/order/screens/add_lightning_invoice_screen.dart
  • lib/features/order/screens/take_order_screen.dart
  • lib/shared/widgets/add_lightning_invoice_widget.dart
lib/l10n/*.arb

📄 CodeRabbit Inference Engine (CLAUDE.md)

lib/l10n/*.arb: Internationalization ARB files must be located in lib/l10n/
Add new localization keys to all three ARB files (en, es, it)
Use proper ARB metadata for parameterized strings

Files:

  • lib/l10n/intl_it.arb
  • lib/l10n/intl_es.arb
  • lib/l10n/intl_en.arb
lib/shared/**

📄 CodeRabbit Inference Engine (CLAUDE.md)

Shared utilities and widgets must be placed in shared/

Files:

  • lib/shared/widgets/add_lightning_invoice_widget.dart
🧠 Learnings (8)
📚 Learning: all changes should pass `flutter analyze` before commit...
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-03T09:43:38.727Z
Learning: All changes should pass `flutter analyze` before commit

Applied to files:

  • lib/features/order/screens/add_lightning_invoice_screen.dart
  • lib/features/order/screens/take_order_screen.dart
  • lib/shared/widgets/add_lightning_invoice_widget.dart
📚 Learning: applies to lib/**/*.dart : use `s.of(context).yourkey` for all user-facing strings...
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-03T09:43:38.727Z
Learning: Applies to lib/**/*.dart : Use `S.of(context).yourKey` for all user-facing strings

Applied to files:

  • lib/features/order/screens/add_lightning_invoice_screen.dart
  • lib/features/order/screens/take_order_screen.dart
📚 Learning: applies to lib/shared/providers/mostro_database_provider.dart : database initialization must occur i...
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-03T09:43:38.727Z
Learning: Applies to lib/shared/providers/mostro_database_provider.dart : Database initialization must occur in `shared/providers/mostro_database_provider.dart`

Applied to files:

  • lib/features/order/screens/add_lightning_invoice_screen.dart
📚 Learning: in the mostro mobile codebase, `eventstorageprovider` is exported from `package:mostro_mobile/shared...
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.

Applied to files:

  • lib/features/order/screens/add_lightning_invoice_screen.dart
📚 Learning: applies to lib/l10n/*.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-08-03T09:43:38.727Z
Learning: Applies to lib/l10n/*.arb : Add new localization keys to all three ARB files (en, es, it)

Applied to files:

  • lib/l10n/intl_it.arb
  • lib/l10n/intl_es.arb
  • lib/l10n/intl_en.arb
📚 Learning: applies to lib/l10n/*.arb : use proper arb metadata for parameterized strings...
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-03T09:43:38.727Z
Learning: Applies to lib/l10n/*.arb : Use proper ARB metadata for parameterized strings

Applied to files:

  • lib/l10n/intl_it.arb
  • lib/l10n/intl_es.arb
  • lib/l10n/intl_en.arb
📚 Learning: regenerate localization files after arb modifications...
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-03T09:43:38.727Z
Learning: Regenerate localization files after ARB modifications

Applied to files:

  • lib/l10n/intl_es.arb
📚 Learning: applies to lib/l10n/*.arb : internationalization arb files must be located in `lib/l10n/`...
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-03T09:43:38.727Z
Learning: Applies to lib/l10n/*.arb : Internationalization ARB files must be located in `lib/l10n/`

Applied to files:

  • lib/l10n/intl_es.arb
🔇 Additional comments (13)
lib/l10n/intl_en.arb (1)

556-556: LGTM – new key added

"addLightningInvoice" key is correctly introduced and contains no parameters, so no extra metadata is needed.

lib/l10n/intl_es.arb (1)

512-512: Clave nueva aceptada

"addLightningInvoice" se añadió correctamente y no requiere metadata extra.

lib/l10n/intl_it.arb (1)

517-517: Chiave nuova OK

"addLightningInvoice" è stata aggiunta correttamente; nessun metadata aggiuntivo necessario.

lib/features/order/screens/add_lightning_invoice_screen.dart (4)

10-10: LGTM! Proper localization import added.

The import is correctly added to support the localization of the app bar title.


40-40: LGTM! Improved theme naming convention.

The background color change from AppTheme.dark1 to AppTheme.backgroundDark provides better semantic clarity and consistency.


41-41: LGTM! Proper localization implementation.

The app bar title now correctly uses S.of(context)!.addLightningInvoice instead of a hardcoded string, following the coding guidelines for user-facing strings.


47-51: LGTM! Excellent UI improvements.

The container styling updates provide:

  • Better semantic theming with backgroundCard
  • Modern design with subtle border and appropriate border radius
  • Performance improvement with const padding
lib/shared/widgets/add_lightning_invoice_widget.dart (4)

44-46: LGTM! Improved text styling for better readability.

The changes to use AppTheme.textPrimary and medium font weight provide better visual hierarchy and semantic theming.


50-72: LGTM! Modern input field design implemented.

The container wrapper approach creates a polished input field with:

  • Consistent theming using AppTheme.backgroundInput
  • Subtle borders and proper border radius
  • Clean styling with removed input borders
  • Improved visual hierarchy

77-90: LGTM! Appropriate button hierarchy.

Converting the cancel button to TextButton with secondary text color follows common UX patterns where cancel actions are less prominent than primary actions.


91-111: LGTM! Modern submit button styling.

The button styling updates provide:

  • Better visual prominence with AppTheme.activeColor
  • Good contrast with black foreground
  • Consistent spacing and padding
  • Modern rounded corners
lib/features/order/screens/take_order_screen.dart (2)

265-301: LGTM! Comprehensive dialog UI enhancement.

The AlertDialog styling creates a cohesive visual experience with:

  • Consistent theming using AppTheme.backgroundCard and backgroundInput
  • Subtle borders and proper border radius
  • Clear typography hierarchy
  • Semantic color usage for different text elements

305-358: LGTM! Consistent button styling pattern.

The dialog button styling aligns with the design system established in other widgets:

  • Proper button hierarchy (TextButton for cancel, ElevatedButton for submit)
  • Consistent spacing and styling
  • Modern appearance with AppTheme.activeColor

@Catrya Catrya merged commit f4e6687 into main Aug 6, 2025
2 checks passed
@Catrya Catrya deleted the ui-modal-add-invoice branch August 8, 2025 22:11
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.

1 participant