@@ -24,6 +24,7 @@ import { useAgentValidation } from './hooks/use-agent-validation'
2424import { useAuthState } from './hooks/use-auth-state'
2525import { useChatInput } from './hooks/use-chat-input'
2626import { useClipboard } from './hooks/use-clipboard'
27+ import { showClipboardMessage } from './utils/clipboard'
2728import { useConnectionStatus } from './hooks/use-connection-status'
2829import { useElapsedTime } from './hooks/use-elapsed-time'
2930import { useExitHandler } from './hooks/use-exit-handler'
@@ -223,7 +224,7 @@ export const Chat = ({
223224 const abortControllerRef = useRef < AbortController | null > ( null )
224225 const sendMessageRef = useRef < SendMessageFn > ( )
225226
226- const { clipboardMessage } = useClipboard ( )
227+ const { statusMessage } = useClipboard ( )
227228 const isConnected = useConnectionStatus ( )
228229 const mainAgentTimer = useElapsedTime ( )
229230 const timerStartTime = mainAgentTimer . startTime
@@ -459,7 +460,7 @@ export const Chat = ({
459460 const [ savedInputValue , setSavedInputValue ] = useState ( '' )
460461 const [ savedCursorPosition , setSavedCursorPosition ] = useState ( 0 )
461462 const [ showFeedbackConfirmation , setShowFeedbackConfirmation ] = useState ( false )
462- const [ feedbackSentMessage , setFeedbackSentMessage ] = useState < string | null > ( null )
463+
463464 const [ messagesWithFeedback , setMessagesWithFeedback ] = useState < Set < string > > ( new Set ( ) )
464465
465466 const openFeedbackForMessage = useCallback ( ( id : string ) => {
@@ -522,14 +523,16 @@ export const Chat = ({
522523 setMessagesWithFeedback ( prev => new Set ( prev ) . add ( feedbackMessageId ) )
523524 }
524525
525- // Show success in status indicator and exit feedback mode
526+ // Exit feedback mode first
526527 setFeedbackMode ( false )
527528 setFeedbackText ( '' )
528529 setFeedbackCategory ( 'other' )
529- setFeedbackSentMessage ( 'Feedback sent ✔' )
530- setTimeout ( ( ) => {
531- setFeedbackSentMessage ( null )
532- } , 5000 )
530+
531+ // Show success message in status indicator for 5 seconds
532+ showClipboardMessage ( 'Feedback sent ✔' , { durationMs : 5000 } )
533+
534+ // Restore input focus
535+ setInputFocused ( true )
533536 } , [ feedbackText , feedbackCategory , feedbackMessageId , messages , agentMode , sessionCreditsUsed ] )
534537
535538 const handleFeedbackCancel = useCallback ( ( ) => {
@@ -700,7 +703,7 @@ export const Chat = ({
700703 const shouldCenterInputVertically =
701704 ! hasSuggestionMenu && ! showAgentStatusLine && ! isMultilineInput
702705 const statusIndicatorState = getStatusIndicatorState ( {
703- clipboardMessage ,
706+ statusMessage ,
704707 streamStatus,
705708 nextCtrlCWillExit,
706709 isConnected,
@@ -712,7 +715,7 @@ export const Chat = ({
712715
713716 const statusIndicatorNode = (
714717 < StatusIndicator
715- clipboardMessage = { feedbackSentMessage ?? clipboardMessage }
718+ statusMessage = { statusMessage }
716719 streamStatus = { streamStatus }
717720 timerStartTime = { timerStartTime }
718721 nextCtrlCWillExit = { nextCtrlCWillExit }
0 commit comments