Dive planner redesign phase 7: outputs + hub#491
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
.subplanplan export/import, plus a multi-plan compare page reachable from saved plans. - Redesign
/planninghub 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. |
…anner-phase7-outputs
- 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
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 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.
RangeTableServicere-runs the engine over a depth (±3/6 m) × time (±5/10 min) matrix using the samedeviatePlansemantics 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.PlanSlatePdfServicerenders 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 existingsharePdfBytes/PdfFontsinfrastructure.plan_file_codec.dart, formatsubmersion-planv1) 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./planning/dive-planner/compare?ids=page with overlaid computed profiles and a diff table (max depth, runtime, TTS, deco, CNS, total gas)./planningnow leads with the planner — a New Plan CTA plus the three most recent saved plans — with the calculators grouped under a Tools section.DiveEnvironment.forConditionsinto the sharedBuhlmannAlgorithmseam, so the calculator agrees with the planner at altitude. Defaults preserve the legacy standard environment exactly.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)flutter analyzeanddart format .clean