From 50da07471c8cf192faddbd497104271923f71710 Mon Sep 17 00:00:00 2001 From: Naiyuan Qing <145280634+NevilleQingNY@users.noreply.github.com> Date: Wed, 14 Jan 2026 21:23:58 +0800 Subject: [PATCH] feat(ui): improve MessageInput and Settings styling MessageInput: - Modern container with hover/focus background transitions - Circular icon button (ArrowUp/Square) - IME composition handling to prevent submit during input - Move hint text outside input container Settings: - Fix AgentItem hover overriding active state - Active item now keeps solid background on hover Co-Authored-By: Claude Opus 4.5 --- src/renderer/src/components/MessageInput.tsx | 67 ++++++++++++-------- src/renderer/src/components/Settings.tsx | 6 +- 2 files changed, 43 insertions(+), 30 deletions(-) diff --git a/src/renderer/src/components/MessageInput.tsx b/src/renderer/src/components/MessageInput.tsx index 14dbc4ddae..6312962ff5 100644 --- a/src/renderer/src/components/MessageInput.tsx +++ b/src/renderer/src/components/MessageInput.tsx @@ -2,6 +2,7 @@ * Message input component */ import { useState, useRef, useEffect } from 'react' +import { ArrowUp, Square } from 'lucide-react' import { Button } from '@/components/ui/button' interface MessageInputProps { @@ -20,6 +21,7 @@ export function MessageInput({ placeholder = 'Type a message...', }: MessageInputProps) { const [value, setValue] = useState('') + const [isComposing, setIsComposing] = useState(false) const textareaRef = useRef(null) // Auto-resize textarea @@ -45,40 +47,49 @@ export function MessageInput({ } const handleKeyDown = (e: React.KeyboardEvent) => { - if (e.key === 'Enter' && !e.shiftKey) { + // Don't submit while IME is composing + if (e.key === 'Enter' && !e.shiftKey && !isComposing) { e.preventDefault() handleSubmit() } } + const canSubmit = !disabled && value.trim().length > 0 + return ( -
-
-