Commit Graph

11 Commits

Author SHA1 Message Date
andupetcu
24c0577f44 Fix chat history authentication and conversation saving
- Fix critical async/await bug in chat API token verification
- Add comprehensive authentication debugging logs
- Fix conversations API Zod schema validation for query parameters
- Remove problematic CircularProgress import causing build warnings
- Improve error handling and user feedback in chat component

The main issue was that verifyToken() was called without await, causing
the chat API to receive a Promise object instead of the user payload,
resulting in undefined userId and failed conversation persistence.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-22 12:47:59 +03:00
andupetcu
6295c15755 Fix AI chat conversation errors and history loading issues
- Fix CircularProgress import from correct MUI package
- Fix conversationId validation by omitting null values instead of sending them
- Fix conversations API Zod schema default values (string vs number mismatch)
- Remove debug logging from chat error handling
- AI chat conversations now work properly with authentication
- Chat history loading no longer fails with validation errors

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-22 12:20:35 +03:00
andupetcu
382fb93de2 Complete Phase 3: Add conversation management capabilities to AI chat
- Add conversation delete functionality with confirmation dialog
- Add conversation rename functionality with input modal
- Implement three-dot menu for each conversation item
- Add proper authentication token key consistency
- Fix JSX structure issues in floating chat component
- Integrate full CRUD operations with conversation API

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-22 12:05:03 +03:00
andupetcu
86b7ff377b Implement AI chat history system with enhanced memory (Phases 1 & 2)
Phase 1 - Database Schema & Basic API:
- Add ChatConversation and ChatMessage tables with proper relationships
- Create conversation CRUD API endpoints with authentication
- Update chat API to support persistent conversations
- Implement auto-generated conversation titles and language separation
- Add conversation soft delete and user-specific access control

Phase 2 - Enhanced Memory System:
- Implement intelligent context selection beyond simple chronological order
- Add relevance scoring for older messages based on keyword overlap and biblical references
- Create automatic message summarization for very long conversations
- Optimize token usage with smart context management (1500 token budget)
- Add biblical awareness with Romanian/English book name detection
- Implement time-based relevance decay for better context prioritization

Frontend Improvements:
- Add chat history button to floating chat header
- Create basic history panel UI with placeholder content
- Maintain backward compatibility for anonymous users

Database Changes:
- Enhanced schema with conversation relationships and message roles
- Proper indexing for performance and user-specific queries
- Migration completed successfully with prisma db push

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-22 11:33:36 +03:00
andupetcu
73a8b44f76 Fix Discuss this verse functionality and update live counter to static text
- Replace dynamic live counter with static "thousands of believers" text in both languages
- Fix Discuss this verse feature with proper timing and quote escaping
- Add setTimeout delay to ensure chat input is set after component renders
- Remove unescaped quotes from English daily verse text
- Merge duplicate hero translation objects in both language files
- Clean up debug console.log statements

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-22 10:57:45 +03:00
andupetcu
e2c7e21967 Implement comprehensive homepage enhancements and floating chat improvements
- Add dynamic date and year generation replacing static 2024 values
- Implement "Discuss this verse" feature with AI chat integration
- Fix translation key conflicts by merging duplicate hero objects
- Update Romanian translations with improved messaging
- Enhance floating chat to support initial messages via events
- Fix FORMATTING_ERROR for liveCounter with proper next-intl syntax

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-22 10:39:07 +03:00
andupetcu
30e5c8d931 Fix keyboard shortcuts conflict between bible reader and AI chat
- Added data-floating-chat attribute to chat component for easy detection
- Updated bible reader keyboard event handler to check if chat is open
- Prevent shortcuts from triggering when user is typing in input fields
- Check for dialogs, modals, and the floating chat before processing shortcuts
2025-09-22 09:21:56 +03:00
andupetcu
8b26d72c1c Remove standalone /[locale]/chat page; enhance FloatingChat with fullscreen toggle via Launch icon; add global event to open chat (optionally fullscreen); wire home buttons/cards to open modal instead of routing. 2025-09-20 19:03:40 +03:00
andupetcu
51248b24f7 Update color palette and improve UI aesthetics
- Apply new teal-based color palette (#009688, #00796B, #B2DFDB)
- Update secondary color to accent yellow (#FFC107)
- Replace Material-UI loading states with proper animations and skeletons
- Remove ugly gradient background, replace with clean white
- Update all gradients to use new color scheme
- Improve text colors for better readability (#212121, #757575)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-20 16:04:02 +03:00
andupetcu
a0969e88df Implement complete multi-language support with Romanian/English
- Added next-intl for internationalization with Romanian as default locale
- Restructured app directory with [locale] routing (/ro, /en)
- Created comprehensive translation files for both languages
- Fixed Next.js 15 async params compatibility in layout components
- Updated all components to use proper i18n hooks and translations
- Configured middleware for locale routing and fallbacks
- Fixed FloatingChat component translation array handling
- Restored complete home page with internationalized content
- Fixed Material-UI Slide component prop error (mountOnExit → unmountOnExit)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-20 15:43:51 +03:00
andupetcu
dd5e1102eb Implement Azure OpenAI vector embeddings for Romanian Bible
- Add pgvector support with bible_passages table for vector search
- Create Python ingestion script for Azure OpenAI embed-3 embeddings
- Implement hybrid search combining vector similarity and full-text search
- Update AI chat to use vector search with Azure OpenAI gpt-4o
- Add floating chat component with Material UI design
- Import complete Romanian Bible (FIDELA) with 30K+ verses
- Add vector search library for semantic Bible search
- Create multi-language implementation plan for future expansion

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-20 15:18:00 +03:00