docs(08-02): complete task delete UI plan

- Add 08-02-SUMMARY.md with delete button and smartDeleteTask outcomes
- Update STATE.md with progress, decisions, and session continuity
- Update ROADMAP.md: phase 08-task-delete 2/2 plans complete
- Mark DEL-01 and DEL-04 requirements complete
This commit is contained in:
2026-03-18 21:03:21 +01:00
parent 6133c977f5
commit 6db4611719
4 changed files with 131 additions and 11 deletions

View File

@@ -9,10 +9,10 @@ Requirements for milestone v1.2 Polish & Task Management. Each maps to roadmap p
### Task Delete
- [ ] **DEL-01**: User can delete a task from the task edit form via a clearly visible delete action
- [x] **DEL-01**: User can delete a task from the task edit form via a clearly visible delete action
- [x] **DEL-02**: Deleting a task that has never been completed removes it from the database entirely (hard delete)
- [x] **DEL-03**: Deleting a task that has been completed at least once deactivates it instead (soft delete) — task is hidden from all active views but preserved in the database for future statistics
- [ ] **DEL-04**: User sees a confirmation before deleting/deactivating a task
- [x] **DEL-04**: User sees a confirmation before deleting/deactivating a task
### Task Creation UX

View File

@@ -33,7 +33,7 @@ See `milestones/v1.1-ROADMAP.md` for full phase details.
**v1.2 Polish & Task Management (Phases 8-10):**
- [ ] **Phase 8: Task Delete** - Add smart delete action to tasks — hard delete if never completed, soft delete (deactivate) if completed at least once
- [x] **Phase 8: Task Delete** - Add smart delete action to tasks — hard delete if never completed, soft delete (deactivate) if completed at least once (completed 2026-03-18)
- [ ] **Phase 9: Task Creation UX** - Rework the frequency picker from flat preset chips to an intuitive "Every N units" interface with quick-select shortcuts
- [ ] **Phase 10: Dead Code Cleanup** - Remove orphaned v1.0 daily plan files and verify no regressions
@@ -43,7 +43,7 @@ See `milestones/v1.1-ROADMAP.md` for full phase details.
**Goal**: Users can remove tasks they no longer need, with smart preservation of completion history for future statistics
**Depends on**: Phase 7 (v1.1 shipped — calendar, history, and sorting all in place)
**Requirements**: DEL-01, DEL-02, DEL-03, DEL-04
**Plans:** 1/2 plans executed
**Plans:** 2/2 plans complete
Plans:
- [ ] 08-01-PLAN.md — Data layer: isActive column, schema migration, DAO filters and methods
- [ ] 08-02-PLAN.md — UI layer: delete button, confirmation dialog, smart delete provider
@@ -86,6 +86,6 @@ Plans:
| 5. Calendar Strip | v1.1 | 2/2 | Complete | 2026-03-16 |
| 6. Task History | v1.1 | 1/1 | Complete | 2026-03-16 |
| 7. Task Sorting | v1.1 | 2/2 | Complete | 2026-03-16 |
| 8. Task Delete | 1/2 | In Progress| | - |
| 8. Task Delete | 2/2 | Complete | 2026-03-18 | - |
| 9. Task Creation UX | v1.2 | - | Planned | - |
| 10. Dead Code Cleanup | v1.2 | - | Planned | - |

View File

@@ -3,14 +3,14 @@ gsd_state_version: 1.0
milestone: v1.0
milestone_name: milestone
status: "Ready for /gsd:plan-phase 8"
stopped_at: Completed 08-task-delete 08-01-PLAN.md
last_updated: "2026-03-18T19:58:20.028Z"
stopped_at: Completed 08-task-delete 08-02-PLAN.md
last_updated: "2026-03-18T20:03:07.082Z"
last_activity: 2026-03-18 — Created v1.2 milestone
progress:
total_phases: 3
completed_phases: 0
completed_phases: 1
total_plans: 2
completed_plans: 1
completed_plans: 2
percent: 0
---
@@ -43,6 +43,7 @@ Progress: [░░░░░░░░░░] 0% (0/3 phases)
| LOC (lib) | 7,773 | 9,051 | TBD |
| Tests | 89 | 108 | TBD |
| Phase 08-task-delete P01 | 9 | 2 tasks | 11 files |
| Phase 08-task-delete P02 | 2 | 2 tasks | 3 files |
## Accumulated Context
@@ -52,6 +53,8 @@ Decisions archived to PROJECT.md Key Decisions table.
- [Phase 08-task-delete]: isActive uses BoolColumn.withDefault(true) so existing rows are automatically active after migration without backfill
- [Phase 08-task-delete]: Migration uses from==2 (not from<3) for addColumn to avoid duplicate-column error when createTable already includes isActive in current schema definition
- [Phase 08-task-delete]: Migration tests updated to only test v1->v3 and v2->v3 paths since AppDatabase.schemaVersion=3 always migrates to v3
- [Phase 08-task-delete]: smartDeleteTask kept separate from deleteTask to preserve existing hard-delete path for cascade/other uses
- [Phase 08-task-delete]: Delete button placed after history section with divider, visible only in edit mode
### Pending Todos
@@ -63,7 +66,7 @@ None.
## Session Continuity
Last session: 2026-03-18T19:58:20.026Z
Stopped at: Completed 08-task-delete 08-01-PLAN.md
Last session: 2026-03-18T20:03:07.081Z
Stopped at: Completed 08-task-delete 08-02-PLAN.md
Resume file: None
Next action: /gsd:plan-phase 8

