hoangsonww / hoangsonww/Task-Manager-ReactNative
Feature: Add task history, undo, trash, and point-in-time restoration
- Dominant language
- TypeScript
- Stars
- 32
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
## Summary
Introduce a durable history model that lets users understand changes, undo recent actions, recover deleted tasks, and restore earlier task versions.
## Problem / Opportunity
Task mutations currently update or delete the active record and then propagate through realtime subscriptions. A mistaken edit, completion, reorder, or deletion can be difficult or impossible to reconstruct, especially when multiple clients are connected.
## Proposed Feature
Record meaningful task mutations as immutable revisions or events. Add short-lived undo for immediate actions, a trash/recovery flow for deletions, and a task history view that can restore a selected version while preserving a new audit entry.
## Scope
- Design revision/event and soft-deletion schema with user-scoped RLS and retention rules.
- Capture create, edit, complete/reopen, reorder, and delete/restore operations with timestamps and actor context.
- Add undo feedback for supported single actions and clearly define batch/concurrent behavior.
- Add Trash and per-task history UI with comparison and restore confirmation.
- Reconcile restores with realtime clients and newer versions.
- Document retention, privacy, storage, and restore semantics.
## Acceptance Criteria
- [ ] Supported task mutations create immutable history entries with actor, time, action, and sufficient before/after data.
- [ ] A recent edit, completion toggle, reorder, or deletion can be undone from visible feedback within a documented window.
- [ ] Deleted tasks move to user-scoped Trash and can be restored or permanently deleted.
- [ ] Restoring an older version creates a new current version and does not erase intervening history.
- [ ] RLS prevents access to another user's history and trash records.
- [ ] Concurrent edits or restores surface a deterministic conflict result rather than silently overwriting newer state.
- [ ] Realtime clients converge on the restored/current task state.
- [ ] History and Trash support keyboard, screen-reader, large-text, empty, loading, and error states.
- [ ] Retention cleanup is tested and cannot remove active tasks.
- [ ] Documentation explains captured events, retention, undo limits, and permanent deletion.
## Non-Goals
- Full database point-in-time recovery for administrators.
- Editing or deleting audit records.
- Collaborative workspace audit policy before shared workspaces exist.
## Dependencies / Risks
- History increases database volume and may expose sensitive old task text longer than expected.
- Reorder events can be noisy and need a compact representation.
- Correct conflict handling depends on versioning or optimistic concurrency controls.
## Open Questions
- What trash/history retention period should be the default?
- Which operations are eligible for immediate undo?
- Should users be able to disable long-term history while retaining Trash?
Contributor guide
Assessment
This issue has not been assessed yet.