Skip to content

fix(buddies): show Add New Buddy screen in front of the bulk-edit dialog - #708

Merged
ericgriffin merged 4 commits into
submersion-app:mainfrom
mgoodness:bug-add-buddy-dialog
Aug 5, 2026
Merged

fix(buddies): show Add New Buddy screen in front of the bulk-edit dialog#708
ericgriffin merged 4 commits into
submersion-app:mainfrom
mgoodness:bug-add-buddy-dialog

Conversation

@mgoodness

@mgoodness mgoodness commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

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

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation

Changes Made

  • Gave the newBuddy GoRoute a parentNavigatorKey pointing at the root navigator so it always escapes to wherever the dialog/sheet actually are
  • Added a config-level regression test asserting newBuddy's parentNavigatorKey
  • Added a render-level test pumping the real BuddyPicker + BuddyEditPage through 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 regression

Testing

  • Unit tests added/updated
  • Widget tests added/updated
  • Manual testing performed

Checklist

  • Code follows style guidelines
  • Tests pass locally
  • Documentation updated (N/A -- internal navigation fix, no user-facing docs affected)
  • No new warnings from flutter analyze

Screenshots

N/A

Related Issues

Fixes #707

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

📦 Build artifacts for this PR · commit e883f83

Platform Download
Android (APK) android-apk
macOS macos-build
Windows windows-build
Linux linux-build

Artifacts expire in 7 days. Downloading requires being signed in to GitHub. macOS needs two extractions: unzip the downloaded artifact, then unzip the submersion-macos.zip inside it to get a runnable submersion.app. The build is ad-hoc signed — right-click → Open on first launch.

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>
@mgoodness
mgoodness force-pushed the bug-add-buddy-dialog branch from aa7a921 to a897860 Compare July 27, 2026 15:09
@ericgriffin
ericgriffin requested a lite review from Copilot August 4, 2026 18:06
@ericgriffin ericgriffin moved this from Backlog to In review in Submersion Release Tracker Aug 4, 2026
@ericgriffin ericgriffin added the bug Something isn't working label Aug 4, 2026

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

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 newBuddy route to use parentNavigatorKey: rootNavigatorKey so 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();

mgoodness and others added 3 commits August 4, 2026 13:52
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.
@ericgriffin
ericgriffin merged commit 6d6263b into submersion-app:main Aug 5, 2026
25 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in Submersion Release Tracker Aug 5, 2026
@mgoodness
mgoodness deleted the bug-add-buddy-dialog branch August 5, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Bulk edit: "Add New Buddy" opens behind the buddy picker dialog

3 participants