From eb6daad1e140443b588d28b97c9b08ccdf4e645a Mon Sep 17 00:00:00 2001 From: zhixian Date: Tue, 17 Feb 2026 01:44:23 +0900 Subject: [PATCH] feat: migrate Chat to shadcn ScrollArea/Select/Input/Button Co-Authored-By: Claude Opus 4.6 --- src/components/Chat.tsx | 82 ++++++++++++++++++++++++----------------- 1 file changed, 48 insertions(+), 34 deletions(-) diff --git a/src/components/Chat.tsx b/src/components/Chat.tsx index b73ba3d..960f903 100644 --- a/src/components/Chat.tsx +++ b/src/components/Chat.tsx @@ -1,5 +1,16 @@ import { useCallback, useEffect, useRef, useState } from "react"; import { api } from "../lib/api"; +import { ScrollArea } from "@/components/ui/scroll-area"; +import { + Select, + SelectTrigger, + SelectValue, + SelectContent, + SelectItem, +} from "@/components/ui/select"; +import { Input } from "@/components/ui/input"; +import { Button } from "@/components/ui/button"; +import { cn } from "@/lib/utils"; interface Message { role: "user" | "assistant"; @@ -76,54 +87,57 @@ export function Chat() { }, [input, loading, agentId, sessionId]); return ( -
-
-

Chat

- - +
-
+ {messages.map((msg, i) => ( -
-
-
{msg.content}
+
+
+
{msg.content}
))} - {loading &&
Thinking...
} + {loading &&
Thinking...
}
-
-
- +
+ setInput(e.target.value)} onKeyDown={(e) => { if (e.key === "Enter" && !e.shiftKey) { e.preventDefault(); send(); } }} placeholder="Ask your OpenClaw agent..." - style={{ flex: 1 }} + className="flex-1 bg-panel border-border-subtle text-text-main" /> - +
);