Albert 90a5bf37be fix: Migrate chat to AI SDK 5.0 and fix form submission
Critical fixes to get chat functionality working:

1. **Migrate to AI SDK 5.0 API**:
   - Replace deprecated `handleSubmit`, `input`, `handleInputChange` from useChat
   - Use manual state management with `useState` for input
   - Use `sendMessage({ text })` instead of form submission
   - Update API route to use `toUIMessageStreamResponse()` instead of `toAIStreamResponse()`
   - Add `convertToModelMessages()` for proper message conversion
   - Update message rendering to use `parts` array instead of `content` string

2. **Fix Mantine hydration error**:
   - Change `forceColorScheme="dark"` to `defaultColorScheme="dark"` in layout
   - Add `suppressHydrationWarning` to html and body tags
   - This was preventing React from attaching event handlers to the form

3. **Preserve existing features**:
   - Keep input padding fix
   - Keep microphone recorder integration
   - Keep persona parameter in API route

The form now successfully submits and makes POST requests to /api/chat.
Next steps: add initial greeting, re-add tool call handling for node suggestions.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 04:07:17 +00:00
2025-11-08 12:44:39 +00:00
Description
No description provided
57 MiB