Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 154 additions & 0 deletions docs/superpowers/plans/2026-07-05-dive-planner-phase3-canvas.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions lib/core/router/app_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ import 'package:submersion/features/dive_computer/presentation/providers/downloa
import 'package:submersion/features/dive_log/presentation/providers/dive_computer_providers.dart';
import 'package:submersion/features/import_wizard/data/adapters/dive_computer_adapter.dart';
import 'package:submersion/features/dashboard/presentation/pages/dashboard_page.dart';
import 'package:submersion/features/dive_planner/presentation/pages/dive_planner_page.dart';
import 'package:submersion/features/planner/presentation/pages/plan_canvas_page.dart';
import 'package:submersion/features/surface_interval_tool/presentation/pages/surface_interval_tool_page.dart';
import 'package:submersion/features/import_wizard/data/adapters/universal_adapter.dart';
import 'package:submersion/l10n/l10n_extension.dart';
Expand Down Expand Up @@ -206,12 +206,12 @@ final appRouterProvider = Provider<GoRouter>((ref) {
GoRoute(
path: 'dive-planner',
name: 'divePlanner',
builder: (context, state) => const DivePlannerPage(),
builder: (context, state) => const PlanCanvasPage(),
routes: [
GoRoute(
path: ':planId',
name: 'editPlan',
builder: (context, state) => DivePlannerPage(
builder: (context, state) => PlanCanvasPage(
planId: state.pathParameters['planId'],
),
),
Expand Down
306 changes: 0 additions & 306 deletions lib/features/dive_planner/presentation/pages/dive_planner_page.dart

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -193,19 +193,34 @@ class DivePlanNotifier extends StateNotifier<DivePlanState> {
}
}

/// Add a simple dive profile (descent + bottom + ascent).
/// Add a simple dive profile as the bottom portion only: a descent and a
/// bottom segment. The ascent and any decompression are always computed by
/// the PlanEngine from the deepest segment, so authoring a fixed ascent
/// here would suppress real deco stops.
void addSimplePlan({
required double maxDepth,
required int bottomTimeMinutes,
}) {
if (state.tanks.isEmpty) return;

final tank = state.tanks.first;
final segments = _calculator.createSimplePlan(
maxDepth: maxDepth,
bottomTimeMinutes: bottomTimeMinutes,
tank: tank,
);
final segments = <PlanSegment>[
PlanSegment.descent(
id: _uuid.v4(),
targetDepth: maxDepth,
tankId: tank.id,
gasMix: tank.gasMix,
order: 0,
),
PlanSegment.bottom(
id: _uuid.v4(),
depth: maxDepth,
durationMinutes: bottomTimeMinutes,
tankId: tank.id,
gasMix: tank.gasMix,
order: 1,
),
];

state = state.copyWith(
segments: segments,
Expand Down Expand Up @@ -507,8 +522,5 @@ final planIsValidProvider = Provider<bool>((ref) {
/// Currently selected segment for editing.
final selectedSegmentIdProvider = StateProvider<String?>((ref) => null);

/// Currently selected tab index in planner page.
final plannerTabIndexProvider = StateProvider<int>((ref) => 0);

/// Whether the simple plan dialog is shown.
final showSimplePlanDialogProvider = StateProvider<bool>((ref) => false);
Loading
Loading