View File

@@ -0,0 +1,117 @@
---
phase: 08-task-delete
plan: 02
subsystem: ui
tags: [flutter, riverpod, drift, material3, l10n]
# Dependency graph
requires:
- phase: 08-task-delete plan 01
provides: softDeleteTask and getCompletionCount on TasksDao, isActive column migration
provides:
- smartDeleteTask on TaskActions provider (hard delete if 0 completions, soft delete otherwise)
- Red delete button in task edit form with Material 3 error color
- Confirmation AlertDialog using existing German l10n strings
- Full delete flow: button -> dialog -> smart delete -> navigate back
affects: [task-form, task-providers, any future task management UI]
# Tech tracking
tech-stack:
added: []
patterns:
- Smart delete pattern: check completion count to decide hard vs soft delete
- Delete confirmation dialog matching room delete pattern with error-colored FilledButton
key-files:
created: []
modified:
- lib/features/tasks/presentation/task_providers.dart
- lib/features/tasks/presentation/task_form_screen.dart
key-decisions:
- "smartDeleteTask kept separate from deleteTask to preserve existing hard-delete path for cascade/other uses"
- "Delete button placed after history section with divider, visible only in edit mode"
patterns-established:
- "Delete confirmation pattern: showDialog<bool> returning true/false, error-colored FilledButton for confirm"
- "Smart delete pattern: getCompletionCount -> conditional hard/soft delete invisible to user"
requirements-completed: [DEL-01, DEL-04]
# Metrics
duration: 2min
completed: 2026-03-18
---
# Phase 8 Plan 02: Task Delete UI Summary
**Red delete button with confirmation dialog in task edit form: hard-deletes unused tasks, soft-deletes tasks with completion history**
## Performance
- **Duration:** 2 min
- **Started:** 2026-03-18T19:59:37Z
- **Completed:** 2026-03-18T20:02:05Z
- **Tasks:** 2
- **Files modified:** 2
## Accomplishments
- Added `smartDeleteTask` to `TaskActions` Riverpod notifier — checks completion count and routes to DAO `deleteTask` (hard) or `softDeleteTask` (soft)
- Added red `FilledButton.icon` with error colorScheme at bottom of task edit form, separated from history section by a `Divider`
- Added `_onDelete` confirmation dialog using existing `taskDeleteConfirmTitle`, `taskDeleteConfirmMessage`, `taskDeleteConfirmAction`, and `cancel` l10n strings
- All 144 tests pass, `dart analyze --fatal-infos` clean
## Task Commits
Each task was committed atomically:
1. **Task 1: Add smartDeleteTask to TaskActions provider** - `1b1b981` (feat)
2. **Task 2: Add delete button and confirmation dialog to TaskFormScreen** - `6133c97` (feat)
**Plan metadata:** _(docs commit follows)_
## Files Created/Modified
- `lib/features/tasks/presentation/task_providers.dart` - Added `smartDeleteTask` method to `TaskActions` class
- `lib/features/tasks/presentation/task_providers.g.dart` - Regenerated by build_runner (no functional changes)
- `lib/features/tasks/presentation/task_form_screen.dart` - Added delete button in edit mode and `_onDelete` async method
## Decisions Made
- `smartDeleteTask` kept separate from `deleteTask` to preserve the existing hard-delete path used for room cascade deletes and any other callers
- Delete button placed after history ListTile, inside the `if (widget.isEditing)` block, so it never appears in create mode
## Deviations from Plan
None - plan executed exactly as written.
## Issues Encountered
None.
## User Setup Required
None - no external service configuration required.
## Next Phase Readiness
- Complete delete flow is working: task edit form -> red delete button -> confirmation dialog -> smart delete -> pop back to room task list
- Soft-deleted tasks (isActive=false) are already filtered from all views (implemented in Plan 01)
- Phase 08-task-delete is fully complete
---
*Phase: 08-task-delete*
*Completed: 2026-03-18*
## Self-Check: PASSED
- FOUND: lib/features/tasks/presentation/task_providers.dart
- FOUND: lib/features/tasks/presentation/task_form_screen.dart
- FOUND: .planning/phases/08-task-delete/08-02-SUMMARY.md
- FOUND: commit 1b1b981 (smartDeleteTask)
- FOUND: commit 6133c97 (delete button and dialog)
- FOUND: smartDeleteTask in task_providers.dart
- FOUND: taskDeleteConfirmTitle in task_form_screen.dart