SkateSpots/FIXES_BREAKDOWN.md
shakespeare.diy 27e14994b5 Import files from skate-spots project
Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-06-15 20:04:15 +07:00

197 lines
4.8 KiB
Markdown

# 🔧 Remaining Fixes - Breakdown & Budget
**Date**: December 30, 2025
**Available Budget**: $9 USD
---
## 🐛 ISSUES TO FIX
### Issue 1: Signup Key Generation Error ⚠️ CRITICAL
**Error**: "hex string expected, got object"
**Location**: SignupDialog npub generation
**Root Cause**:
- Line 514: `nip19.decode(nsec).data` returns Uint8Array
- `nip19.npubEncode()` expects Uint8Array but getting wrapped object
- Type mismatch in the decode flow
**Fix Options**:
**Option A - Simple Fix** (5 min, FREE):
```typescript
// Instead of trying to show npub in real-time, just show nsec
// Remove the npub display entirely or compute it differently
```
**Option B - Proper Fix** (15 min, $1):
```typescript
// Properly extract and encode the public key
const { type, data } = nip19.decode(nsec);
if (type === 'nsec') {
const sk = data;
const pk = getPublicKey(sk); // need to import from nostr-tools
const npub = nip19.npubEncode(pk);
}
```
**Recommended**: Option B (proper fix)
---
### Issue 2: Login Notice on Coaches Page
**Location**: CoachesPage - "Become a Coach" button area
**Fix**: Add login badge when user not logged in
**Effort**: 3 minutes
**Budget**: FREE (trivial)
---
### Issue 3: Profile Save Error ⚠️ CRITICAL
**Error**: "Failed to upload profile please try again"
**Location**: EditProfileForm - all fields not saving
**Possible Root Causes**:
1. Missing user.signer in publish flow
2. Validation error with NSchema
3. Event publishing to relays failing
4. Missing required fields in kind 0 event
**Investigation Needed**:
- Check console for actual error
- Test if other fields save (name, about, picture)
- Check if it's NIP-05 specific or all fields
**Fix Effort**: 20-30 min, $2
**Steps**:
1. Debug actual error in EditProfileForm
2. Check if signer is available
3. Validate metadata schema
4. Add better error messages
5. Test each field individually
---
### Issue 4: FAQ Section
**Location**: New page - `/faq`
**Content Needed**: Common questions about Nostr, spots, events, zaps, etc.
**Fix Options**:
**Option A - Simple FAQ** (30 min, $2):
- Single page with 10-15 Q&As
- Accordion UI with shadcn/ui
- Basic questions answered
**Option B - Comprehensive FAQ** (1-1.5 hours, $5-8):
- Multiple categories (Nostr, Features, Zaps, Safety)
- 20-30 Q&As
- Search functionality
- Links to onboarding
**Recommended**: Option A (simple but complete)
---
## 💰 BUDGET ALLOCATION OPTIONS
### **Option 1: Critical Fixes Only** ($3 total)
1. ✅ Fix signup error (proper solution) - $1
2. ✅ Fix profile save error - $2
3. ✅ Add login notice to coaches - FREE
**Leaves**: $6 for future updates
**Time**: 45 min
---
### **Option 2: Fixes + Simple FAQ** ($5 total)
1. ✅ Fix signup error - $1
2. ✅ Fix profile save error - $2
3. ✅ Add login notice - FREE
4. ✅ Simple FAQ page (10-15 Q&As) - $2
**Leaves**: $4 for future updates
**Time**: 1.5 hours
---
### **Option 3: Everything** ($9 total)
1. ✅ Fix signup error (proper) - $1
2. ✅ Fix profile save error - $2
3. ✅ Add login notice - FREE
4. ✅ Comprehensive FAQ (20-30 Q&As with search) - $6
**Leaves**: $0
**Time**: 2-2.5 hours
---
## 🎯 MY RECOMMENDATION
**Go with Option 2** ($5 total, saves $4):
**Why?**
- ✅ Fixes all critical bugs
- ✅ Adds helpful FAQ for users
- ✅ Leaves budget for future needs
- ✅ Gets app fully functional
**What you get**:
1. Signup working perfectly
2. Profile editing working (NIP-05 saves)
3. FAQ with essential questions
4. $4 left over for future features
---
## 📋 IMPLEMENTATION STEPS (Option 2)
### Step 1: Fix Signup Error (15 min)
1. Import `getPublicKey` from nostr-tools
2. Properly decode nsec to get secret key bytes
3. Derive public key from secret key
4. Encode to npub
5. Test full signup flow
### Step 2: Fix Profile Save Error (30 min)
1. Check console error in EditProfileForm
2. Debug why kind 0 event fails
3. Fix validation or signer issue
4. Add better error feedback
5. Test saving all fields (name, about, nip05, etc)
### Step 3: Add Coach Login Notice (3 min)
1. Check if user logged in on CoachesPage
2. Show "🔒 Login to become coach" badge
3. Style with yellow neon
### Step 4: Create Simple FAQ (30 min)
1. Create FAQPage.tsx
2. Add 10-15 common questions:
- What is Nostr?
- How do I add a spot?
- What are zaps?
- Is this free?
- How do I get NIP-05?
- Can spots be deleted?
- etc.
3. Use Accordion component
4. Add route to AppRouter
5. Link from footer/about
**Total Time**: ~1.5 hours
**Total Cost**: $5
**Remaining Budget**: $4
---
## ❓ WHAT WOULD YOU LIKE ME TO DO?
**A)** Option 1 - Critical fixes only ($3, save $6)
**B)** Option 2 - Fixes + Simple FAQ ($5, save $4) ⭐ **RECOMMENDED**
**C)** Option 3 - Everything ($9, no savings)
**D)** Something custom - tell me what to prioritize
Which option would you like me to implement?