feat: wire chat UI to backend APIs

- Created API clients for LLM chat (/api/llm/chat) and Ideas (/api/ideas)
- Implemented useChat hook for conversation state management
- Connected Chat component to backend with full CRUD operations
- Integrated ConversationSidebar with conversation fetching
- Added automatic conversation persistence after each message
- Integrated WebSocket for connection status
- Used existing better-auth for authentication
- All TypeScript strict mode compliant (no any types)

Deliverables:
 Working chat interface at /chat route
 Conversations save to database via Ideas API
 Real-time WebSocket connection
 Clean TypeScript (no errors)
 Full conversation loading and persistence

See CHAT_INTEGRATION_SUMMARY.md for detailed documentation.
This commit is contained in:
Jason Woltje
2026-01-29 23:26:27 -06:00
parent 59aec28d5c
commit 08938dc735
10 changed files with 1126 additions and 257 deletions

View File

@@ -26,10 +26,11 @@ export default function ChatPage() {
// NOTE: Update sidebar when conversation changes (see issue #TBD)
};
const handleSelectConversation = (conversationId: string | null) => {
// NOTE: Load conversation from backend (see issue #TBD)
void conversationId; // Placeholder until implemented
setCurrentConversationId(conversationId);
const handleSelectConversation = async (conversationId: string | null) => {
if (conversationId) {
await chatRef.current?.loadConversation(conversationId);
setCurrentConversationId(conversationId);
}
};
const handleNewConversation = (projectId?: string | null) => {