Skip to content

fix(#267): add bottom SafeArea insets so the system bar doesn't overlap content - #295

Merged
Catrya merged 4 commits into
MostroP2P:mainfrom
codaMW:feat/267-safearea-bottom-insets
Aug 10, 2026
Merged

fix(#267): add bottom SafeArea insets so the system bar doesn't overlap content#295
Catrya merged 4 commits into
MostroP2P:mainfrom
codaMW:feat/267-safearea-bottom-insets

Conversation

@codaMW

@codaMW codaMW commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Closes #267.

Problem

Most screens don't handle the bottom safe-area inset, so the phone's system navigation bar (gesture bar ~24dp / 3-button bar ~48dp) overlaps the bottom of the content. The largest bottom padding in use was AppSpacing.lg (16px), which isn't enough for either bar, and there's no global SafeArea wrapper (no ShellRoute / shared scaffold), so each screen must protect itself.

Fix

Add MediaQuery.of(context).viewPadding.bottom to the bottom padding of each affected screen the same mechanism the BottomNavBar screens already rely on. Minimal and per-screen: the existing padding is extended, no widget trees are restructured.

Scrollable content (last item was hidden at max scroll):
settings, notification settings, notifications, log report, trade detail, about.

Interactive elements pinned at the bottom:
dispute chat (message input), walkthrough (Skip/Back/Next/Done controls), add / pay lightning invoice (Cancel/Submit), connect wallet, wallet settings, account (Import/Refresh row).

Screens already handled by BottomNavBar or an existing SafeArea (Home, Trades, Chat, Add/My/Take Order, Backup ritual, Rate) are untouched.

Testing

Verified on Linux desktop with a simulated 48px bottom system bar (temporarily injecting MediaQuery viewPadding.bottom: 48 at the app root plus a translucent band marking the bar). On every affected screen the last item / bottom control now clears the simulated bar instead of being overlapped.

Screenshots below.

flutter analyze clean across all 13 files.
Screenshot 2026-08-09 193825
Screenshot 2026-08-09 193903
Screenshot 2026-08-09 193937
Screenshot 2026-08-09 193958
Screenshot 2026-08-09 194021
Screenshot 2026-08-09 194100
Screenshot 2026-08-09 194113
Screenshot 2026-08-09 194211

Summary by CodeRabbit

  • Bug Fixes
    • Improved bottom spacing across account, settings, notifications, trade, dispute, invoice, walkthrough, and other screens.
    • Content, forms, list items, and action buttons now remain visible above gesture and navigation bars.
    • Improved bottom-sheet spacing when the keyboard or system navigation controls are visible.
    • Added coverage to verify correct layout behavior with and without the on-screen keyboard.

…esn't overlap content

Most screens didn't account for the bottom safe-area inset, so the phone's
gesture / 3-button navigation bar overlapped the bottom of the content
(AppSpacing.lg = 16px was not enough for a ~24-48dp bar). There is no global
SafeArea wrapper, so each screen must protect itself.

Adds MediaQuery.viewPadding.bottom to the bottom padding of the affected
screens, matching the pattern the BottomNavBar screens already use.

Scrollable content (last item was hidden at max scroll):
  settings, notification settings, notifications, log report, trade detail,
  about.

Interactive elements pinned at the bottom:
  dispute chat (message input), walkthrough (Skip/Back/Next/Done controls),
  add / pay lightning invoice (Cancel/Submit), connect wallet, wallet settings,
  account (Import/Refresh row).

Verified on Linux desktop with a simulated 48px bottom system bar (injected
MediaQuery padding): on every affected screen the last item / bottom control
now clears the bar instead of being overlapped. flutter analyze clean.
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Fourteen Flutter screens and a bottom-sheet selector now add bottom system-bar padding. The changes cover lists, forms, bottom controls, chat input, node selection, and walkthrough controls.

Changes

Bottom Safe-Area Padding

Layer / File(s) Summary
Scrollable content insets
lib/features/about/screens/about_screen.dart, lib/features/account/screens/account_screen.dart, lib/features/notifications/screens/notifications_screen.dart, lib/features/settings/screens/*, lib/features/trades/screens/trade_detail_screen.dart
Scrollable content uses explicit edge padding and adds MediaQuery bottom view padding.
Bottom control insets
lib/features/disputes/screens/dispute_chat_screen.dart, lib/features/order/screens/*invoice_screen.dart, lib/features/settings/screens/connect_wallet_screen.dart, lib/features/settings/screens/wallet_settings_screen.dart, lib/features/settings/widgets/mostro_node_selector.dart, test/features/settings/widgets/mostro_node_selector_test.dart
Bottom controls add safe-area padding. The node selector uses the larger keyboard or system-bar inset. Widget tests cover hidden and visible keyboard insets.
Walkthrough control insets
lib/features/walkthrough/screens/walkthrough_screen.dart
Walkthrough controls include bottom view padding.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: ermeme

Poem

I’m a rabbit guarding the bottom space,
Safe-area padding keeps content in place.
Lists and buttons clear the bar,
Keyboard and insets guide them far.
Hop, hop—clean layouts set the pace!

🚥 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 clearly describes the primary change: adding bottom system-bar insets to prevent content overlap.
Linked Issues check ✅ Passed The changes cover all affected screens listed in issue [#267] and add tested bottom inset handling for the node selector.
Out of Scope Changes check ✅ Passed All changes support bottom system-bar or keyboard inset handling and related widget coverage described for issue [#267].
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/features/walkthrough/screens/walkthrough_screen.dart`:
- Around line 77-84: Update the controlsPadding value in the walkthrough screen
to preserve the package’s 16.0-point top, left, and right spacing, use 16.0 as
the base bottom padding, and add MediaQuery.of(context).viewPadding.bottom only
to the bottom value.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f8563ce0-f2d1-4786-bd5e-a5ad5be8442d

📥 Commits

Reviewing files that changed from the base of the PR and between 0d1f466 and c44cfe8.

📒 Files selected for processing (13)
  • lib/features/about/screens/about_screen.dart
  • lib/features/account/screens/account_screen.dart
  • lib/features/disputes/screens/dispute_chat_screen.dart
  • lib/features/notifications/screens/notifications_screen.dart
  • lib/features/order/screens/add_lightning_invoice_screen.dart
  • lib/features/order/screens/pay_lightning_invoice_screen.dart
  • lib/features/settings/screens/connect_wallet_screen.dart
  • lib/features/settings/screens/log_report_screen.dart
  • lib/features/settings/screens/notification_settings_screen.dart
  • lib/features/settings/screens/settings_screen.dart
  • lib/features/settings/screens/wallet_settings_screen.dart
  • lib/features/trades/screens/trade_detail_screen.dart
  • lib/features/walkthrough/screens/walkthrough_screen.dart

Comment thread lib/features/walkthrough/screens/walkthrough_screen.dart
…ng, inset only bottom

CodeRabbit: the package defaults controlsPadding to EdgeInsets.all(16.0); the
initial override dropped top/base-bottom to 4.0. Restore 16.0 on all sides and
add viewPadding.bottom to the bottom value only.
@codaMW

codaMW commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

Good catch,you're right. introduction_screen 3.1.14 defaults controlsPadding to EdgeInsets.all(16.0), and my override unintentionally dropped the top/base-bottom to 4.0. Fixed: restored 16.0 on all sides and add viewPadding.bottom to the bottom value only, so the control spacing matches the package default and just clears the system bar.

ermeme[bot]
ermeme Bot previously approved these changes Aug 9, 2026

@ermeme ermeme Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed the current head (d522167f). The per-screen bottom inset additions are scoped to the affected screens from #267, the prior walkthrough controlsPadding regression is fixed by preserving the package's 16px defaults, and the current CI checks are green. I don't see any blocking issues.

@Catrya Catrya left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In the Settings screen, in the “Mostro node” section, there’s still some overlapping. This is the only place where I found an issue with it, everything else looks very good. Please fix this so it’s ready to merge.

Image Image

The selector sheet padded only for viewInsets (the keyboard), so with no
keyboard its content ran under the system navigation bar. Add viewPadding.bottom
(the system bar) alongside the keyboard inset so the sheet clears both.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/features/settings/widgets/mostro_node_selector.dart`:
- Around line 124-126: Update the bottom inset calculation in the affected
widget to use the maximum of viewInsets.bottom and viewPadding.bottom, then add
AppSpacing.lg, instead of summing both values. Add tests covering both
keyboard-hidden and keyboard-visible states.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5f2a41d6-94ac-4c30-8c25-d828bbd47e5a

📥 Commits

Reviewing files that changed from the base of the PR and between c44cfe8 and 01a6244.

📒 Files selected for processing (2)
  • lib/features/settings/widgets/mostro_node_selector.dart
  • lib/features/walkthrough/screens/walkthrough_screen.dart
🚧 Files skipped from review as they are similar to previous changes (1)
  • lib/features/walkthrough/screens/walkthrough_screen.dart

Comment thread lib/features/settings/widgets/mostro_node_selector.dart Outdated
…stro-node sheet

The sheet's bottom inset summed viewInsets (keyboard) and viewPadding (system
bar), over-padding when the keyboard is up since both describe the same bottom
edge. Use max() of the two plus the base gap so the content clears whichever
obstruction is larger. Verified on a physical device (Nokia C31). Adds widget
tests for the keyboard-hidden and keyboard-visible states.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/features/settings/widgets/mostro_node_selector_test.dart`:
- Around line 56-65: Strengthen the hidden- and visible-keyboard tests around
_pump and MostroNodeSelector by measuring the bottom control or sheet geometry,
not just button presence. Assert a 34 px bottom inset when keyboardInset is 0
and 300 px when it is 300, verifying the selector uses max(viewInsets.bottom,
viewPadding.bottom).
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 322d9e37-e7d5-4d2f-9df3-be7c5f876715

📥 Commits

Reviewing files that changed from the base of the PR and between 01a6244 and e16a84e.

📒 Files selected for processing (2)
  • lib/features/settings/widgets/mostro_node_selector.dart
  • test/features/settings/widgets/mostro_node_selector_test.dart
🚧 Files skipped from review as they are similar to previous changes (1)
  • lib/features/settings/widgets/mostro_node_selector.dart

Comment thread test/features/settings/widgets/mostro_node_selector_test.dart
@codaMW
codaMW requested a review from Catrya August 10, 2026 21:40
@codaMW

codaMW commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator Author

@Catrya
Fixed and verified on device, the Mostro-node selector's bottom inset now uses max() of the keyboard and system-bar insets so content clears the nav bar (was summing them). Tested on a Nokia C31; the sheet clears the system bar cleanly. Added widget tests for both keyboard states. Ready for another look.

1000253380

@Catrya Catrya left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

tACK

@Catrya
Catrya merged commit fc6dc71 into MostroP2P:main Aug 10, 2026
4 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.

UI: bottom system bar overlaps content on most screens (missing SafeArea)

2 participants