fix(buddies): show Add New Buddy screen in front of the bulk-edit dialog - #708
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
📦 Build artifacts for this PR · commit
Artifacts expire in 7 days. Downloading requires being signed in to GitHub. macOS needs two extractions: unzip the downloaded artifact, then unzip the Updated automatically on each push. |
Bulk-editing dives opens the buddy picker inside a showDialog (root navigator by default); the buddy-selection bottom sheet resolves to that same root navigator. The newBuddy route, however, is nested under the app's ShellRoute with no parentNavigatorKey override, so it mounted on the shell's own nested navigator instead -- rendering underneath the still-open dialog/sheet on the root navigator. Users had to back out of both to find the new-buddy screen was open the whole time. Give newBuddy a parentNavigatorKey pointing at the root navigator so it always escapes to wherever the dialog/sheet actually are. Fixes submersion-app#707 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
aa7a921 to
a897860
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes a navigation layering bug in the buddies flow: when “Add New Buddy” is triggered from inside the bulk-edit buddies dialog/bottom sheet, the new-buddy screen is now pushed onto the root navigator so it renders in the foreground (instead of behind the still-open dialog/sheet).
Changes:
- Configure the
newBuddyroute to useparentNavigatorKey: rootNavigatorKeyso it escapes the ShellRoute’s nested navigator. - Add a router configuration regression test asserting
newBuddy.parentNavigatorKey == rootNavigatorKey. - Add a render-level widget test that reproduces the bulk-edit dialog + bottom-sheet flow and verifies the new-buddy page displays on top and returns back correctly.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lib/core/router/app_router.dart | Sets newBuddy to use the root navigator so it renders above dialog/sheet routes opened on root. |
| test/core/router/app_router_test.dart | Adds a regression test asserting newBuddy is configured to escape to the root navigator. |
| test/features/buddies/presentation/widgets/buddy_picker_navigation_render_test.dart | Adds an end-to-end widget test reproducing the dialog + bottom-sheet navigation layering bug and validating the fix. |
Suppressed comments (1)
test/features/buddies/presentation/widgets/buddy_picker_navigation_render_test.dart:235
- Same as above: BuddyEditPage does not render a "Save" label in this flow (it uses buddies_action_add/update), so this finder is incorrect and can fail under localization. Tap the primary FilledButton instead.
await tester.enterText(find.byType(TextFormField).first, 'Another One');
await tester.tap(find.text('Save'));
await tester.pumpAndSettle();
find.text('Save') never matched -- BuddyEditPage's primary button uses
the localized buddies_action_add/update string ("Add Buddy"), so the
save-and-pop assertions were silently unverifiable. Tap the FilledButton
directly instead, and widen the test surface since the form is taller
than the default viewport and the button sat below the fold.
Description
Bulk-editing dives opens the buddy picker inside a
showDialog(root navigator by default); the buddy-selection bottom sheet resolves to that same root navigator. ThenewBuddyroute, however, is nested under the app'sShellRoutewith noparentNavigatorKeyoverride, so it mounted on the shell's own nested navigator instead -- rendering underneath the still-open dialog/sheet on the root navigator. Users had to back out of both to find the new-buddy screen was open the whole time.Type of Change
Changes Made
newBuddyGoRoute aparentNavigatorKeypointing at the root navigator so it always escapes to wherever the dialog/sheet actually arenewBuddy'sparentNavigatorKeyBuddyPicker+BuddyEditPagethrough the bulk-edit dialog flow, confirming the new screen renders on top and the dialog/sheet correctly reappear (with state intact) once saved and popped; also covers the single-dive-edit (no-dialog) flow to confirm no regressionTesting
Checklist
flutter analyzeScreenshots
N/A
Related Issues
Fixes #707