Skip to content

Dive planner Phase 3: Live Profile Canvas UI and cutover#486

Merged
ericgriffin merged 10 commits into
mainfrom
worktree-dive-planner-phase3-canvas
Jul 6, 2026
Merged

Dive planner Phase 3: Live Profile Canvas UI and cutover#486
ericgriffin merged 10 commits into
mainfrom
worktree-dive-planner-phase3-canvas

Conversation

@ericgriffin

@ericgriffin ericgriffin commented Jul 5, 2026

Copy link
Copy Markdown
Member

Summary

Phase 3 of the dive planner redesign (spec, plan). Stacked on #485 (Phase 2 domain/PlanEngine) — this PR's base is worktree-dive-planner-phase2-domain, so review #484 and #485 first.

Replaces the clunky 3-tab planner with the approved Live Profile Canvas — chart-centric, live-recalculating, results in a swipe-up sheet.

What the diver sees

  • Phone: a hero profile chart (with a dashed ceiling overlay, gas-switch markers, and a drag scrub cursor + readout) over always-visible status chips (RT / NDL-or-TTS / Deco / CNS / a tappable issue count), a scrolling segment + tank editor, and a DraggableScrollableSheet holding the runtime table, per-tank gas plan, and severity-sorted issues.
  • Wide screens: the same regions spread into an editor column + chart + an always-visible results pane (no sheet).
  • Saved plans: a bottom-sheet picker (open / duplicate / delete) backed by Phase 2's divePlanSummariesProvider; the app-bar save button persists with list-summary numbers, and /planning/dive-planner/:planId reopens a saved plan.

Under the hood

  • New lib/features/planner/presentation/planCanvasSeriesProvider/planOutcomeProvider (live PlanEngine), PlanCanvasChart, PlanStatusChips, PlanResultsSheet, SavedPlansSheet, PlanCanvasPage.
  • Accuracy fix: addSimplePlan now produces bottom-only segments so the PlanEngine computes the ascent and real deco stops — the legacy quick plan baked in a fixed ascent + safety stop and showed no deco for a 45 m/25 min air dive.
  • Cutover: deletes the old DivePlannerPage and its deco/gas/profile panels and plannerTabIndexProvider; reuses the settings/tank/segment editing widgets unchanged. Router points the planner routes at the canvas.
  • Issue messages reuse the existing translated divePlanner_warning_* strings where types overlap; the 17 genuinely-new plannerCanvas_* keys are translated into all 10 non-en locales (gen-l10n reports zero untranslated).

Deferred (later phases, per spec)

Contingency ghost overlays and one-tap deviations (5); CCR toggle/badge and bailout scrub (4); tissue bars and a per-sample ceiling envelope; convert-to-dive persistence and plan-vs-actual (6); hub restyle, compare, slate (7); waypoint drag-editing.

Verification

100 planner + dive_planner tests and 304 deco tests green; flutter analyze clean project-wide; all locales valid. Manual macOS smoke (quick-plan → live chart/chips/sheet → save → reopen) recommended before merge.

addSimplePlan now produces bottom-only segments so the PlanEngine computes
the ascent and real deco stops (the legacy full-profile simple plan showed a
safety stop but no deco). planCanvasSeriesProvider builds the profile,
ceiling approximation, gas-switch markers, and stop labels; planOutcomeProvider
runs the engine live off editing state.
New PlanCanvasPage (phone: chart + chips + editor list with a draggable
results sheet; wide: editor column + chart + always-visible results pane)
replaces the 3-tab DivePlannerPage. Deletes the old page and its
deco/gas/profile panels and the plannerTabIndexProvider; reuses the
settings/tank/segment editing widgets. Router now points /planning/dive-planner
and :planId at the canvas.
Translated the 17 new plannerCanvas_* keys into ar, de, es, fr, he, hu, it,
nl, pt, zh. gen-l10n reports zero untranslated messages.

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 3 of the dive planner redesign by cutting over the planner route to a new “Live Profile Canvas” UI: a chart-centric, live-recalculating planner with status chips, a results sheet/pane, and a saved-plans picker, all driven by the Phase 2 PlanEngine.

Changes:

  • Added a new planner presentation layer (planOutcomeProvider/canvas series providers + canvas chart, status chips, results sheet, saved plans sheet, and the new PlanCanvasPage).
  • Cut over routing from the legacy 3-tab DivePlannerPage to PlanCanvasPage and removed the legacy results/chart panels.
  • Updated “quick plan” generation to author only bottom segments (descent + bottom) so ascent/deco are computed by PlanEngine, plus added l10n keys and widget tests for the new UI.

Reviewed changes

