Skip to content

Dive planner redesign phase 7: outputs + hub#491

Merged
ericgriffin merged 11 commits into
mainfrom
worktree-dive-planner-phase7-outputs
Jul 6, 2026
Merged

Dive planner redesign phase 7: outputs + hub#491
ericgriffin merged 11 commits into
mainfrom
worktree-dive-planner-phase7-outputs

Conversation

@ericgriffin

@ericgriffin ericgriffin commented Jul 5, 2026

Copy link
Copy Markdown
Member

Summary

Phase 7 — the final phase of the dive planner redesign (stacked on #490): plan outputs and the planning hub. Everything is a pure consumer of the PlanEngine; no deco-math changes.

  • Range tables: RangeTableService re-runs the engine over a depth (±3/6 m) × time (±5/10 min) matrix using the same deviatePlan semantics as the contingency trio (now a shared helper). Rendered as a grid in the results sheet (TTS per cell, red when not diveable) and included in the slate PDF. Variants that would zero out the bottom are skipped, not silently computed.
  • Slate PDF: PlanSlatePdfService renders a high-contrast printable slate — header (name/mode/GF/max/RT/CNS), runtime table, gas plan (per-tank liters, turn pressure, min gas), CCR bailout summary, deviation + lost-gas tables, range grid — shared from the canvas menu via the existing sharePdfBytes/PdfFonts infrastructure.
  • .subplan share file: versioned JSON codec (plan_file_codec.dart, format submersion-plan v1) carrying every engine-relevant input; import regenerates all ids (tank references remapped through export keys) so it can never collide, and rejects foreign/newer files with a clear message. Share from the canvas menu or per saved plan; Import from the saved-plans sheet via file picker.
  • Multi-plan compare: select 2–3 saved plans (checkbox mode in the saved-plans sheet) → /planning/dive-planner/compare?ids= page with overlaid computed profiles and a diff table (max depth, runtime, TTS, deco, CNS, total gas).
  • Hub redesign: /planning now leads with the planner — a New Plan CTA plus the three most recent saved plans — with the calculators grouped under a Tools section.
  • Deco calculator environment: altitude + water-type inputs feed DiveEnvironment.forConditions into the shared BuhlmannAlgorithm seam, so the calculator agrees with the planner at altitude. Defaults preserve the legacy standard environment exactly.
  • New strings translated into all 10 non-English locales.

Test plan

  • flutter test test/features/planner/ test/features/planning/ (92 tests: range service/section, slate PDF OC+CCR, codec round-trip incl. engine-schedule equality, compare page, hub, altitude-shortens-NDL)
  • flutter test test/features/dive_planner/ (57 tests)
  • 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

Final phase of the dive planner redesign: adds planner outputs (range tables, slate PDF, .subplan share/import), multi-plan comparison, and updates the planning hub UI; additionally aligns the deco calculator with planner altitude/salinity via a shared environment input seam.

Changes:

  • Add range-table computation + UI rendering, and include it in results + the slate PDF.
  • Add .subplan plan export/import, plus a multi-plan compare page reachable from saved plans.
  • Redesign /planning hub to lead with the planner (New Plan CTA + recent plans), and extend the deco calculator with altitude + water type inputs.

Reviewed changes

Copilot reviewed 45 out of 45 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
test/features/planning/planning_page_test.dart Tests hub “New plan + recents” layout and deco env altitude effect.
test/features/planner/range_table_service_test.dart Tests range-table computation semantics and skip behavior.
test/features/planner/range_table_section_test.dart Widget test for range-table grid rendering.
test/features/planner/plan_slate_pdf_test.dart Smoke tests that slate PDF renders for OC/CCR and is parseable.
test/features/planner/plan_file_codec_test.dart Tests .subplan codec round-trip and version/format rejection.
test/features/planner/plan_compare_test.dart Widget tests for compare overlay chart and diff table.
lib/l10n/arb/app_zh.arb Adds new planner/deco/hub strings (ZH).
lib/l10n/arb/app_pt.arb Adds new planner/deco/hub strings (PT).
lib/l10n/arb/app_nl.arb Adds new planner/deco/hub strings (NL).
lib/l10n/arb/app_it.arb Adds new planner/deco/hub strings (IT).
lib/l10n/arb/app_hu.arb Adds new planner/deco/hub strings (HU).
lib/l10n/arb/app_he.arb Adds new planner/deco/hub strings (HE).
lib/l10n/arb/app_fr.arb Adds new planner/deco/hub strings (FR).
lib/l10n/arb/app_es.arb Adds new planner/deco/hub strings (ES).
lib/l10n/arb/app_en.arb Adds new planner/deco/hub strings and placeholders (EN source).
lib/l10n/arb/app_de.arb Adds new planner/deco/hub strings (DE).
lib/l10n/arb/app_ar.arb Adds new planner/deco/hub strings (AR).
lib/l10n/arb/app_localizations.dart Adds generated localization getters for new keys.
lib/l10n/arb/app_localizations_zh.dart Adds generated ZH implementations for new keys.
lib/l10n/arb/app_localizations_pt.dart Adds generated PT implementations for new keys.
lib/l10n/arb/app_localizations_nl.dart Adds generated NL implementations for new keys.
lib/l10n/arb/app_localizations_it.dart Adds generated IT implementations for new keys.
lib/l10n/arb/app_localizations_hu.dart Adds generated HU implementations for new keys.
lib/l10n/arb/app_localizations_he.dart Adds generated HE implementations for new keys.
lib/l10n/arb/app_localizations_fr.dart Adds generated FR implementations for new keys.
lib/l10n/arb/app_localizations_es.dart Adds generated ES implementations for new keys.
lib/l10n/arb/app_localizations_en.dart Adds generated EN implementations for new keys.
lib/l10n/arb/app_localizations_de.dart Adds generated DE implementations for new keys.
lib/l10n/arb/app_localizations_ar.dart Adds generated AR implementations for new keys.
lib/features/planning/presentation/pages/planning_page.dart Redesigns planning hub to feature planner section + tools section.
lib/features/planner/presentation/widgets/saved_plans_sheet.dart Adds plan import/share, and multi-select compare mode.
lib/features/planner/presentation/widgets/range_table_section.dart New widget rendering depth×time range grid with diveability tint.
lib/features/planner/presentation/widgets/plan_results_sheet.dart Adds range-table section to results sheet when available.
lib/features/planner/presentation/providers/plan_canvas_providers.dart Adds provider computing the current plan’s RangeTable.
lib/features/planner/presentation/pages/plan_compare_page.dart New compare page: overlaid profiles + diff table for 2–3 plans.
lib/features/planner/presentation/pages/plan_canvas_page.dart Adds slate PDF export + .subplan share actions to canvas menu.
lib/features/planner/domain/services/range_table_service.dart New domain service computing range tables via PlanEngine re-runs.
lib/features/planner/domain/services/contingency_service.dart Extracts shared deviatePlan helper for contingency + range tables.
lib/features/planner/data/services/plan_slate_pdf_service.dart New PDF slate renderer consuming PlanEngine outputs.
lib/features/planner/data/services/plan_file_codec.dart New versioned .subplan JSON codec with ID regeneration on import.
lib/features/deco_calculator/presentation/widgets/environment_inputs.dart New UI inputs for altitude + water type on deco calculator.
lib/features/deco_calculator/presentation/providers/deco_calculator_providers.dart Adds environment providers and feeds DiveEnvironment into algorithm.
lib/features/deco_calculator/presentation/pages/deco_calculator_page.dart Places environment inputs in the calculator UI.
lib/core/router/app_router.dart Adds /planning/dive-planner/compare?ids= route.
docs/superpowers/plans/2026-07-05-dive-planner-phase7-outputs.md Implementation plan documentation for Phase 7 work.

Comment thread lib/features/planner/presentation/pages/plan_compare_page.dart
Comment thread lib/features/planner/data/services/plan_slate_pdf_service.dart Outdated
Comment thread lib/features/planner/data/services/plan_slate_pdf_service.dart Outdated
Comment thread lib/features/planner/data/services/plan_slate_pdf_service.dart Outdated
Comment thread lib/features/planner/data/services/plan_file_codec.dart
Comment thread lib/features/planner/data/services/plan_file_codec.dart
Comment thread lib/features/planner/data/services/plan_file_codec.dart Outdated
Comment thread lib/features/planner/presentation/widgets/saved_plans_sheet.dart
- Volume units respected in the slate PDF gas table + bailout summary and the
  compare table (UnitFormatter instead of hardcoded L)
- .subplan import hardened: cast failures become FormatException, an unknown
  segment tankKey is rejected, and the import handler catches FileSystemException
  and a generic fallback so no error escapes the sheet
- Cover the saved-plans sheet (compare, duplicate, open, import success + error)
  and the slate bailout path; add a router-backed test harness
@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-phase6-log to main July 6, 2026 03:00
@ericgriffin ericgriffin merged commit fd0d52d 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-phase7-outputs branch July 6, 2026 03:50
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