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:
asepharyana
2026-08-03 06:04:25 +07:00
parent 03d59f0738
commit 2b815e156c
5 changed files with 152 additions and 86 deletions
+5 -2
View File
@@ -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 }>(