Skip to content

fix(dive-log): persist picked buddy role in bulk edit#701

Open
mgoodness wants to merge 1 commit into
submersion-app:mainfrom
mgoodness:fix-bulk-buddy-role
Open

fix(dive-log): persist picked buddy role in bulk edit#701
mgoodness wants to merge 1 commit into
submersion-app:mainfrom
mgoodness:fix-bulk-buddy-role

Conversation

@mgoodness

@mgoodness mgoodness commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Bulk-editing multiple dives and adding a buddy let you pick a role (Divemaster, Instructor, etc.) via the picker, but the pick was discarded — every newly-added buddy was always saved with the default "Buddy" role.

Fixes #699
Related to #700

Changes

  • _addBuddyMembers now records the picked role in a new _buddyRoleById map (alongside the existing _buddyById), instead of only capturing id/label/icon.
  • _buddyWithRole looks up the picked role from that map when building the save payload, falling back to the default Buddy role only when unknown.
  • New regression test drives the actual bulk-edit UI end-to-end (pick a buddy, choose Instructor in the role sheet, confirm, Save, Apply) and verifies the persisted role via BuddyRepository.getBuddiesForDive.

Known limitation, filed separately: this fix covers adding a new buddy to the selection. Re-picking a buddy who's already on some/all of the selected dives with a different role still doesn't update it — see #700 for that follow-up.

Test Plan

  • flutter test passes (full suite: dive_edit_page_test.dart, bulk_dive_edit_page_test.dart, bulk_dive_edit_service_test.dart, bulk_dive_edit_provider_test.dart, buddies/ tree — 240 tests)
  • flutter analyze passes
  • Manual testing on: macOS

Bulk-adding buddies to multiple dives let you pick a role in the
picker, but the pick was thrown away when stored into the generic
membership-editor state, then hardcoded back to the default "buddy"
role at save time. Thread the picked DiveRole through instead.

Fixes submersion-app#699
@github-actions

Copy link
Copy Markdown
Contributor

📦 Build artifacts for this PR · commit f5e3c0f

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. The macOS build is ad-hoc signed — right-click → Open on first launch.

Updated automatically on each push.

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Bulk-edit: selected buddy role (Divemaster, Instructor, etc.) isn't saved

1 participant