[Redesign] Frontend - Conversation-based Chat UI #60
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Detailed Implementation Guide for Frontend Chat UI
⚠️ Prerequisite
This issue assumes issue #59 (Backend Chat System) is COMPLETED.
The frontend will consume the API endpoints created in #59:
GET /api/conversations- List conversationsPOST /api/conversations- Create conversationGET /api/conversations/{id}- Get conversation with messagesPOST /api/conversations/{id}/chat- Send messagePOST /api/conversations/{id}/set-bot- Link bot to conversationSummary
Redesign frontend to support conversation-based chat interface with left/right panes.
Current State (Before)
Target State (After)
Implementation Phases
Phase 1: Routing & Layout
1.1 Route Structure
Update
src/frontend/src/App.tsxor router config:1.2 Main Layout Component
Create
src/frontend/src/components/ChatLayout.tsx:Check: Routes work, layout renders with conditional panes
Phase 2: API Services
2.1 Conversation API Client
Create
src/frontend/src/services/conversation.ts:2.2 Auth Context
Create or update
src/frontend/src/contexts/AuthContext.tsx:Check: API calls work, auth state persists
Phase 3: Components
3.1 Conversation List (Left Pane)
Create
src/frontend/src/components/ConversationList.tsx:3.2 Chat Area (Main)
Create or update
src/frontend/src/components/ChatArea.tsx:3.3 Bot Info Panel (Right Pane)
Create
src/frontend/src/components/BotInfoPanel.tsx:3.4 Non-logged User Banner
Create
src/frontend/src/components/AnonymousBanner.tsx:3.5 Loading Animation (Custom)
Create
src/frontend/src/components/CandlestickLoader.tsx:Phase 4: Page Components
4.1 Home Page (Conversation List)
Create
src/frontend/src/pages/HomePage.tsx:4.2 Chat Page
Create
src/frontend/src/pages/ChatPage.tsx:Phase 5: Integration & Edge Cases
5.1 Handle Rate Limiting
5.2 Handle Non-logged User Actions
When user tries to:
What to Check / Verify
Routing
/loads landing/homeshows list/chat/{id}loadsComponents
Anonymous User
Loading States
How to Test
Unit Tests
Integration Tests
How to Debug
If Conversations Not Loading
If Messages Not Showing
If Bot Panel Not Updating
Files to Create/Modify
App.tsx(routes)services/conversation.tsservices/bot.tscontexts/AuthContext.tsxcomponents/ChatLayout.tsxcomponents/ConversationList.tsxcomponents/ChatArea.tsxcomponents/ChatInput.tsxcomponents/BotInfoPanel.tsxcomponents/AnonymousBanner.tsxcomponents/CandlestickLoader.tsxpages/HomePage.tsxpages/ChatPage.tsxDependencies
Priority: HIGH
Acceptance Criteria
Routing
/shows landing page/homeshows conversation list/chat/{id}loads specific conversationLeft Pane
Main Chat Area
Right Pane
Non-logged Users
Rate Limiting
Polish
Notes for Developer