Add soft delete and trash functionality for tasks#4
Open
rightson wants to merge 1 commit into
Open
Conversation
Instead of permanently deleting tasks, they are now soft-deleted by setting a deletedAt timestamp. Deleted tasks are hidden from the canvas and can be viewed in a trash panel accessible from the toolbar. Users can restore tasks back to the canvas or permanently delete them. Changes: - Add deletedAt column to tasks schema and migration - Convert DELETE endpoint to soft-delete (sets deletedAt) - Add trash list, restore, and permanent delete API endpoints - Filter soft-deleted tasks from project task queries - Add TrashView component with restore and permanent delete actions - Add trash button to project toolbar - Update task store with trash state management https://claude.ai/code/session_01QPG5sRrFdNju5qivq3uWwK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implement a soft delete system for tasks with a dedicated trash view, allowing users to recover deleted tasks before permanent deletion.
Key Changes
Backend (Server)
DELETE /tasks/:idto perform soft delete by settingdeletedAttimestamp instead of removing the recordPOST /tasks/:id/restoreendpoint to restore trashed tasks by clearing thedeletedAtfieldDELETE /tasks/:id/permanentendpoint for permanent deletion from trashGET /tasks/project/:projectId/trashendpoint to fetch all trashed tasks for a projectGET /tasks/project/:projectIdto exclude soft-deleted tasks (wheredeletedAtis null)deletedAtcolumn to tasks table schema and migrationFrontend (Client)
TrashViewcomponent displaying trashed tasks with restore and permanent delete actionsTaskCardinterface to include optionaldeletedAtfielduseTaskStorewith:trashedTasksstate to track deleted tasksfetchTrashedTasks()to load trashed tasks for current projectrestoreTask()to recover a task from trashpermanentDeleteTask()to permanently remove a taskProjectSelectorcomponent that opens the trash viewApp.tsxto manage trash view visibility stateTaskModalfrom "Delete this task?" to "Move this task to trash?"Implementation Details
deletedAtcolumndeletedAthttps://claude.ai/code/session_01QPG5sRrFdNju5qivq3uWwK