feat: add project reset with confirmation to general settings by lunenas · Pull Request #135 · ycode/ycode

@lunenas

Summary

Add a working "Reset project" button in the general settings danger zone that resets the database via the existing devtools API, with a confirmation dialog to prevent accidental data loss.

Changes

  • Wire up the "Reset project" button to open a confirmation dialog
  • Add confirmation dialog warning that the action is permanent and cannot be undone
  • Call POST /ycode/api/devtools/reset-db on confirm, with loading state and error handling via toast
  • Redirect to /ycode on successful reset

Test plan

  • Navigate to Settings → General → Website tab, scroll to "Danger zone"
  • Click "Reset project" — confirmation dialog should appear
  • Click "Cancel" — dialog should close, nothing happens
  • Click "Reset project" in dialog — should show spinner, reset the database, and redirect to /ycode
  • Verify error toast appears if the API call fails (e.g. network error)

Made with Cursor

@lunenas

Wire up the "Reset project" button in the danger zone section to call
the existing reset-db API endpoint, gated behind a confirmation dialog
that warns the action cannot be undone.

Made-with: Cursor

@liamwalder