docs(07-01): complete task sort domain and provider plan
This commit is contained in:
@@ -22,9 +22,9 @@ Requirements for milestone v1.1 Calendar & Polish. Each maps to roadmap phases.
|
|||||||
|
|
||||||
### Task Sorting
|
### Task Sorting
|
||||||
|
|
||||||
- [ ] **SORT-01**: User can sort tasks alphabetically
|
- [x] **SORT-01**: User can sort tasks alphabetically
|
||||||
- [ ] **SORT-02**: User can sort tasks by frequency interval
|
- [x] **SORT-02**: User can sort tasks by frequency interval
|
||||||
- [ ] **SORT-03**: User can sort tasks by effort level
|
- [x] **SORT-03**: User can sort tasks by effort level
|
||||||
|
|
||||||
## Future Requirements
|
## Future Requirements
|
||||||
|
|
||||||
@@ -67,9 +67,9 @@ Which phases cover which requirements. Updated during roadmap creation.
|
|||||||
| CAL-05 | Phase 5 | Complete |
|
| CAL-05 | Phase 5 | Complete |
|
||||||
| HIST-01 | Phase 6 | Complete |
|
| HIST-01 | Phase 6 | Complete |
|
||||||
| HIST-02 | Phase 6 | Complete |
|
| HIST-02 | Phase 6 | Complete |
|
||||||
| SORT-01 | Phase 7 | Pending |
|
| SORT-01 | Phase 7 | Complete |
|
||||||
| SORT-02 | Phase 7 | Pending |
|
| SORT-02 | Phase 7 | Complete |
|
||||||
| SORT-03 | Phase 7 | Pending |
|
| SORT-03 | Phase 7 | Complete |
|
||||||
|
|
||||||
**Coverage:**
|
**Coverage:**
|
||||||
- v1.1 requirements: 10 total
|
- v1.1 requirements: 10 total
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ Plans:
|
|||||||
2. Selecting alphabetical sort orders tasks A-Z by name within the visible list
|
2. Selecting alphabetical sort orders tasks A-Z by name within the visible list
|
||||||
3. Selecting interval sort orders tasks from most-frequent (daily) to least-frequent (yearly/custom) intervals
|
3. Selecting interval sort orders tasks from most-frequent (daily) to least-frequent (yearly/custom) intervals
|
||||||
4. Selecting effort sort orders tasks from lowest effort to highest effort level
|
4. Selecting effort sort orders tasks from lowest effort to highest effort level
|
||||||
**Plans:** 2 plans
|
**Plans:** 1/2 plans executed
|
||||||
Plans:
|
Plans:
|
||||||
- [ ] 07-01-PLAN.md — Sort model, persistence notifier, localization, provider integration
|
- [ ] 07-01-PLAN.md — Sort model, persistence notifier, localization, provider integration
|
||||||
- [ ] 07-02-PLAN.md — Sort dropdown widget, HomeScreen AppBar, TaskListScreen integration, tests
|
- [ ] 07-02-PLAN.md — Sort dropdown widget, HomeScreen AppBar, TaskListScreen integration, tests
|
||||||
@@ -78,4 +78,4 @@ Plans:
|
|||||||
| 4. Notifications | v1.0 | 3/3 | Complete | 2026-03-16 |
|
| 4. Notifications | v1.0 | 3/3 | Complete | 2026-03-16 |
|
||||||
| 5. Calendar Strip | 2/2 | Complete | 2026-03-16 | - |
|
| 5. Calendar Strip | 2/2 | Complete | 2026-03-16 | - |
|
||||||
| 6. Task History | 1/1 | Complete | 2026-03-16 | - |
|
| 6. Task History | 1/1 | Complete | 2026-03-16 | - |
|
||||||
| 7. Task Sorting | v1.1 | 0/2 | Not started | - |
|
| 7. Task Sorting | 1/2 | In Progress| | - |
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ gsd_state_version: 1.0
|
|||||||
milestone: v1.0
|
milestone: v1.0
|
||||||
milestone_name: milestone
|
milestone_name: milestone
|
||||||
status: completed
|
status: completed
|
||||||
stopped_at: Phase 7 context gathered
|
stopped_at: Completed 07-task-sorting/07-01-PLAN.md
|
||||||
last_updated: "2026-03-16T21:14:25.791Z"
|
last_updated: "2026-03-16T21:34:49.629Z"
|
||||||
last_activity: 2026-03-16 — Completed Phase 6 Plan 01 (task completion history)
|
last_activity: 2026-03-16 — Completed Phase 6 Plan 01 (task completion history)
|
||||||
progress:
|
progress:
|
||||||
total_phases: 3
|
total_phases: 3
|
||||||
completed_phases: 2
|
completed_phases: 2
|
||||||
total_plans: 3
|
total_plans: 5
|
||||||
completed_plans: 3
|
completed_plans: 4
|
||||||
percent: 100
|
percent: 100
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -45,6 +45,7 @@ Progress: [██████████] 100% (1/1 plans in Phase 6)
|
|||||||
| Phase 05-calendar-strip P01 | 5 | 2 tasks | 10 files |
|
| Phase 05-calendar-strip P01 | 5 | 2 tasks | 10 files |
|
||||||
| Phase 05-calendar-strip P02 | 8 | 3 tasks | 9 files |
|
| Phase 05-calendar-strip P02 | 8 | 3 tasks | 9 files |
|
||||||
| Phase 06-task-history P01 | 5 | 2 tasks | 9 files |
|
| Phase 06-task-history P01 | 5 | 2 tasks | 9 files |
|
||||||
|
| Phase 07-task-sorting P01 | 4 | 2 tasks | 9 files |
|
||||||
|
|
||||||
## Accumulated Context
|
## Accumulated Context
|
||||||
|
|
||||||
@@ -63,6 +64,9 @@ Progress: [██████████] 100% (1/1 plans in Phase 6)
|
|||||||
| Tests use pump()+pump(Duration) instead of pumpAndSettle() | CalendarStrip animation controllers cause pumpAndSettle timeout — fixed-duration pump steps are reliable |
|
| Tests use pump()+pump(Duration) instead of pumpAndSettle() | CalendarStrip animation controllers cause pumpAndSettle timeout — fixed-duration pump steps are reliable |
|
||||||
| No separate Riverpod provider for history sheet | ref.read(appDatabaseProvider) directly in ConsumerWidget — one-shot modals do not need a dedicated provider |
|
| No separate Riverpod provider for history sheet | ref.read(appDatabaseProvider) directly in ConsumerWidget — one-shot modals do not need a dedicated provider |
|
||||||
| CalendarTaskRow onTap navigates to task edit form | Makes history accessible in one tap from home screen, consistent with GoRouter route patterns |
|
| CalendarTaskRow onTap navigates to task edit form | Makes history accessible in one tap from home screen, consistent with GoRouter route patterns |
|
||||||
|
- [Phase 07-task-sorting]: Default sort is alphabetical — continuity with existing A-Z SQL sort in CalendarDayList
|
||||||
|
- [Phase 07-task-sorting]: overdueTasks are NOT sorted — pinned at top in existing order per design decision
|
||||||
|
- [Phase 07-task-sorting]: Sort preference stored as enum.name string in SharedPreferences (not intEnum) — enum reordering safe
|
||||||
|
|
||||||
### Pending Todos
|
### Pending Todos
|
||||||
|
|
||||||
@@ -74,7 +78,7 @@ None.
|
|||||||
|
|
||||||
## Session Continuity
|
## Session Continuity
|
||||||
|
|
||||||
Last session: 2026-03-16T21:14:25.789Z
|
Last session: 2026-03-16T21:34:49.627Z
|
||||||
Stopped at: Phase 7 context gathered
|
Stopped at: Completed 07-task-sorting/07-01-PLAN.md
|
||||||
Resume file: .planning/phases/07-task-sorting/07-CONTEXT.md
|
Resume file: None
|
||||||
Next action: Phase 7 (task sorting) or release
|
Next action: Phase 7 (task sorting) or release
|
||||||
|
|||||||
138
.planning/phases/07-task-sorting/07-01-SUMMARY.md
Normal file
138
.planning/phases/07-task-sorting/07-01-SUMMARY.md
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
---
|
||||||
|
phase: 07-task-sorting
|
||||||
|
plan: 01
|
||||||
|
subsystem: ui
|
||||||
|
tags: [flutter, riverpod, shared_preferences, sorting, localization]
|
||||||
|
|
||||||
|
# Dependency graph
|
||||||
|
requires:
|
||||||
|
- phase: 05-calendar-strip
|
||||||
|
provides: calendarDayProvider and CalendarDayState used by sort integration
|
||||||
|
- phase: 06-task-history
|
||||||
|
provides: task domain model and CalendarTaskRow context
|
||||||
|
|
||||||
|
provides:
|
||||||
|
- TaskSortOption enum (alphabetical, interval, effort)
|
||||||
|
- SortPreferenceNotifier with SharedPreferences persistence
|
||||||
|
- sortPreferenceProvider (keepAlive Riverpod provider)
|
||||||
|
- calendarDayProvider with in-memory sort of dayTasks
|
||||||
|
- tasksInRoomProvider with in-memory sort via stream.map
|
||||||
|
- German localization strings: sortAlphabetical, sortInterval, sortEffort, sortLabel
|
||||||
|
|
||||||
|
affects: [07-02-sort-ui, any phase using calendarDayProvider or tasksInRoomProvider]
|
||||||
|
|
||||||
|
# Tech tracking
|
||||||
|
tech-stack:
|
||||||
|
added: []
|
||||||
|
patterns:
|
||||||
|
- "SortPreferenceNotifier: sync default return, async _loadPersisted() — same pattern as ThemeNotifier"
|
||||||
|
- "In-memory sort helper functions (_sortTasks, _sortTasksRaw) applied after DB stream emit"
|
||||||
|
- "overdueTasks intentionally unsorted — only dayTasks sorted"
|
||||||
|
|
||||||
|
key-files:
|
||||||
|
created:
|
||||||
|
- lib/features/tasks/domain/task_sort_option.dart
|
||||||
|
- lib/features/tasks/presentation/sort_preference_notifier.dart
|
||||||
|
- lib/features/tasks/presentation/sort_preference_notifier.g.dart
|
||||||
|
- test/features/tasks/presentation/sort_preference_notifier_test.dart
|
||||||
|
modified:
|
||||||
|
- lib/features/home/presentation/calendar_providers.dart
|
||||||
|
- lib/features/tasks/presentation/task_providers.dart
|
||||||
|
- lib/l10n/app_de.arb
|
||||||
|
- lib/l10n/app_localizations.dart
|
||||||
|
- lib/l10n/app_localizations_de.dart
|
||||||
|
|
||||||
|
key-decisions:
|
||||||
|
- "Default sort is alphabetical — continuity with existing A-Z SQL sort in CalendarDayList"
|
||||||
|
- "overdueTasks are NOT sorted — they stay pinned at the top in existing order"
|
||||||
|
- "Sort stored as string (enum.name) in SharedPreferences — not intEnum, so reordering enum is safe"
|
||||||
|
- "SortPreferenceNotifier uses keepAlive: true — global preference should never be disposed"
|
||||||
|
|
||||||
|
patterns-established:
|
||||||
|
- "SortPreferenceNotifier pattern: sync default + async _loadPersisted() — matches ThemeNotifier"
|
||||||
|
- "In-memory sort via stream.map in StreamProvider — DB SQL sort provides stable baseline, in-memory overrides"
|
||||||
|
|
||||||
|
requirements-completed: [SORT-01, SORT-02, SORT-03]
|
||||||
|
|
||||||
|
# Metrics
|
||||||
|
duration: 4min
|
||||||
|
completed: 2026-03-16
|
||||||
|
---
|
||||||
|
|
||||||
|
# Phase 07 Plan 01: Task Sort Domain and Provider Summary
|
||||||
|
|
||||||
|
**TaskSortOption enum + SharedPreferences-backed SortPreferenceNotifier wired into calendarDayProvider and tasksInRoomProvider with in-memory alphabetical/interval/effort sorting**
|
||||||
|
|
||||||
|
## Performance
|
||||||
|
|
||||||
|
- **Duration:** 4 min
|
||||||
|
- **Started:** 2026-03-16T21:29:32Z
|
||||||
|
- **Completed:** 2026-03-16T21:33:37Z
|
||||||
|
- **Tasks:** 2
|
||||||
|
- **Files modified:** 9
|
||||||
|
|
||||||
|
## Accomplishments
|
||||||
|
|
||||||
|
- TaskSortOption enum (alphabetical, interval, effort) with SharedPreferences persistence via SortPreferenceNotifier
|
||||||
|
- calendarDayProvider now watches sortPreferenceProvider and sorts dayTasks in-memory; overdueTasks intentionally unsorted
|
||||||
|
- tasksInRoomProvider now watches sortPreferenceProvider and applies sort via stream.map
|
||||||
|
- 7 new unit tests for SortPreferenceNotifier covering default, state update, persistence, and restart recovery
|
||||||
|
- 4 German localization strings added (sortAlphabetical, sortInterval, sortEffort, sortLabel)
|
||||||
|
|
||||||
|
## Task Commits
|
||||||
|
|
||||||
|
Each task was committed atomically:
|
||||||
|
|
||||||
|
1. **TDD RED: Failing sort preference tests** - `a9f2983` (test)
|
||||||
|
2. **Task 1: TaskSortOption enum, SortPreferenceNotifier, localization** - `13c7d62` (feat)
|
||||||
|
3. **Task 2: Sort integration into calendarDayProvider and tasksInRoomProvider** - `3697e4e` (feat)
|
||||||
|
|
||||||
|
## Files Created/Modified
|
||||||
|
|
||||||
|
- `lib/features/tasks/domain/task_sort_option.dart` - TaskSortOption enum with alphabetical/interval/effort values
|
||||||
|
- `lib/features/tasks/presentation/sort_preference_notifier.dart` - SortPreferenceNotifier with SharedPreferences persistence
|
||||||
|
- `lib/features/tasks/presentation/sort_preference_notifier.g.dart` - Generated Riverpod provider code
|
||||||
|
- `lib/features/home/presentation/calendar_providers.dart` - Added sortPreferenceProvider watch + _sortTasks helper
|
||||||
|
- `lib/features/tasks/presentation/task_providers.dart` - Added sortPreferenceProvider watch + _sortTasksRaw helper + stream.map
|
||||||
|
- `lib/l10n/app_de.arb` - Added sortAlphabetical, sortInterval, sortEffort, sortLabel strings
|
||||||
|
- `lib/l10n/app_localizations.dart` - Regenerated with sort string getters
|
||||||
|
- `lib/l10n/app_localizations_de.dart` - Regenerated with German sort string implementations
|
||||||
|
- `test/features/tasks/presentation/sort_preference_notifier_test.dart` - 7 unit tests for sort preference
|
||||||
|
|
||||||
|
## Decisions Made
|
||||||
|
|
||||||
|
- Default sort is alphabetical for continuity with existing SQL A-Z sort in CalendarDayList
|
||||||
|
- overdueTasks section is explicitly NOT sorted — stays pinned at top in existing order
|
||||||
|
- Sort preference stored as enum.name string in SharedPreferences (not intEnum) so enum reordering is always safe
|
||||||
|
- SortPreferenceNotifier uses `keepAlive: true` — global app preference must not be disposed
|
||||||
|
|
||||||
|
## Deviations from Plan
|
||||||
|
|
||||||
|
None - plan executed exactly as written.
|
||||||
|
|
||||||
|
## Issues Encountered
|
||||||
|
|
||||||
|
None.
|
||||||
|
|
||||||
|
## User Setup Required
|
||||||
|
|
||||||
|
None - no external service configuration required.
|
||||||
|
|
||||||
|
## Next Phase Readiness
|
||||||
|
|
||||||
|
- sortPreferenceProvider is live and defaults to alphabetical
|
||||||
|
- Both task list providers react to sort preference changes immediately
|
||||||
|
- Ready for 07-02: sort UI (dropdown in AppBar) to write to sortPreferenceProvider
|
||||||
|
|
||||||
|
---
|
||||||
|
*Phase: 07-task-sorting*
|
||||||
|
*Completed: 2026-03-16*
|
||||||
|
|
||||||
|
## Self-Check: PASSED
|
||||||
|
|
||||||
|
- FOUND: lib/features/tasks/domain/task_sort_option.dart
|
||||||
|
- FOUND: lib/features/tasks/presentation/sort_preference_notifier.dart
|
||||||
|
- FOUND: lib/features/tasks/presentation/sort_preference_notifier.g.dart
|
||||||
|
- FOUND: test/features/tasks/presentation/sort_preference_notifier_test.dart
|
||||||
|
- FOUND: .planning/phases/07-task-sorting/07-01-SUMMARY.md
|
||||||
|
- Commits a9f2983, 13c7d62, 3697e4e all verified in git log
|
||||||
Reference in New Issue
Block a user