Copilot reviewed 41 out of 41 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/features/planner/saved_plans_sheet_test.dart Widget coverage for saved plans list/empty/delete confirmation flow.
test/features/planner/plan_results_widgets_test.dart Widget coverage for status chips + results sheet rendering.
test/features/planner/plan_canvas_providers_test.dart Unit coverage for canvas providers/series generation and defaults.
test/features/planner/plan_canvas_page_test.dart Widget coverage for responsive page layout + save action behavior.
test/features/planner/plan_canvas_chart_test.dart Unit/widget coverage for segment time mapping + chart empty/non-empty states.
lib/l10n/arb/app_zh.arb Adds planner canvas l10n strings (zh).
lib/l10n/arb/app_pt.arb Adds planner canvas l10n strings (pt).
lib/l10n/arb/app_nl.arb Adds planner canvas l10n strings (nl).
lib/l10n/arb/app_localizations.dart Generated localization API updates for new planner canvas keys.
lib/l10n/arb/app_localizations_zh.dart Generated zh localization implementation for new keys.
lib/l10n/arb/app_localizations_pt.dart Generated pt localization implementation for new keys.
lib/l10n/arb/app_localizations_nl.dart Generated nl localization implementation for new keys.
lib/l10n/arb/app_localizations_it.dart Generated it localization implementation for new keys.
lib/l10n/arb/app_localizations_hu.dart Generated hu localization implementation for new keys.
lib/l10n/arb/app_localizations_he.dart Generated he localization implementation for new keys.
lib/l10n/arb/app_localizations_fr.dart Generated fr localization implementation for new keys.
lib/l10n/arb/app_localizations_es.dart Generated es localization implementation for new keys.
lib/l10n/arb/app_localizations_en.dart Generated en localization implementation for new keys.
lib/l10n/arb/app_localizations_de.dart Generated de localization implementation for new keys.
lib/l10n/arb/app_localizations_ar.dart Generated ar localization implementation for new keys.
lib/l10n/arb/app_it.arb Adds planner canvas l10n strings (it).
lib/l10n/arb/app_hu.arb Adds planner canvas l10n strings (hu).
lib/l10n/arb/app_he.arb Adds planner canvas l10n strings (he).
lib/l10n/arb/app_fr.arb Adds planner canvas l10n strings (fr).
lib/l10n/arb/app_es.arb Adds planner canvas l10n strings (es).
lib/l10n/arb/app_en.arb Adds planner canvas l10n strings + placeholder metadata (en).
lib/l10n/arb/app_de.arb Adds planner canvas l10n strings (de).
lib/l10n/arb/app_ar.arb Adds planner canvas l10n strings (ar).
lib/features/planner/presentation/widgets/saved_plans_sheet.dart New saved plans bottom sheet (open/duplicate/delete) wired to repository/providers.
lib/features/planner/presentation/widgets/plan_status_chips.dart New always-visible headline chips (RT, NDL/TTS, Deco, CNS, Issues).
lib/features/planner/presentation/widgets/plan_results_sheet.dart New results content (runtime table, per-tank gas, severity-sorted issues).
lib/features/planner/presentation/widgets/plan_canvas_chart.dart New hero canvas chart (profile + ceiling overlay + gas switches + scrub).
lib/features/planner/presentation/providers/plan_canvas_providers.dart New providers: engine config, plan outcome, scrub state, and canvas series assembly.
lib/features/planner/presentation/pages/plan_canvas_page.dart New responsive planner page (phone sheet vs wide results pane) + app bar actions.
lib/features/dive_planner/presentation/widgets/plan_profile_chart.dart Removed legacy profile chart (superseded by canvas chart).
lib/features/dive_planner/presentation/widgets/gas_results_panel.dart Removed legacy gas results panel (superseded by results sheet).
lib/features/dive_planner/presentation/widgets/deco_results_panel.dart Removed legacy deco results panel (superseded by results sheet).
lib/features/dive_planner/presentation/providers/dive_planner_providers.dart Updates quick-plan generation and removes obsolete tab index provider.
lib/features/dive_planner/presentation/pages/dive_planner_page.dart Removed legacy 3-tab planner page (route cutover).
lib/core/router/app_router.dart Routes /planning/dive-planner and :planId now build PlanCanvasPage.
docs/superpowers/plans/2026-07-05-dive-planner-phase3-canvas.md Adds/updates Phase 3 implementation plan document.

Comment thread lib/features/planner/presentation/pages/plan_canvas_page.dart
Comment thread lib/features/planner/presentation/pages/plan_canvas_page.dart Outdated
…mments

- Wide layout: hoist and dispose the results ScrollController (was created
  per build); wire the issues chip to scroll the pane to the issues section
- Drop the hardcoded 'OC' badge — a real state-derived OC/CCR toggle lands
  with CCR support in a later phase
- Add canvas page/chart interaction coverage (menus, dialogs, sheets, gas
  switches, scrub readout)
Base automatically changed from worktree-dive-planner-phase2-domain to main July 6, 2026 01:17
@ericgriffin ericgriffin self-assigned this Jul 6, 2026
@ericgriffin ericgriffin moved this from Backlog to In review in Submersion Release Tracker Jul 6, 2026
@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

@ericgriffin ericgriffin merged commit 3c2923e 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-phase3-canvas branch July 6, 2026 01:43
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