feat(frontend): rebuild chatbot UI to match backend — wider panel, guild context, Indonesian
- Chatbot bubble: 220px → 320px wide, 440px tall; proper header with
drag handle; quick-prompt row when chat is closed
- ChatPanel: show ALL history (not last 8), Indonesian placeholder/empty
state/error copy (backend speaks Indonesian), timestamps (id-ID),
clear-history button, typing indicator bubbles, Enter-to-send
- Send active guildId as context so backend answers reference the real
server (serverInsights path in chatbot.service)
- GuildId sync from layout → ChatbotProvider via ChatbotGuildSync
- chatbotApi.send(message, guildId) → POST /api/chat {message, context}
matching BE zod schema (guildId optional)
This commit is contained in:
@@ -2,8 +2,11 @@ import type { ChatbotHistoryRow, ChatbotResponse } from "@/lib/types";
|
||||
import { api } from "./client";
|
||||
|
||||
export const chatbotApi = {
|
||||
send: (message: string) =>
|
||||
api.post<ChatbotResponse>("/api/chat", { message }),
|
||||
send: (message: string, guildId?: string) =>
|
||||
api.post<ChatbotResponse>("/api/chat", {
|
||||
message,
|
||||
context: guildId ? { guildId } : undefined,
|
||||
}),
|
||||
|
||||
getHistory: () =>
|
||||
api.get<{ history: ChatbotHistoryRow[]; total: number }>(
|
||||
|
||||
Reference in New Issue
Block a user