Skip to content

flatten pay-invoice and add-invoice screens#593

Merged
grunch merged 1 commit into
mainfrom
improve-ux-pay-invoice
May 15, 2026
Merged

flatten pay-invoice and add-invoice screens#593
grunch merged 1 commit into
mainfrom
improve-ux-pay-invoice

Conversation

@Catrya
Copy link
Copy Markdown
Member

@Catrya Catrya commented May 14, 2026

  • remove inner gray card wrapper from add-invoice screen
  • remove CustomCard and Material wrappers from pay-invoice screen
  • drop unused custom_card import
  • set scaffold background to dark1 on both screens
  • apply consistent padding with safe-area bottom inset
image image

Summary by CodeRabbit

  • Style
    • Refined Lightning invoice payment screens with improved spacing and layout consistency for a cleaner visual presentation.

Review Change Stack

  - remove inner gray card wrapper from add-invoice screen
  - remove CustomCard and Material wrappers from pay-invoice screen
  - drop unused custom_card import
  - set scaffold background to dark1 on both screens
  - apply consistent padding with safe-area bottom inset
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f2c6fa13-504c-41a9-b7bc-205bc587c517

📥 Commits

Reviewing files that changed from the base of the PR and between b8bbee9 and a4e7ebe.

📒 Files selected for processing (2)
  • lib/features/order/screens/add_lightning_invoice_screen.dart
  • lib/features/order/screens/pay_lightning_invoice_screen.dart

Walkthrough

Two Lightning invoice screens are refactored to simplify their Scaffold layouts: AddLightningInvoiceScreen now uses a cleaner padding structure with an explicit background color instead of a card-style container, and PayLightningInvoiceScreen removes its CustomCard wrapper and adopts direct padding layout with viewport-aware insets. Conditional rendering logic and user interactions remain unchanged.

Changes

Lightning Invoice Screen Layout Refactoring

Layer / File(s) Summary
AddLightningInvoiceScreen layout refactoring
lib/features/order/screens/add_lightning_invoice_screen.dart
Scaffold background color explicitly set to AppTheme.dark1; previous Padding+Column+Container card layout replaced with simpler Padding using EdgeInsets.fromLTRB that accounts for bottom viewPadding. Conditional rendering branches for LN address confirmation, NWC invoice, and manual invoice entry repositioned directly under padding.
PayLightningInvoiceScreen layout and import cleanup
lib/features/order/screens/pay_lightning_invoice_screen.dart
CustomCard import removed; Scaffold.body refactored from CustomCard/Material wrapper to direct Padding + Column layout with explicit left/right/top/bottom padding derived from MediaQuery.viewPadding.bottom. Conditional NWC auto-payment vs manual payment rendering and order cancellation button behavior preserved.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • MostroP2P/mobile#475: Both PRs modify the Lightning-invoice screen UI in add_lightning_invoice_screen.dart—main PR refactors its Scaffold/padding layout while PR #475 adds the LN-address confirmation branching and related widget placement under that screen.
  • MostroP2P/mobile#265: Both PRs modify the AddLightningInvoiceScreen UI structure/styling (e.g., scaffold/background color and body layout/padding/container presentation), so the main PR's changes overlap with #265's add_lightning_invoice_screen.dart updates.
  • MostroP2P/mobile#469: The main PR's AddLightningInvoiceScreen refactor changes the surrounding Scaffold/padding layout while preserving and still rendering the same NWC/manual conditional flow (showNwcInvoice/_manualMode) introduced in PR #469.

Suggested reviewers

  • AndreaDiazCorreia
  • BraCR10
  • grunch

Poem

🐰 With card wrappers gone and padding refined,
Lightning screens now shine in dark1 divine!
No more containers cluttering the view—
Just padding and flow, fresh and new. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'flatten pay-invoice and add-invoice screens' accurately and concisely describes the main refactoring changes made in both modified files, which involve removing wrapper containers (card, Material) and simplifying layout structures.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch improve-ux-pay-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

Comment @coderabbitai help to get the list of available commands and usage tips.

@Catrya
Copy link
Copy Markdown
Member Author

Catrya commented May 14, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@mostronatorcoder mostronatorcoder Bot left a comment

Choose a reason for hiding this comment

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

I reviewed this PR and I do not see a correctness issue here. This is a focused layout simplification that keeps the existing payment and cancellation behavior intact while removing unnecessary wrapper structure.

What looks good:

  • add_lightning_invoice_screen.dart is flatter and cleaner now, with consistent outer padding and safe-area bottom handling instead of the extra inner card/container layer.
  • pay_lightning_invoice_screen.dart removes CustomCard / Material wrappers without changing the actual NWC/manual flow branches or the existing callbacks.
  • Both screens now use AppTheme.dark1 consistently at the scaffold level, which matches the stated UI goal of the PR.
  • CI is green.

Given the current scope, this looks like a clean UI refactor with no unintended logic change. Approved.

Copy link
Copy Markdown
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.

LGTM

@grunch grunch merged commit 48d4bb5 into main May 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants