Create the floating AI chat popup rendered via portal to document.body.
Uses useAIChat for chat logic, useFloatingChat for position/state,
Framer Motion for enter/exit animations, and pointer-event dragging.
Includes: close on Escape, close on route change, auto-scroll,
auto-focus, window resize clamping, and compact message rendering.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Refactor AIChatPanel to consume the existing useAIChat hook instead of
managing chat state inline. Removes duplicate ChatMessage interface,
inline state (messages, input, isStreaming, streamingContent), and the
65-line handleSend callback, replacing them with a single useAIChat()
call and a thin briefLoading guard wrapper.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Implemented useAIChat hook to handle chat messages, input state, and streaming responses.
- Added types for ChatMessage and ChatContext to ensure type safety.
- Integrated TRPC mutation for sending messages and handling responses.
- Included functionality for clearing messages and managing streaming content.