fix(app): keep task indent and order edits until saved
ST
2h ago+362+362+012345678901234567890123456789-46-46-01234567890123456789
Summary
Refs #5078. Fixes the "changes disappear" part only; parent links and moves are out of scope.
_flushIndentUpdatesand_flushSortUpdatescleared pending edits before the PATCH and ignored its result, so a failed save was lost.- Any list read that landed before the save replaced rows with server values and reverted the indent on screen.
- Pending indent/sort edits now stay pending until the server acknowledges that exact value. List, load-more, Home and saved-task reads overlay them, and a failed write is retried on the next edit or successful list read.
- One layout write is in flight at a time, so an older value cannot land after a newer one, and a stale acknowledgement cannot clear a newer edit.
- The layout write state now lives in
app/lib/providers/task_layout_writes.dart, soaction_items_provider.dartshrinks rather than growing past its line-count ratchet.
Implementation and verification were AI-assisted.
Verification
flutter test --no-pub test/providers/action_items_layout_persistence_test.dart: 3 new tests pass. All 3 fail againstorigin/mainwith only the request seam added.flutter test --no-pub test/providers/action_item*_test.dart test/providers/deletion_consistency_test.dart test/providers/siri_authoritative_fetch_test.dart test/perf/scroll_task_cache_test.dart: 93 passed.flutter analyzeon the changed provider and test: only the existingmaterial.dartdeprecation info.- No device run.
UI-Evidence: none -- provider persistence fix; no layout change.
Product invariants affected
none
Failure-Class: none