From 9e03a2b9b3aa565ff8649c48eb8744dedf3767d1 Mon Sep 17 00:00:00 2001 From: Gustavo Henrique Santos Souza de Miranda Date: Wed, 21 Jan 2026 04:19:37 -0300 Subject: [PATCH] chore: mark US-014 as complete and update progress log Co-Authored-By: Claude Opus 4.5 --- prd.json | 2 +- progress.txt | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/prd.json b/prd.json index 1fb8bed..4ad20bb 100644 --- a/prd.json +++ b/prd.json @@ -244,7 +244,7 @@ "Verify in browser using dev-browser skill" ], "priority": 14, - "passes": false, + "passes": true, "notes": "" }, { diff --git a/progress.txt b/progress.txt index 59bdbf9..c26ee8a 100644 --- a/progress.txt +++ b/progress.txt @@ -13,6 +13,8 @@ - Public auth routes: /login, /signup, /forgot-password, /reset-password - Protected routes: /dashboard, /editor/* (redirect to /login if unauthenticated) - Auth pages use 'use client' with useState, createClient() from lib/supabase/client.ts, and useRouter for redirects +- For lists with client-side updates (delete/add), use wrapper client component that receives initialData from server component +- Toast component in `src/components/Toast.tsx` for success/error notifications (auto-dismiss after 3s) --- @@ -204,3 +206,21 @@ - ESLint rule react-hooks/set-state-in-effect warns against synchronous setState in useEffect - Initialize state from searchParams directly in useState() instead of setting in useEffect --- + +## 2026-01-21 - US-014 +- What was implemented: Delete project functionality with confirmation dialog and toast +- Files changed: + - src/components/ProjectCard.tsx - new client component replacing Link, with delete button and confirmation dialog + - src/components/ProjectList.tsx - new wrapper component to manage project list state and toast notifications + - src/components/Toast.tsx - new reusable toast notification component + - src/app/dashboard/page.tsx - updated to use ProjectList instead of inline rendering +- **Learnings for future iterations:** + - To enable client-side state updates (like removing items), extract list rendering from server components into client components + - ProjectList accepts initialProjects from server and manages state locally for immediate UI updates + - Use onDelete callback pattern to propagate deletion events from child (ProjectCard) to parent (ProjectList) + - Delete button uses e.stopPropagation() to prevent card click navigation when clicking delete + - Confirmation dialogs should disable close/cancel while action is in progress (isDeleting check) + - Toast component uses useCallback for handlers and auto-dismiss with setTimeout + - Toast animations can use TailwindCSS animate-in utilities (fade-in, slide-in-from-bottom-4) + - Delete icon appears on hover using group-hover:opacity-100 with parent group class +---