Goal: Allow users to reorder tasks within categories by dragging
Implementation:
- Add
@Statefor tracking drag state in TaskRow - Use SwiftUI's
.draggable()and.dropDestination()modifiers (macOS 13+) - Store custom order per category in UserDefaults (like Flutter's SharedPreferences)
- Add
categoryOrder: [TaskCategory: [String]]to TasksViewModel - Visual feedback: opacity reduction on dragged item, highlight on drop target
Files to modify:
TasksPage.swift- Add drag/drop to TaskRow and TaskCategorySectionTasksViewModel- Add order persistence and reorder methods
Reason: Swipe gestures are designed for touchscreens. On macOS, hover-to-reveal delete button already exists and works better with mouse/trackpad.
Goal: Visual hierarchy with 0-3 indent levels
Implementation:
- Add
@State var indentLevels: [String: Int]to TasksViewModel (task ID -> indent level) - Visual: 28pt indent per level + vertical line indicator
- Horizontal swipe on indented items to change indent level
- Store in UserDefaults for persistence
Files to modify:
TasksPage.swift- Add indent visual and gesture handlingTasksViewModel- Add indent state management
- Phase 1: Drag-and-Drop (highest impact)
- Phase 2: Swipe-to-Delete
- Phase 3: Task Indentation
- No backend changes needed - all state stored locally like Flutter
- Must handle conflict with multi-select mode (disable drag in multi-select)
- Disable drag-drop when not sorting by Due Date (only makes sense for categorized view)
- Use spring animations for smooth UX