11import React , { useState , useRef , useEffect } from 'react' ;
22import { FiSend , FiRefreshCw , FiImage , FiSquare , FiX } from 'react-icons/fi' ;
3- import { motion , AnimatePresence } from 'framer-motion' ;
3+ import { AnimatePresence , motion } from 'framer-motion' ;
44import { ConnectionStatus } from '@/common/types' ;
55import { ChatCompletionContentPart } from '@tarko/agent-interface' ;
66import { useSession } from '@/common/hooks/useSession' ;
@@ -409,21 +409,19 @@ export const ChatInput: React.FC<ChatInputProps> = ({
409409 { /* File upload button */ }
410410 { showAttachments && (
411411 < div className = "absolute left-3 bottom-3 flex items-center gap-2" >
412- < motion . button
413- whileHover = { { scale : 1.05 } }
414- whileTap = { { scale : 0.95 } }
412+ < button
415413 type = "button"
416414 onClick = { handleFileUpload }
417415 disabled = { isDisabled || isProcessing }
418- className = { `p-2 rounded-full transition-colors ${
416+ className = { `p-2 rounded-full transition-all duration-200 hover:scale-105 active:scale-95 ${
419417 isDisabled || isProcessing
420418 ? 'text-gray-300 dark:text-gray-600 cursor-not-allowed'
421419 : 'text-gray-400 hover:text-accent-500 hover:bg-gray-50 dark:hover:bg-gray-700/30 dark:text-gray-400'
422420 } `}
423421 title = "Attach image (or paste directly)"
424422 >
425423 < FiImage size = { 18 } />
426- </ motion . button >
424+ </ button >
427425
428426 < input
429427 type = "file"
@@ -445,11 +443,9 @@ export const ChatInput: React.FC<ChatInputProps> = ({
445443 initial = { { opacity : 0 , scale : 0.8 } }
446444 animate = { { opacity : 1 , scale : 1 } }
447445 exit = { { opacity : 0 , scale : 0.8 } }
448- whileTap = { { scale : 0.9 } }
449- whileHover = { { scale : 1.05 } }
450446 type = "button"
451447 onClick = { onReconnect }
452- className = "absolute right-3 bottom-3 p-2 rounded-full text-gray-500 hover:bg-gray-50 dark:hover:bg-gray-700/30 dark:text-gray-400 transition-all duration-200"
448+ className = "absolute right-3 bottom-3 p-2 rounded-full text-gray-500 hover:bg-gray-50 dark:hover:bg-gray-700/30 dark:text-gray-400 transition-all duration-200 hover:scale-105 active:scale-90 "
453449 title = "Try to reconnect"
454450 >
455451 < FiRefreshCw
@@ -464,16 +460,14 @@ export const ChatInput: React.FC<ChatInputProps> = ({
464460 animate = { { opacity : 1 } }
465461 exit = { { opacity : 0 } }
466462 transition = { { duration : 0.2 } }
467- whileTap = { { scale : 0.95 } }
468- whileHover = { { scale : 1.02 } }
469463 type = "button"
470464 onClick = { handleAbort }
471465 disabled = { isAborting }
472- className = { `absolute right-3 bottom-3 w-10 h-10 rounded-full flex items-center justify-center ${
466+ className = { `absolute right-3 bottom-3 w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200 hover:scale-105 active:scale-95 ${
473467 isAborting
474468 ? 'bg-gradient-to-r from-indigo-100 via-purple-100 to-pink-100 dark:from-indigo-800/30 dark:via-purple-800/30 dark:to-pink-800/30 text-indigo-400 dark:text-indigo-500 cursor-not-allowed border-2 border-indigo-200 dark:border-indigo-700/50'
475469 : 'bg-gradient-to-r from-indigo-50 via-purple-50 to-pink-50 hover:from-indigo-100 hover:via-purple-100 hover:to-pink-100 dark:from-indigo-900/20 dark:via-purple-900/20 dark:to-pink-900/20 dark:hover:from-indigo-900/30 dark:hover:via-purple-900/30 dark:hover:to-pink-900/30 text-indigo-600 dark:text-indigo-400 border-2 border-indigo-200 dark:border-indigo-700/50'
476- } transition-all duration-200 shadow-sm bg-[length:200%_200%] animate-border-flow`}
470+ } shadow-sm bg-[length:200%_200%] animate-border-flow`}
477471 title = "Stop generation"
478472 >
479473 { isAborting ? (
@@ -488,15 +482,13 @@ export const ChatInput: React.FC<ChatInputProps> = ({
488482 initial = { { opacity : 0 , scale : 0.8 } }
489483 animate = { { opacity : 1 , scale : 1 } }
490484 exit = { { opacity : 0 , scale : 0.8 } }
491- whileTap = { { scale : 0.9 } }
492- whileHover = { { scale : 1.05 } }
493485 type = "submit"
494486 disabled = { isMessageEmpty ( contextualState . input , uploadedImages ) || isDisabled }
495- className = { `absolute right-3 bottom-3 p-3 rounded-full ${
487+ className = { `absolute right-3 bottom-3 p-3 rounded-full transition-all duration-200 hover:scale-105 active:scale-90 ${
496488 isMessageEmpty ( contextualState . input , uploadedImages ) || isDisabled
497489 ? 'bg-gray-100 dark:bg-gray-700 text-gray-400 cursor-not-allowed'
498490 : 'bg-gradient-to-r from-indigo-500 to-purple-500 dark:from-indigo-400 dark:via-purple-400 dark:to-pink-400 text-white dark:text-gray-900 shadow-sm'
499- } transition-all duration-200 `}
491+ } `}
500492 >
501493 < FiSend size = { 18 } />
502494 </ motion . button >
@@ -510,34 +502,22 @@ export const ChatInput: React.FC<ChatInputProps> = ({
510502 { showHelpText && (
511503 < div className = "flex justify-center mt-2 text-xs" >
512504 { connectionStatus && ! connectionStatus . connected ? (
513- < motion . span
514- initial = { { opacity : 0.7 } }
515- animate = { { opacity : 1 } }
516- className = "text-red-500 dark:text-red-400 flex items-center font-medium"
517- >
505+ < span className = "text-red-500 dark:text-red-400 flex items-center font-medium animate-in fade-in duration-300" >
518506 { connectionStatus . reconnecting
519507 ? 'Attempting to reconnect...'
520508 : 'Server disconnected. Click the button to reconnect.' }
521- </ motion . span >
509+ </ span >
522510 ) : isProcessing ? (
523- < motion . span
524- initial = { { opacity : 0.7 } }
525- whileHover = { { opacity : 1 } }
526- className = "text-accent-500 dark:text-accent-400 flex items-center"
527- >
511+ < span className = "text-accent-500 dark:text-accent-400 flex items-center animate-in fade-in duration-300" >
528512 < span className = "typing-indicator mr-2" >
529513 < span > </ span >
530514 < span > </ span >
531515 < span > </ span >
532516 </ span >
533517 Agent is processing your request...
534- </ motion . span >
518+ </ span >
535519 ) : (
536- < motion . span
537- initial = { { opacity : 0.7 } }
538- whileHover = { { opacity : 1 } }
539- className = "text-gray-500 dark:text-gray-400 transition-opacity"
540- >
520+ < span className = "text-gray-500 dark:text-gray-400 transition-opacity hover:opacity-100 animate-in fade-in duration-300" >
541521 { contextualSelectorEnabled ? (
542522 < >
543523 Use @ to reference files/folders • Ctrl+Enter to send • You can also paste images
@@ -546,7 +526,7 @@ export const ChatInput: React.FC<ChatInputProps> = ({
546526 ) : (
547527 < > Use Ctrl+Enter to quickly send • You can also paste images directly</ >
548528 ) }
549- </ motion . span >
529+ </ span >
550530 ) }
551531 </ div >
552532 ) }
0 commit comments