Skip to content

Task Archiving: soft-delete completed tasks after N days #22

@TheSethRose

Description

@TheSethRose

Summary

Introduce soft archiving for completed tasks so older items are hidden without permanent deletion.

Current behavior

  • Task removal is permanent via the delete flow in src/app/(dashboard)/tasks/TaskModal.tsx and src/app/api/tasks/route.ts.
  • Status options in src/lib/task-statuses.ts do not include an archived state.
  • docs/DATABASE.md has no archive metadata column.

Target behavior

  • Add archive metadata (e.g., archived_at or a dedicated archived status).
  • Exclude archived items from default task queries with a toggle to include them.
  • Automatically archive completed tasks after a configurable retention window.
  • Allow restore back to active status without data loss.

Scope

  • DB migration for archive metadata.
  • API changes to filter by archive state and restore on demand.
  • UI filter and restore actions in tasks views.
  • Worker/cron job to archive by retention policy.

Acceptance criteria

  • Completed tasks enter archive state after the configured retention window.
  • Archived tasks are hidden by default but visible via a filter.
  • Restore action returns a task to its prior status and preserves notes.

Open questions

  • Preferred default retention window (e.g., 14/30/60 days)?
  • Archive as status vs. archived timestamp?

References

  • docs/DATABASE.md
  • src/lib/task-statuses.ts
  • src/app/api/tasks/route.ts
  • src/app/(dashboard)/tasks/TaskModal.tsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions