From 26b46c733d52f9d7419fd8be9c4c6e1a31c122e7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 1 Mar 2026 00:17:57 +0000 Subject: [PATCH] sync(ui): update UI --- ui/src/components/ThemeToggle.tsx | 11 ++++-- ui/src/components/chat/ChatView.tsx | 4 ++ ui/src/components/chat/SettingsPanel.tsx | 12 ++++-- ui/src/components/chat/ThinkingIndicator.tsx | 12 ++++++ ui/tailwind.config.ts | 40 +++++++++----------- 5 files changed, 50 insertions(+), 29 deletions(-) create mode 100644 ui/src/components/chat/ThinkingIndicator.tsx diff --git a/ui/src/components/ThemeToggle.tsx b/ui/src/components/ThemeToggle.tsx index 26998bc..1ea1222 100644 --- a/ui/src/components/ThemeToggle.tsx +++ b/ui/src/components/ThemeToggle.tsx @@ -1,3 +1,4 @@ +import { forwardRef } from 'react'; import { Sun, Moon } from 'lucide-react'; import { Switch } from '@/components/ui/switch'; @@ -6,9 +7,9 @@ interface ThemeToggleProps { onThemeChange: (isDark: boolean) => void; } -export default function ThemeToggle({ theme, onThemeChange }: ThemeToggleProps) { +const ThemeToggle = forwardRef(({ theme, onThemeChange }, ref) => { return ( -
+
); -} +}); + +ThemeToggle.displayName = 'ThemeToggle'; + +export default ThemeToggle; diff --git a/ui/src/components/chat/ChatView.tsx b/ui/src/components/chat/ChatView.tsx index dbda402..c8e2218 100644 --- a/ui/src/components/chat/ChatView.tsx +++ b/ui/src/components/chat/ChatView.tsx @@ -1,6 +1,7 @@ import { useRef, useEffect } from 'react'; import ChatMessage from './ChatMessage'; import ChatInput from './ChatInput'; +import ThinkingIndicator from './ThinkingIndicator'; import ThemeToggle from '@/components/ThemeToggle'; import type { Message, FileAttachment } from '@/lib/llm'; @@ -41,6 +42,9 @@ export default function ChatView({ ))} + {/* Thinking indicator — visible before first stream token */} + {isLoading && !streamingContent && } + {/* Streaming Message */} {streamingContent && ( (({ isOpen, onClose }, ref) => { const { langgraphUrl, updateLanggraphUrl, checkConnection, isConnected } = useLLM(); const { theme, setTheme } = useTheme(); const [isChecking, setIsChecking] = useState(false); @@ -45,7 +45,7 @@ export default function SettingsPanel({ isOpen, onClose }: SettingsPanelProps) { /> {/* Panel */} -
+
{/* Header */}
@@ -147,4 +147,8 @@ export default function SettingsPanel({ isOpen, onClose }: SettingsPanelProps) {
); -} +}); + +SettingsPanel.displayName = 'SettingsPanel'; + +export default SettingsPanel; diff --git a/ui/src/components/chat/ThinkingIndicator.tsx b/ui/src/components/chat/ThinkingIndicator.tsx new file mode 100644 index 0000000..9269f41 --- /dev/null +++ b/ui/src/components/chat/ThinkingIndicator.tsx @@ -0,0 +1,12 @@ +export default function ThinkingIndicator() { + return ( +
+
+ + + + Thinking... +
+
+ ); +} diff --git a/ui/tailwind.config.ts b/ui/tailwind.config.ts index cc139df..ded75f4 100644 --- a/ui/tailwind.config.ts +++ b/ui/tailwind.config.ts @@ -63,28 +63,24 @@ export default { md: 'calc(var(--radius) - 2px)', sm: 'calc(var(--radius) - 4px)' }, - keyframes: { - 'accordion-down': { - from: { - height: '0' - }, - to: { - height: 'var(--radix-accordion-content-height)' - } - }, - 'accordion-up': { - from: { - height: 'var(--radix-accordion-content-height)' - }, - to: { - height: '0' - } - } - }, - animation: { - 'accordion-down': 'accordion-down 0.2s ease-out', - 'accordion-up': 'accordion-up 0.2s ease-out' - }, + keyframes: { + 'accordion-down': { + from: { height: '0' }, + to: { height: 'var(--radix-accordion-content-height)' } + }, + 'accordion-up': { + from: { height: 'var(--radix-accordion-content-height)' }, + to: { height: '0' } + }, + 'dot-pulse': { + '0%, 80%, 100%': { opacity: '0.3', transform: 'scale(0.8)' }, + '40%': { opacity: '1', transform: 'scale(1.2)' } + } + }, + animation: { + 'accordion-down': 'accordion-down 0.2s ease-out', + 'accordion-up': 'accordion-up 0.2s ease-out' + }, fontFamily: { sans: [ 'Poppins',