Skip to content

fix: dialog mobile overflow — safe area-aware maxHeight (#13)#14

Merged
anilcancakir merged 2 commits intomainfrom
fix/dialog-shell-mobile-overflow
Mar 30, 2026
Merged

fix: dialog mobile overflow — safe area-aware maxHeight (#13)#14
anilcancakir merged 2 commits intomainfrom
fix/dialog-shell-mobile-overflow

Conversation

@anilcancakir
Copy link
Copy Markdown
Contributor

Summary

  • All three dialog widgets (MagicStarterDialogShell, MagicStarterPasswordConfirmDialog, MagicStarterTwoFactorModal) now compute maxHeight from safe area via MediaQuery.viewPaddingOf() instead of raw screen height or hardcoded values (600/800)
  • Added vertical insetPadding: 24 to prevent dialogs from extending to screen edges on mobile
  • 7 new tests covering safe area calculation and vertical inset padding across all 3 widgets

Test plan

  • flutter test — 578/578 pass
  • flutter analyze --no-fatal-infos — no issues
  • dart format --set-exit-if-changed . — 0 changes

Closes #13

All three dialog widgets now compute maxHeight from safe area
(MediaQuery.viewPaddingOf) instead of raw screen height, and add
vertical insetPadding (24px) to prevent edge-to-edge on mobile.
Copilot AI review requested due to automatic review settings March 30, 2026 23:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes mobile dialog overflow by making dialog height constraints safe-area aware and adding vertical padding so dialogs don’t render edge-to-edge on small screens.

Changes:

  • Compute dialog maxHeight from safe-area-adjusted screen height (MediaQuery.viewPaddingOf) across MagicStarterDialogShell, MagicStarterPasswordConfirmDialog, and MagicStarterTwoFactorModal.
  • Add vertical insetPadding to dialogs to prevent edge-to-edge rendering on mobile.
  • Add widget tests covering safe-area maxHeight calculation and insetPadding across all affected dialogs.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
lib/src/ui/widgets/magic_starter_dialog_shell.dart Uses safe-area-derived safeHeight for maxHeight and adds vertical insetPadding.
lib/src/ui/widgets/magic_starter_password_confirm_dialog.dart Replaces hardcoded maxHeight with safe-area-derived value; adds vertical insetPadding.
lib/src/ui/widgets/magic_starter_two_factor_modal.dart Replaces hardcoded maxHeight with safe-area-derived value; adds vertical insetPadding.
test/ui/widgets/magic_starter_dialog_shell_test.dart Adds tests for vertical insetPadding and safe-area-aware maxHeight calculations.
test/ui/widgets/magic_starter_password_confirm_dialog_test.dart Adds tests for vertical insetPadding and safe-area-aware maxHeight calculations.
test/ui/widgets/magic_starter_two_factor_modal_test.dart Adds tests for vertical insetPadding and safe-area-aware maxHeight calculations.
CHANGELOG.md Documents the mobile overflow fix under [Unreleased].
.claude/rules/widgets.md Documents the new dialog safe-area sizing rule.

@anilcancakir anilcancakir merged commit 0aaef87 into main Mar 30, 2026
1 check 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.

MagicStarterDialogShell overflows on mobile when body content is tall

2 participants