From b1cfc3137db9e9dd12db05fa57f18c441f8feb54 Mon Sep 17 00:00:00 2001 From: Fini Date: Sun, 22 Feb 2026 08:19:02 +0800 Subject: [PATCH] fix(panels): improve AI chat panel overflow and color picker styling - Fix chat panel overflow with proper flex layout and min-h-0 - Cap checklist height with scrollable overflow - Adjust color picker input sizing --- src/components/panels/ai-chat-panel.tsx | 18 ++++++++++++------ src/components/shared/color-picker.tsx | 4 ++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/components/panels/ai-chat-panel.tsx b/src/components/panels/ai-chat-panel.tsx index 3c56baa8b..eb7498bb6 100644 --- a/src/components/panels/ai-chat-panel.tsx +++ b/src/components/panels/ai-chat-panel.tsx @@ -22,6 +22,7 @@ import { import { trimChatHistory } from '@/services/ai/context-optimizer' import type { ChatMessage as ChatMessageType } from '@/services/ai/ai-types' import type { AIProviderType } from '@/types/agent-settings' +import { CHAT_STREAM_THINKING_CONFIG } from '@/services/ai/ai-runtime-config' import ClaudeLogo from '@/components/icons/claude-logo' import OpenAILogo from '@/components/icons/openai-logo' import OpenCodeLogo from '@/components/icons/opencode-logo' @@ -124,7 +125,6 @@ function useChatHandlers() { const addMessage = useAIStore((s) => s.addMessage) const updateLastMessage = useAIStore((s) => s.updateLastMessage) const setStreaming = useAIStore((s) => s.setStreaming) - const handleSend = useCallback( async (text?: string) => { const messageText = text ?? input.trim() @@ -235,7 +235,13 @@ function useChatHandlers() { g.models.some((m) => m.value === model), )?.provider let chatThinking = false - for await (const chunk of streamChat(CHAT_SYSTEM_PROMPT, trimmedHistory, model, undefined, currentProvider)) { + for await (const chunk of streamChat( + CHAT_SYSTEM_PROMPT, + trimmedHistory, + model, + CHAT_STREAM_THINKING_CONFIG, + currentProvider, + )) { if (chunk.type === 'thinking') { // Show a brief thinking indicator so the UI isn't stuck on empty if (!chatThinking && !accumulated) { @@ -310,7 +316,7 @@ function FixedChecklist({ messages, isStreaming }: { messages: ChatMessageType[] const completed = items.filter((item) => item.done).length return ( -
+
{!collapsed && ( -
+
{items.map((item, index) => (
{/* --- Messages --- */} -
+
{messages.length === 0 ? (

diff --git a/src/components/shared/color-picker.tsx b/src/components/shared/color-picker.tsx index acd502b71..62e22899b 100644 --- a/src/components/shared/color-picker.tsx +++ b/src/components/shared/color-picker.tsx @@ -55,7 +55,7 @@ export default function ColorPicker({ type="color" value={value.slice(0, 7)} onChange={handleNativeChange} - className="w-4 h-4 rounded border border-input/50 cursor-pointer bg-transparent p-0" + className="w-4 h-5 rounded cursor-pointer bg-transparent p-0" />