Skip to content

Prevent deletion of the personal project#74

Merged
bborn merged 1 commit intomainfrom
task/149-user-can-not-delete-the-personal-project
Jan 9, 2026
Merged

Prevent deletion of the personal project#74
bborn merged 1 commit intomainfrom
task/149-user-can-not-delete-the-personal-project

Conversation

@bborn
Copy link
Copy Markdown
Owner

@bborn bborn commented Jan 9, 2026

Summary

  • Added protection to prevent users from deleting the "personal" project
  • The personal project is the default project automatically created during database initialization
  • Attempting to delete it now shows a clear error message to the user

Changes

  • Database layer: Modified DeleteProject() in internal/db/tasks.go to check if the project name is "personal" and return an error if deletion is attempted
  • UI layer: Updated settings view in internal/ui/settings.go to properly handle and display deletion errors to users
  • Tests: Added comprehensive test TestDeletePersonalProject() in internal/db/tasks_test.go to verify the protection works correctly

Test plan

  • Run go test ./internal/db - all tests pass including new test
  • Run go build ./... - project builds successfully
  • Verify personal project cannot be deleted (returns error)
  • Verify other projects can still be deleted normally
  • Manual UI testing: Try to delete personal project in settings and verify error is displayed
  • Manual UI testing: Verify deletion of other projects still works

Additional Notes

This fix ensures the personal project, which serves as the default workspace for tasks, cannot be accidentally deleted by users. The protection is implemented at the database layer for maximum safety.

Fixes #149

🤖 Generated with Claude Code

Added protection to prevent users from deleting the "personal" project,
which is the default project for all tasks. The personal project is
automatically created during database initialization and should not
be deletable.

Changes:
- Modified DeleteProject to check if project name is "personal" and
  return an error if attempting to delete it
- Updated UI settings to handle the deletion error and display it to
  the user
- Added comprehensive test coverage for the deletion protection

Fixes: #149

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@bborn bborn merged commit 6a98c0a into main Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant