1- import React , { useCallback , useRef } from 'react'
1+ import React , { useCallback , useRef , useState } from 'react'
22import { useKeyboard } from '@opentui/react'
3+ import { TextAttributes } from '@opentui/core'
34
45import { MultilineInput , type MultilineInputHandle } from './multiline-input'
56import { Button } from './button'
@@ -32,6 +33,7 @@ export const FeedbackInputMode: React.FC<FeedbackInputModeProps> = ({
3233 const theme = useTheme ( )
3334 const inputRef = useRef < MultilineInputHandle | null > ( null )
3435 const canSubmit = feedbackText . trim ( ) . length > 0
36+ const [ closeButtonHovered , setCloseButtonHovered ] = useState ( false )
3537
3638 // Handle keyboard shortcuts
3739 useKeyboard (
@@ -63,8 +65,8 @@ export const FeedbackInputMode: React.FC<FeedbackInputModeProps> = ({
6365 )
6466
6567 const categoryOptions = [
66- { id : 'good_code' , label : 'Good code ' , highlight : theme . success } ,
67- { id : 'bad_code' , label : 'Bad code ' , highlight : theme . error } ,
68+ { id : 'good_code' , label : 'Good result ' , highlight : theme . success } ,
69+ { id : 'bad_code' , label : 'Bad result ' , highlight : theme . error } ,
6870 { id : 'bug' , label : 'Bug' , highlight : theme . warning } ,
6971 { id : 'other' , label : 'Other' , highlight : theme . info } ,
7072 ] as const
@@ -85,10 +87,17 @@ export const FeedbackInputMode: React.FC<FeedbackInputModeProps> = ({
8587 } }
8688 >
8789
88- { /* Helper text */ }
89- < text style = { { wrapMode : 'none' } } >
90- < span fg = { theme . secondary } > Share feedback — thanks for helping us improve!</ span >
91- </ text >
90+ { /* Header: helper text + close X */ }
91+ < box style = { { flexDirection : 'row' , alignItems : 'center' , justifyContent : 'space-between' } } >
92+ < text style = { { wrapMode : 'none' } } >
93+ < span fg = { theme . secondary } > Share feedback — thanks for helping us improve!</ span >
94+ </ text >
95+ < box onMouseDown = { onCancel } onMouseOver = { ( ) => setCloseButtonHovered ( true ) } onMouseOut = { ( ) => setCloseButtonHovered ( false ) } >
96+ < text style = { { wrapMode : 'none' } } selectable = { false } >
97+ < span fg = { closeButtonHovered ? theme . foreground : theme . muted } > X</ span >
98+ </ text >
99+ </ box >
100+ </ box >
92101
93102 { /* Category buttons */ }
94103 < box style = { { flexDirection : 'row' , gap : 1 , paddingTop : 0 , paddingBottom : 0 } } >
@@ -177,7 +186,7 @@ export const FeedbackInputMode: React.FC<FeedbackInputModeProps> = ({
177186 gap : 2
178187 } } >
179188 < text style = { { wrapMode : 'none' } } >
180- < span fg = { theme . muted } > Auto-attached: Message • Trace • Session </ span >
189+ < span fg = { theme . muted } > Auto-attached: message • trace • session </ span >
181190 </ text >
182191 < Button
183192 onClick = { ( ) => {
@@ -194,7 +203,7 @@ export const FeedbackInputMode: React.FC<FeedbackInputModeProps> = ({
194203 backgroundColor : 'transparent' ,
195204 } }
196205 >
197- < text style = { { wrapMode : 'none' } } >
206+ < text style = { { wrapMode : 'none' } } attributes = { canSubmit ? undefined : TextAttributes . DIM | TextAttributes . ITALIC } >
198207 < span fg = { canSubmit ? theme . foreground : theme . muted } > SUBMIT</ span >
199208 </ text >
200209 </ Button >
0 commit comments