Skip to content

feat(dive-centers): remember what worked with an operator's rental gear - #2087

Merged
ericgriffin merged 17 commits into
mainfrom
ericgriffin/rental-gear-memory-2db80e
Sep 18, 2026
Merged

ericgriffin merged 17 commits into
mainfrom
ericgriffin/rental-gear-memory-2db80e

Conversation

@ericgriffin

@ericgriffin ericgriffin commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Closes #2075

Remember what worked with a dive center's rental gear, and surface it on a return visit.

  • A new synced child table of dive centers, dive_center_gear_notes (schema v221), holds typed notes: gear type, the operator's label, size, a worked/avoid verdict, an optional lead adjustment, an optional true tank capacity, free text, and the dive it was noticed on.
  • In the dive edit form, picking a dive center shows "Last time at {center}": the lead, weighting feedback and tanks of the most recent other dive there, plus the notes. "Apply last dive" copies those weights and tanks (fresh ids, default pressures) into the form, asking first when the form already has any. "Add rental note" opens the shared sheet.
  • The dive center detail page gains a "Rental gear" section grouped by gear type, with add and tap-to-edit.
  • Notes sync as a parent-gated child of dive centers; deleting a center tombstones its notes so peers do not resurrect them. Deleting a dive detaches its notes rather than removing them.
  • All values respect the diver's weight and volume units. Strings in all 11 locales.

Schema rung 221 sits directly above v220, which #1980 shipped while this was in review. #2040, #1978 and #1860 still claim 220 and will need to renumber above 221 if this merges first.

Full suite: one unrelated failure, service_clock_baseline_test ("deleting the service that took over hands the clock back to the baseline"), which fails when its file runs and passes alone; this branch touches no equipment or service code and main was green on the same base. It is a same-millisecond race between the record's creation stamp and the baseline's set time, filed as #2088.

Design: docs/superpowers/specs/2026-09-18-rental-gear-memory-design.md. Plan: docs/superpowers/plans/2026-09-18-rental-gear-memory.md.

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

📦 Build artifacts for this PR · commit 000e698

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.

@codecov

codecov Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

@ericgriffin
ericgriffin requested a lite review from Copilot September 18, 2026 17:02
@ericgriffin ericgriffin self-assigned this Sep 18, 2026
@ericgriffin ericgriffin added the enhancement New feature or request label Sep 18, 2026
@ericgriffin ericgriffin moved this from Backlog to In review in Submersion Release Tracker Sep 18, 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.

🔵 Needs a closer look

One or more issues must be addressed before approval.

Pull request overview

Adds rental-gear memory for dive centers, including synced notes, last-dive recall, unit-aware editing, and localization.

Changes:

  • Adds schema v221 storage and parent-gated sync support.
  • Adds rental note CRUD, shared editing sheet, and detail-page section.
  • Surfaces previous dive weights/tanks with optional application to the current dive.
