Extract the 535-line useChat hook into 7 focused modules for better maintainability and testability. Add chat-preview-slice to Zustand store to centralize chat state management instead of local useState/useRef.