Dev#26
Conversation
… update CustomerDashboard for better chat widget dimensions; add API route for chat request proxying
Chat improve
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. WalkthroughA new API route proxies POST requests to an Agent_Bot service with authorization support. AIChatWidget.tsx receives a comprehensive overhaul introducing cookie-based authentication, user sender type support, theme constants, redesigned message bubbles, and a "Thinking" indicator. The chat widget container sizing is adjusted to explicit pixel dimensions. lucide-react dependency is added. Changes
Sequence DiagramsequenceDiagram
participant User
participant Browser as Browser<br/>(AIChatWidget)
participant API as Next.js API<br/>(route.ts)
participant Agent as Agent_Bot<br/>Service
User->>Browser: Loads page
Browser->>Browser: Retrieve tt_access_token from cookies
alt Token Present
Browser->>Browser: Enable input & send button
else No Token
Browser->>Browser: Disable input, show login warning
end
User->>Browser: Sends message
Browser->>Browser: Add user message to conversation
Browser->>Browser: Display "Thinking..." indicator
Browser->>API: POST /api/v1/ai/chat<br/>(with Authorization header + token)
API->>Agent: Forward request to AGENT_BOT_URL
alt Success (200)
Agent-->>API: Response with reply & tool_executed
API-->>Browser: Return JSON response
Browser->>Browser: Display AI message<br/>+ optional tool usage note
Browser->>Browser: Auto-scroll to latest
else Unauthorized (401)
Agent-->>API: 401 response
API-->>Browser: Return error
Browser->>Browser: Display session-expired message
else Error (4xx/5xx)
Agent-->>API: Error response
API-->>Browser: Return 500 with detail
Browser->>Browser: Display connectivity issue
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit
New Features
Bug Fixes
Style