ralph/collaboration-and-character-variables #5

Closed
GHMiranda wants to merge 30 commits from ralph/collaboration-and-character-variables into developing
2 changed files with 16 additions and 1 deletions
Showing only changes of commit 59cda43987 - Show all commits

View File

@ -603,7 +603,7 @@
"Verify in browser using dev-browser skill"
],
"priority": 34,
"passes": false,
"passes": true,
"notes": ""
},
{

View File

@ -491,3 +491,18 @@
- clearDraft is exported for use in save functionality (US-034) to clear draft after successful database save
- JSON.stringify comparison works for flowchart data equality check
---
## 2026-01-22 - US-034
- What was implemented: Save project to database functionality
- Files changed:
- src/app/editor/[projectId]/FlowchartEditor.tsx - implemented handleSave with Supabase update, added isSaving state and Toast notifications
- src/components/editor/Toolbar.tsx - added isSaving prop with loading spinner indicator
- **Learnings for future iterations:**
- Use createClient() from lib/supabase/client.ts for browser-side database operations
- Supabase update returns { error } object for error handling
- Use async/await with try/catch for async save operations
- Set updated_at manually with new Date().toISOString() for Supabase JSONB updates
- Clear LocalStorage draft after successful save to avoid stale drafts
- Toast state uses object with message and type for flexibility
- Loading spinner SVG with animate-spin class for visual feedback during save
---