소스 검색

fix: Playground sendMessage onSuccess now renders bot reply

The sendMessage mutation's onSuccess only called setIsTyping(false),
silently discarding Ellie's reply. Now adds the bot message to the
chat list and updates the Execution Path with the response source
(flow/knowledge/llm).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Tony T 5 일 전
부모
커밋
154d2b569a
1개의 변경된 파일14개의 추가작업 그리고 1개의 파일을 삭제
  1. 14 1
      client/src/pages/Playground.tsx

+ 14 - 1
client/src/pages/Playground.tsx

@@ -61,7 +61,20 @@ export default function Playground() {
   );
 
   const sendMessage = trpc.chat.sendMessage.useMutation({
-    onSuccess: () => setIsTyping(false),
+    onSuccess: (data) => {
+      setIsTyping(false);
+      if (data.reply) {
+        setFlowPath(prev => [...prev, data.source ?? data.status ?? "reply"]);
+        setMessages(prev => [...prev, {
+          id: Date.now(),
+          sender: "bot",
+          content: data.reply as string,
+          timestamp: new Date().toISOString(),
+          flowStep: data.source === "flow" ? "Flow: matched" : data.source === "knowledge" ? "KB: matched" : `LLM: ${data.status}`,
+        }]);
+        setShowGreeting(false);
+      }
+    },
     onError: () => setIsTyping(false),
   });