From 11c70f63ae9a129690e38a19d4485929db40a9ba Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Thu, 19 Mar 2026 08:17:25 +0100 Subject: [PATCH] docs(10-dead-code-cleanup): create phase plan --- .planning/ROADMAP.md | 5 +- .../phases/10-dead-code-cleanup/10-01-PLAN.md | 134 ++++++++++++++++++ 2 files changed, 138 insertions(+), 1 deletion(-) create mode 100644 .planning/phases/10-dead-code-cleanup/10-01-PLAN.md diff --git a/.planning/ROADMAP.md b/.planning/ROADMAP.md index 39e91fa..f718228 100644 --- a/.planning/ROADMAP.md +++ b/.planning/ROADMAP.md @@ -72,6 +72,9 @@ Plans: **Goal**: Remove orphaned v1.0 daily plan files that are no longer used after the calendar strip replacement, keeping the codebase clean **Depends on**: Phase 8 (cleanup after feature work is done) **Requirements**: CLN-01 +**Plans:** 1 plan +Plans: +- [ ] 10-01-PLAN.md — Delete 3 orphaned presentation files, remove DailyPlanState, verify zero regressions **Success Criteria** (what must be TRUE): 1. daily_plan_providers.dart, daily_plan_task_row.dart, and progress_card.dart are deleted 2. DailyPlanDao is preserved (still used by notification service) @@ -91,4 +94,4 @@ Plans: | 7. Task Sorting | v1.1 | 2/2 | Complete | 2026-03-16 | | 8. Task Delete | 2/2 | Complete | 2026-03-18 | - | | 9. Task Creation UX | 1/1 | Complete | 2026-03-18 | - | -| 10. Dead Code Cleanup | v1.2 | - | Planned | - | +| 10. Dead Code Cleanup | v1.2 | 0/1 | Planned | - | diff --git a/.planning/phases/10-dead-code-cleanup/10-01-PLAN.md b/.planning/phases/10-dead-code-cleanup/10-01-PLAN.md new file mode 100644 index 0000000..4e725f6 --- /dev/null +++ b/.planning/phases/10-dead-code-cleanup/10-01-PLAN.md @@ -0,0 +1,134 @@ +--- +phase: 10-dead-code-cleanup +plan: 01 +type: execute +wave: 1 +depends_on: [] +files_modified: + - lib/features/home/presentation/daily_plan_providers.dart + - lib/features/home/presentation/daily_plan_task_row.dart + - lib/features/home/presentation/progress_card.dart + - lib/features/home/domain/daily_plan_models.dart +autonomous: true +requirements: [CLN-01] + +must_haves: + truths: + - "daily_plan_providers.dart no longer exists in the codebase" + - "daily_plan_task_row.dart no longer exists in the codebase" + - "progress_card.dart no longer exists in the codebase" + - "DailyPlanDao is still registered in database.dart and functional" + - "TaskWithRoom class still exists and is importable by calendar system" + - "All 144 tests pass without failures" + - "dart analyze reports zero issues" + artifacts: + - path: "lib/features/home/domain/daily_plan_models.dart" + provides: "TaskWithRoom class (DailyPlanState removed)" + contains: "class TaskWithRoom" + key_links: + - from: "lib/features/home/data/calendar_dao.dart" + to: "lib/features/home/domain/daily_plan_models.dart" + via: "import for TaskWithRoom" + pattern: "import.*daily_plan_models" + - from: "lib/features/home/presentation/calendar_providers.dart" + to: "lib/features/home/domain/daily_plan_models.dart" + via: "import for TaskWithRoom" + pattern: "import.*daily_plan_models" + - from: "lib/core/database/database.dart" + to: "lib/features/home/data/daily_plan_dao.dart" + via: "DAO registration in @DriftDatabase annotation" + pattern: "DailyPlanDao" +--- + + +Delete three orphaned v1.0 daily plan presentation files and clean up the orphaned DailyPlanState class from the domain models file, then verify no regressions. + +Purpose: These files were superseded by the calendar strip (Phase 5, v1.1) but never removed. Cleaning them prevents confusion and reduces maintenance surface. +Output: Three files deleted, one file trimmed, zero test/analysis regressions. + + + +@/home/jlmak/.claude/get-shit-done/workflows/execute-plan.md +@/home/jlmak/.claude/get-shit-done/templates/summary.md + + + +@.planning/PROJECT.md +@.planning/ROADMAP.md +@.planning/STATE.md + + + + + + Task 1: Delete orphaned files and remove DailyPlanState + + lib/features/home/presentation/daily_plan_providers.dart (DELETE) + lib/features/home/presentation/daily_plan_task_row.dart (DELETE) + lib/features/home/presentation/progress_card.dart (DELETE) + lib/features/home/domain/daily_plan_models.dart (MODIFY) + + + 1. Delete these three files entirely (use `rm` or equivalent): + - lib/features/home/presentation/daily_plan_providers.dart + - lib/features/home/presentation/daily_plan_task_row.dart + - lib/features/home/presentation/progress_card.dart + + 2. Edit lib/features/home/domain/daily_plan_models.dart: + - Remove the DailyPlanState class (lines 16-31) entirely. It is only used by the now-deleted daily_plan_providers.dart. + - Keep the TaskWithRoom class intact — it is used by calendar_dao.dart, calendar_models.dart, calendar_providers.dart, calendar_day_list.dart, calendar_task_row.dart, and daily_plan_dao.dart. + - Keep the existing import of database.dart at line 1. + + 3. DO NOT touch these files (they are still in use): + - lib/features/home/data/daily_plan_dao.dart (used by database.dart daos list and settings_screen.dart) + - lib/features/home/data/daily_plan_dao.g.dart (generated, paired with DAO) + + + ls lib/features/home/presentation/daily_plan_providers.dart lib/features/home/presentation/daily_plan_task_row.dart lib/features/home/presentation/progress_card.dart 2>&1 | grep -c "No such file" | grep -q 3 && grep -c "DailyPlanState" lib/features/home/domain/daily_plan_models.dart | grep -q 0 && grep -c "TaskWithRoom" lib/features/home/domain/daily_plan_models.dart | grep -qv 0 && echo "PASS" || echo "FAIL" + + Three dead files deleted, DailyPlanState removed from daily_plan_models.dart, TaskWithRoom preserved + + + + Task 2: Verify zero regressions + + (no files modified — verification only) + + + 1. Run `dart analyze` from the project root. Must report "No issues found!" with zero errors, warnings, or infos. If any issues appear related to the deleted files (unused imports, missing references), fix them — but based on codebase analysis, none are expected since the three files have zero importers. + + 2. Run `flutter test` from the project root. All 144 tests must pass. No test references the deleted files or DailyPlanState (confirmed via grep during planning). + + 3. If dart analyze reveals any issue (unexpected import of deleted file elsewhere), fix the import. This is a safety net — grep during planning found zero references, but the analyzer is authoritative. + + + dart analyze 2>&1 | tail -1 | grep -q "No issues found" && flutter test --reporter compact 2>&1 | tail -1 | grep -q "All tests passed" && echo "PASS" || echo "FAIL" + + dart analyze reports zero issues AND all 144+ tests pass — no regressions from dead code removal + + + + + +1. `ls lib/features/home/presentation/daily_plan_providers.dart` returns "No such file" +2. `ls lib/features/home/presentation/daily_plan_task_row.dart` returns "No such file" +3. `ls lib/features/home/presentation/progress_card.dart` returns "No such file" +4. `grep "DailyPlanDao" lib/core/database/database.dart` still shows the DAO in the daos list +5. `grep "TaskWithRoom" lib/features/home/domain/daily_plan_models.dart` still shows the class +6. `grep "DailyPlanState" lib/features/home/domain/daily_plan_models.dart` returns no matches +7. `dart analyze` reports zero issues +8. `flutter test` — all tests pass + + + +- Three orphaned presentation files are deleted from the codebase +- DailyPlanState class is removed from daily_plan_models.dart +- TaskWithRoom class is preserved in daily_plan_models.dart +- DailyPlanDao is preserved and still registered in database.dart +- `dart analyze` reports zero issues +- All 144+ tests pass + + + +After completion, create `.planning/phases/10-dead-code-cleanup/10-01-SUMMARY.md` +