Dive planner redesign phase 6: log integration#490
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
linkedDiveIdon 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. |
3 tasks
…ee-dive-planner-phase6-log
… 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)
Base automatically changed from
worktree-dive-planner-phase5-contingencies
to
main
July 6, 2026 02:40
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 6 of the dive planner redesign (stacked on #489): the planner now talks to the dive log in both directions.
profileAnalysisProvidermath the dive details page runs) and sets the surface interval.seededTissueStateoff-gasses the compartments at the surface before handing the engine itsstartState, so a repetitive plan shows more deco than a fresh one and converges back as the interval grows.getSacVolumeByTankRole).isPlanned: true, full computed profile including the deco ascent), links it back onto the plan (linkedDiveId), saves the plan, and offers a View action.getPlanByLinkedDiveIdlookup andChartSourceOverlay.sourceDiveId/linkedDiveId) are now state-owned in the state↔aggregate mapper, and the long-standingloadTissueFromDivestub is gone.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.dartflutter analyzeanddart format .clean