feat: soft-delete sites with 7-day grace period #55

Merged
uz1mani merged 8 commits from staging into main 2026-03-18 10:26:59 +00:00
uz1mani commented 2026-03-18 10:24:10 +00:00 (Migrated from github.com)

Summary

  • New DeleteSiteModal component matching org delete modal pattern (portal, framer motion, two-stage confirmation)
  • Dashboard shows soft-deleted sites with restore/delete-now actions and countdown badge
  • Settings page replaces window.prompt() with modal
  • Plan limit messaging when soft-deleted sites occupy a slot

Changes

  • lib/api/sites.ts — added deleted_at to Site type, new API functions (restoreSite, permanentDeleteSite, listDeletedSites)
  • components/sites/DeleteSiteModal.tsx — new modal with soft-delete (type DELETE) and permanent-delete (type domain) modes
  • app/page.tsx — integrated modal, deleted sites section with restore/delete-now, limit messaging
  • app/sites/[id]/settings/page.tsx — replaced prompt() with DeleteSiteModal

Test plan

  • Delete site from dashboard — modal opens, type DELETE, site appears in "Scheduled for Deletion"
  • Delete site from settings page — same modal, redirects to dashboard
  • Restore soft-deleted site from dashboard
  • Permanently delete via "Delete Now" — requires typing domain
  • At plan limit with soft-deleted site — shows pending deletion message
## Summary - New `DeleteSiteModal` component matching org delete modal pattern (portal, framer motion, two-stage confirmation) - Dashboard shows soft-deleted sites with restore/delete-now actions and countdown badge - Settings page replaces `window.prompt()` with modal - Plan limit messaging when soft-deleted sites occupy a slot ## Changes - `lib/api/sites.ts` — added `deleted_at` to Site type, new API functions (restoreSite, permanentDeleteSite, listDeletedSites) - `components/sites/DeleteSiteModal.tsx` — new modal with soft-delete (type DELETE) and permanent-delete (type domain) modes - `app/page.tsx` — integrated modal, deleted sites section with restore/delete-now, limit messaging - `app/sites/[id]/settings/page.tsx` — replaced prompt() with DeleteSiteModal ## Test plan - [x] Delete site from dashboard — modal opens, type DELETE, site appears in "Scheduled for Deletion" - [x] Delete site from settings page — same modal, redirects to dashboard - [x] Restore soft-deleted site from dashboard - [x] Permanently delete via "Delete Now" — requires typing domain - [x] At plan limit with soft-deleted site — shows pending deletion message
Sign in to join this conversation.
No description provided.