fix(panel): keep a pending task status apart from its pin, and undo only what is still done

Merged
DA
4d ago
+123-34

Follow-up to #4416. Devin's review found three races in Mark done after it had already merged, and this PR fixes them.

  • A refused pin stayed drawn after Mark done. The status was stored inside the same pending mark as the pin, so when Mark done replaced that mark, the pin's refusal could no longer find it to take back. Pending statuses now live in their own map (PendingStatuses, statusedView, unsettledStatuses in tasks-model.ts). A status and a pin now land or get refused separately.
  • A newer status was hidden under a pending Done. If a status picked on the Board or the task's chip overtook Mark done, the pending Done was drawn over it. onSetTaskStanding now drops any pending status for that task, so the newer choice shows.
  • Undo overwrote a newer choice. Undo now restores only the tasks that still stand at the status it undoes (undoStillDue). A task moved to another status since then keeps that status.

Tests in tasks-model.test.ts: Undo skips a task moved since, and a pending status draws and lets go without touching a pin pending beside it.

Discussion: https://github.com/ReviewStage/luke/pull/4416#pullrequestreview-5605808672

Made with Luke


Devin Review