Skip to content

fix: export DialogShell, fix button layout, add footerBuilder, fix body spacing#8

Merged
anilcancakir merged 3 commits into
mainfrom
fix/dialog-shell-issues-7
Mar 29, 2026
Merged

fix: export DialogShell, fix button layout, add footerBuilder, fix body spacing#8
anilcancakir merged 3 commits into
mainfrom
fix/dialog-shell-issues-7

Conversation

@anilcancakir

Copy link
Copy Markdown
Contributor

Summary

Closes #7 — fixes 4 dialog system issues discovered during kodizm-app migration to alpha.4:

  • Export MagicStarterDialogShell — now public from barrel, enabling apps to compose custom dialogs (pickers, forms) with consistent theme styling
  • footerfooterBuilderWidget Function(BuildContext dialogContext)? provides the dialog's own context so external callers can safely Navigator.pop(dialogContext) without popping the underlying route
  • Compact right-aligned buttonsMagicStarterConfirmDialog and MagicStarterPasswordConfirmDialog buttons changed from full-width (flex-1) to compact right-aligned (justify-end gap-2 wrap), matching TwoFactorModal's existing pattern
  • Body shrink-to-content — replaced Flexible + SingleChildScrollView with Flexible + ListView(shrinkWrap: true) so body doesn't create a gap between content and footer when content is short

Test plan

  • 561/561 tests pass (flutter test --coverage)
  • dart analyze --no-fatal-infos — 0 errors, 0 warnings
  • DialogShell: 9 tests (2 new — footerBuilder context, body shrink)
  • ConfirmDialog: 12 tests (1 new — compact button layout)
  • PasswordConfirmDialog: 9 tests (3 new — compact button layout)
  • All 3 dialog widgets use consistent justify-end gap-2 wrap button pattern

…dy spacing (#7)

- Export MagicStarterDialogShell publicly from barrel
- Replace footer: Widget? with footerBuilder: Widget Function(BuildContext)
  so external callers can Navigator.pop with the dialog's own context
- Fix ConfirmDialog and PasswordConfirmDialog buttons from full-width
  (flex-1) to compact right-aligned (justify-end gap-2 wrap)
- Fix DialogShell body gap by replacing SingleChildScrollView with
  ListView(shrinkWrap: true) for shrink-to-content behavior
Copilot AI review requested due to automatic review settings March 29, 2026 14:25
The export line for hide_bottom_nav.dart was in the working tree
before this PR and got included accidentally — the file does not
exist in the repository yet.

Copilot AI 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.

Pull request overview

This PR updates the Magic Starter dialog system to make MagicStarterDialogShell a public, reusable building block, while fixing footer context safety, button layout consistency, and short-body spacing behavior.

Changes:

  • Export MagicStarterDialogShell from the public barrel and document the new dialog-shell contract.
  • Replace footer with footerBuilder(BuildContext dialogContext) so footer actions can safely pop the dialog.
  • Update confirm/password-confirm dialog footers to use compact, right-aligned button layout and adjust DialogShell body scrolling to avoid short-content gaps.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
lib/src/ui/widgets/magic_starter_dialog_shell.dart Makes the shell reusable + switches body scrolling to ListView(shrinkWrap: true) + adds footerBuilder.
lib/src/ui/widgets/magic_starter_confirm_dialog.dart Uses footerBuilder and updates footer layout to compact right-aligned buttons.
lib/src/ui/widgets/magic_starter_password_confirm_dialog.dart Updates footer layout to compact right-aligned buttons.
lib/magic_starter.dart Exports MagicStarterDialogShell (and adds an export that currently appears invalid).
test/ui/widgets/magic_starter_dialog_shell_test.dart Updates tests for footerBuilder and adds coverage for builder context/body scrolling change.
test/ui/widgets/magic_starter_confirm_dialog_test.dart Adds a test for the new compact/right-aligned footer behavior.
test/ui/widgets/magic_starter_password_confirm_dialog_test.dart Adds tests for compact/right-aligned footer behavior.
.claude/rules/widgets.md Updates widget rules to reflect the new DialogShell API and footer layout convention.
CLAUDE.md Updates documented widget exports and DialogShell behavior.
CHANGELOG.md Records the API change (footerBuilder) and the layout fixes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/magic_starter.dart
Comment thread test/ui/widgets/magic_starter_password_confirm_dialog_test.dart Outdated
Comment thread test/ui/widgets/magic_starter_dialog_shell_test.dart
Comment thread test/ui/widgets/magic_starter_confirm_dialog_test.dart Outdated
- Scope flex-1/w-full assertions to footer container (not entire subtree)
- Add geometry assertion for body-footer gap regression test
- Add flex-1 and w-full absence checks in confirm dialog test
- Bump version to 0.0.1-alpha.5 for release
@anilcancakir anilcancakir merged commit 5f7827a into main Mar 29, 2026
1 check passed
@anilcancakir anilcancakir deleted the fix/dialog-shell-issues-7 branch March 29, 2026 14:34
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.

feat: export DialogShell, fix confirm dialog button layout, add footer context

2 participants