File summaries
File Description
test/l10n/rental_gear_memory_strings_test.dart Updated as part of this pull request.
test/features/dive_log/presentation/widgets/edit_sections/trip_section_test.dart Updated as part of this pull request.
test/features/dive_log/presentation/pages/dive_edit_rental_memory_test.dart Updated as part of this pull request.
test/features/dive_centers/presentation/widgets/rental_memory_card_test.dart Updated as part of this pull request.
test/features/dive_centers/presentation/widgets/rental_gear_section_test.dart Updated as part of this pull request.
test/features/dive_centers/presentation/widgets/rental_gear_note_sheet_test.dart Updated as part of this pull request.
test/features/dive_centers/domain/services/rental_memory_resolver_test.dart Updated as part of this pull request.
test/features/dive_centers/domain/entities/dive_center_gear_note_test.dart Updated as part of this pull request.
test/features/dive_centers/data/repositories/dive_center_repository_latest_dive_test.dart Updated as part of this pull request.
test/features/dive_centers/data/repositories/dive_center_gear_note_repository_test.dart Updated as part of this pull request.
test/core/services/sync/sync_parent_refs_completeness_test.dart Updated as part of this pull request.
test/core/services/sync/dive_center_gear_notes_sync_test.dart Updated as part of this pull request.
test/core/database/migration_v221_dive_center_gear_notes_test.dart Updated as part of this pull request.
test/core/database/migration_v219_equipment_tags_test.dart Updated as part of this pull request.
lib/l10n/arb/app_zh.arb Updated as part of this pull request.
lib/l10n/arb/app_pt.arb Updated as part of this pull request.
lib/l10n/arb/app_nl.arb Updated as part of this pull request.
lib/l10n/arb/app_localizations.dart Updated as part of this pull request.
lib/l10n/arb/app_localizations_zh.dart Updated as part of this pull request.
lib/l10n/arb/app_localizations_pt.dart Updated as part of this pull request.
lib/l10n/arb/app_localizations_nl.dart Updated as part of this pull request.
lib/l10n/arb/app_localizations_it.dart Updated as part of this pull request.
lib/l10n/arb/app_localizations_hu.dart Updated as part of this pull request.
lib/l10n/arb/app_localizations_he.dart Updated as part of this pull request.
lib/l10n/arb/app_localizations_fr.dart Updated as part of this pull request.
lib/l10n/arb/app_localizations_es.dart Updated as part of this pull request.
lib/l10n/arb/app_localizations_en.dart Updated as part of this pull request.
lib/l10n/arb/app_localizations_de.dart Updated as part of this pull request.
lib/l10n/arb/app_localizations_ar.dart Updated as part of this pull request.
lib/l10n/arb/app_it.arb Updated as part of this pull request.
lib/l10n/arb/app_hu.arb Updated as part of this pull request.
lib/l10n/arb/app_he.arb Updated as part of this pull request.
lib/l10n/arb/app_fr.arb Updated as part of this pull request.
lib/l10n/arb/app_es.arb Updated as part of this pull request.
lib/l10n/arb/app_en.arb Updated as part of this pull request.
lib/l10n/arb/app_de.arb Updated as part of this pull request.
lib/l10n/arb/app_ar.arb Updated as part of this pull request.
lib/features/dive_log/presentation/widgets/edit_sections/trip_section.dart Updated as part of this pull request.
lib/features/dive_log/presentation/pages/dive_edit_page.dart Updated as part of this pull request.
lib/features/dive_centers/presentation/widgets/rental_memory_card.dart Updated as part of this pull request.
lib/features/dive_centers/presentation/widgets/rental_gear_section.dart Updated as part of this pull request.
lib/features/dive_centers/presentation/widgets/rental_gear_note_sheet.dart Updated as part of this pull request.
lib/features/dive_centers/presentation/providers/dive_center_gear_note_providers.dart Updated as part of this pull request.
lib/features/dive_centers/presentation/pages/dive_center_detail_page.dart Updated as part of this pull request.
lib/features/dive_centers/domain/services/rental_memory_resolver.dart Updated as part of this pull request.
lib/features/dive_centers/domain/entities/dive_center_gear_note.dart Updated as part of this pull request.
lib/features/dive_centers/data/repositories/dive_center_repository.dart Updated as part of this pull request.
lib/features/dive_centers/data/repositories/dive_center_gear_note_repository.dart Updated as part of this pull request.
lib/core/services/sync/sync_service.dart Updated as part of this pull request.
lib/core/services/sync/sync_data_serializer.dart Updated as part of this pull request.
lib/core/database/database.dart Updated as part of this pull request.
lib/core/data/repositories/sync_repository.dart Updated as part of this pull request.
docs/superpowers/specs/2026-09-18-rental-gear-memory-design.md Updated as part of this pull request.
Review details

Suppressed comments (1)

lib/features/dive_log/presentation/pages/dive_edit_page.dart:4538

  • This condition does not treat a zero-valued weight row as existing form data, so applying the last dive can silently replace an already-present weight row without showing the required confirmation. The requirement is to confirm when any weights or tanks are present; check the collection itself rather than only positive amounts.
    if (_weights.any((w) => w.amountKg > 0) || _tanks.isNotEmpty) {
  • Files reviewed: 53/54 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

…ar-memory-2db80e

# Conflicts:
#	lib/core/database/database.dart
#	test/core/database/migration_v219_equipment_tags_test.dart
@ericgriffin
ericgriffin merged commit 936e94a into main Sep 18, 2026
36 checks passed
@ericgriffin
ericgriffin deleted the ericgriffin/rental-gear-memory-2db80e branch September 18, 2026 21:48
@github-project-automation github-project-automation Bot moved this from In review to Done in Submersion Release Tracker Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Rental Gear Memory: remember what worked with an operator's rental gear

2 participants