sandbox-notebookllamalm-nextjs/Old Readmes/FIX-PLAN.md
DJP 7e1eb60a4a Fix critical bugs and improve features
- Add getSynthesis API endpoint (fixes console error)
- Fix message count display in chat sessions (SQL JOIN)
- Smart notebook deletion with share confirmation
- Auto-trigger synthesis when documents complete
- Regenerate synthesis on document add/delete
- Auto-retry pending background tasks on startup
- Backend session deduplication (10-second window)
- Disable React Query mutation retries
- Disable React Strict Mode
- Clean up old documentation files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 15:27:32 -04:00

2.3 KiB

🔧 CRITICAL FIXES NEEDED

Issues Identified:

1. NO AUTHENTICATION

  • Current: Can access all pages without login
  • Expected: Must login first (like Streamlit app)
  • Fix: Add auth middleware, protect all routes

2. WRONG MODEL NAMES

Current models in Next.js:

openai, gpt4o, claude, gemini, groq, deepseek

Correct models from working app:

gpt5-exp: '🚀 GPT-5'
claude45-exp: '🧠 Claude Sonnet 4.5'
gemini25-exp: '💎 Gemini 2.5 Pro'
gpt4o: '⚡ GPT-4o'
gemini: '✨ Gemini 2.0 Flash'
gpt4: '🤖 GPT-4'

3. NO FILE UPLOAD IN NOTEBOOK DETAIL

  • Current: Upload button but wrong implementation
  • Expected: Multi-file upload in notebook creation AND in detail page
  • Streamlit shows: Can upload 1-20 files at once

4. NOT CONNECTED TO BACKEND

  • Pages make API calls but don't test/verify
  • Need to test actual data flow
  • No error handling for failed API calls

5. MISSING FEATURES FROM STREAMLIT

  • Pricing info for each model
  • Document processing status with real-time updates
  • Proper empty states
  • Task tracking UI

Fix Strategy:

Phase 1: Authentication (30 min)

  1. Create auth store with Zustand
  2. Add protected route wrapper
  3. Redirect to login if not authenticated
  4. Store JWT/session in localStorage
  5. Test login/logout flow

Phase 2: Fix Models (15 min)

  1. Update model list to match Streamlit exactly
  2. Add pricing info
  3. Update API to use correct model names

Phase 3: File Upload (45 min)

  1. Add multi-file upload to notebook creation
  2. Add file upload section to notebook detail
  3. Show upload progress
  4. Display processing status
  5. Poll for task completion

Phase 4: Backend Connection Testing (60 min)

  1. Test notebook creation
  2. Test document upload
  3. Test background processing
  4. Test chat WebSocket
  5. Add proper error handling

Phase 5: UI Polish (30 min)

  1. Add loading states
  2. Add error messages
  3. Add success notifications
  4. Fix empty states

Total Estimated Time: 3 hours

Testing Checklist:

  • Can login with real credentials
  • Redirected to login when not authenticated
  • Can create notebook with correct model
  • Can upload multiple files
  • Files show processing status
  • Can chat after documents processed
  • WebSocket chat works
  • Can see chat history
  • Admin dashboard shows real data
  • Can logout and re-login