Skip to content

Dive planner redesign phase 6: log integration#490

Merged
ericgriffin merged 10 commits into
mainfrom
worktree-dive-planner-phase6-log
Jul 6, 2026
Merged

Dive planner redesign phase 6: log integration#490
ericgriffin merged 10 commits into
mainfrom
worktree-dive-planner-phase6-log

Conversation

@ericgriffin

@ericgriffin ericgriffin commented Jul 5, 2026

Copy link
Copy Markdown
Member

Summary

Phase 6 of the dive planner redesign (stacked on #489): the planner now talks to the dive log in both directions.

  • Follow a dive (tissue seeding): a new picker sheet lists recent logged dives; choosing one seeds the plan's start tissues from that dive's end-of-dive compartment state (the same profileAnalysisProvider math the dive details page runs) and sets the surface interval. seededTissueState off-gasses the compartments at the surface before handing the engine its startState, so a repetitive plan shows more deco than a fresh one and converges back as the interval grows.
  • Following chip: the status-chip row shows "Following {dive}" with tap-to-clear while a plan is seeded.
  • SAC auto-fill from the log: a one-tap button in plan settings fills the plan's SAC from the diver's logged back-gas average (getSacVolumeByTankRole).
  • Convert-to-dive persistence: the convert menu action now actually creates the dive (fresh id, isPlanned: true, full computed profile including the deco ascent), links it back onto the plan (linkedDiveId), saves the plan, and offers a View action.
  • Plan-vs-actual overlay: the dive detail profile chart ghosts the planned profile (recomputed through the same PlanEngine) next to the actual logged profile for dives created from a plan, via a new getPlanByLinkedDiveId lookup and ChartSourceOverlay.
  • Dive links (sourceDiveId/linkedDiveId) are now state-owned in the state↔aggregate mapper, and the long-standing loadTissueFromDive stub is gone.
  • New strings translated into all 10 non-English locales.

Test plan

  • flutter test test/features/planner/ (79 tests: seeding, mapper links, follow chip + SAC button, convert round-trip, overlay mapping)
  • flutter test test/features/dive_planner/ test/core/deco/ (367 tests)
  • flutter test .../dive_detail_page_test.dart .../dive_detail_multi_source_test.dart
  • Whole-project flutter analyze and dart format . clean

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

Implements Phase 6 of the dive planner redesign by integrating the planner with the dive log in both directions: seeding plan tissues from a prior logged dive, persisting “convert to dive” with back-linking, and rendering a plan-vs-actual profile overlay on dive details.

Changes:

  • Add “Follow a dive” flow (picker sheet + status chip) that seeds tissues and surface interval into live plan computation.
  • Make convert-to-dive persist a planned dive (full computed profile) and store linkedDiveId on the plan; add plan overlay lookup/rendering on dive detail.
  • Add logged-average SAC autofill and update i18n + tests for the new behaviors.

Reviewed changes

Copilot reviewed 42 out of 42 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/features/planner/plan_overlay_test.dart Tests plan-vs-actual overlay lookup and profile mapping.
test/features/planner/plan_engine_seeding_test.dart Tests tissue seeding impacts on deco/runtime.
test/features/planner/follow_dive_test.dart Widget tests for Following chip and logged SAC autofill UI.
test/features/planner/dive_plan_state_mapper_test.dart Verifies sourceDiveId/linkedDiveId state↔aggregate round-trip.
test/features/planner/convert_to_dive_test.dart Tests convert-to-dive creates a planned dive and links it back to the plan.
test/features/dive_planner/presentation/providers/dive_planner_providers_test.dart Tests notifier APIs for followed/linked dive state updates.
lib/l10n/arb/app_zh.arb Adds new planner/log-integration strings (zh).
lib/l10n/arb/app_pt.arb Adds new planner/log-integration strings (pt).
lib/l10n/arb/app_nl.arb Adds new planner/log-integration strings (nl).
lib/l10n/arb/app_it.arb Adds new planner/log-integration strings (it).
lib/l10n/arb/app_hu.arb Adds new planner/log-integration strings (hu).
lib/l10n/arb/app_he.arb Adds new planner/log-integration strings (he).
lib/l10n/arb/app_fr.arb Adds new planner/log-integration strings (fr).
lib/l10n/arb/app_es.arb Adds new planner/log-integration strings (es).
lib/l10n/arb/app_en.arb Adds new planner/log-integration strings + placeholders (en).
lib/l10n/arb/app_de.arb Adds new planner/log-integration strings (de).
lib/l10n/arb/app_ar.arb Adds new planner/log-integration strings (ar).
lib/l10n/arb/app_localizations.dart Generated localization getters for new keys.
lib/l10n/arb/app_localizations_zh.dart Generated zh localization implementation.
lib/l10n/arb/app_localizations_pt.dart Generated pt localization implementation.
lib/l10n/arb/app_localizations_nl.dart Generated nl localization implementation.
lib/l10n/arb/app_localizations_it.dart Generated it localization implementation.
lib/l10n/arb/app_localizations_hu.dart Generated hu localization implementation.
lib/l10n/arb/app_localizations_he.dart Generated he localization implementation.
lib/l10n/arb/app_localizations_fr.dart Generated fr localization implementation.
lib/l10n/arb/app_localizations_es.dart Generated es localization implementation.
lib/l10n/arb/app_localizations_en.dart Generated en localization implementation.
lib/l10n/arb/app_localizations_de.dart Generated de localization implementation.
lib/l10n/arb/app_localizations_ar.dart Generated ar localization implementation.
lib/features/planner/presentation/widgets/plan_status_chips.dart Adds “Following {dive}” chip with tap-to-clear behavior.
lib/features/planner/presentation/widgets/follow_dive_sheet.dart Adds follow-a-dive picker sheet that seeds tissues + surface interval.
lib/features/planner/presentation/providers/plan_overlay_provider.dart Adds provider + pure mapper to build planned overlay series.
lib/features/planner/presentation/providers/plan_canvas_providers.dart Feeds seeded tissue start state into PlanEngine; adds logged-average SAC provider.
lib/features/planner/presentation/pages/plan_canvas_page.dart Adds Follow menu item and implements convert-to-dive persistence + navigation.
lib/features/planner/domain/services/tissue_seed.dart Adds helper to off-gas end-of-dive compartments over surface interval into TissueState.
lib/features/planner/domain/services/dive_plan_state_mapper.dart Makes dive links state-owned and maps them in/out of the aggregate.
lib/features/planner/data/repositories/dive_plan_repository.dart Adds getPlanByLinkedDiveId repository lookup for overlay rendering.
lib/features/dive_planner/presentation/widgets/plan_settings_panel.dart Adds logged-average SAC autofill button.
lib/features/dive_planner/presentation/providers/dive_planner_providers.dart Adds notifier APIs for followed dive + linked dive; updates toDive() to generate fresh ids.
lib/features/dive_planner/domain/entities/plan_result.dart Extends DivePlanState with sourceDiveId and linkedDiveId.
lib/features/dive_log/presentation/pages/dive_detail_page.dart Appends the planned overlay to chart overlays when applicable.
docs/superpowers/plans/2026-07-05-dive-planner-phase6-log.md Captures the implementation plan for Phase 6 log integration.

… comment

- Altitude <= 0 is treated as unset (legacy 1.0 bar surface) in both the
  engine and the seeded-tissue environment, so a literal 0 no longer switches
  to barometric sea-level pressure and shifts the deco math
- Cover the follow-a-dive sheet (list, follow-on-tap, empty state)
@ericgriffin ericgriffin self-assigned this Jul 6, 2026
@ericgriffin ericgriffin moved this from Backlog to In review in Submersion Release Tracker Jul 6, 2026
Base automatically changed from worktree-dive-planner-phase5-contingencies to main July 6, 2026 02:40
@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

@ericgriffin ericgriffin merged commit d016ab8 into main Jul 6, 2026
19 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in Submersion Release Tracker Jul 6, 2026
@ericgriffin ericgriffin deleted the worktree-dive-planner-phase6-log branch July 6, 2026 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants