Skip to content

Commit 344b4ae

Browse files
committed
fix: design feedback
1 parent 466c29e commit 344b4ae

File tree

3 files changed

+28
-18
lines changed

3 files changed

+28
-18
lines changed

cli/src/components/feedback-icon-button.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ export const FeedbackIconButton: React.FC<FeedbackIconButtonProps> = ({ onClick,
3636
}
3737
const handleMouseOut = () => hover.scheduleClose()
3838

39-
const textCollapsed = isOpen ? '[x]' : '[?]'
40-
const textExpanded = isOpen ? '[close x]' : '[share feedback]'
39+
const textCollapsed = '[?]'
40+
const textExpanded = '[share feedback]'
4141

4242
return (
4343
<Button
@@ -51,8 +51,8 @@ export const FeedbackIconButton: React.FC<FeedbackIconButtonProps> = ({ onClick,
5151
onMouseOver={handleMouseOver}
5252
onMouseOut={handleMouseOut}
5353
>
54-
<text style={{ wrapMode: 'none', fg: hover.isOpen ? theme.foreground : theme.muted }}>
55-
{hover.isOpen ? textExpanded : textCollapsed}
54+
<text style={{ wrapMode: 'none', fg: hover.isOpen || isOpen ? theme.foreground : theme.muted }}>
55+
{hover.isOpen || isOpen ? textExpanded : textCollapsed}
5656
</text>
5757
</Button>
5858
)

cli/src/components/feedback-input-mode.tsx

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import React, { useCallback, useRef } from 'react'
1+
import React, { useCallback, useRef, useState } from 'react'
22
import { useKeyboard } from '@opentui/react'
3+
import { TextAttributes } from '@opentui/core'
34

45
import { MultilineInput, type MultilineInputHandle } from './multiline-input'
56
import { 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: MessageTraceSession</span>
189+
<span fg={theme.muted}>Auto-attached: messagetracesession</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>

cli/src/components/feedback-modal.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { useCallback, useRef, useState } from 'react'
22
import { useRenderer, useKeyboard } from '@opentui/react'
3+
import { TextAttributes } from '@opentui/core'
34

45
import { MultilineInput, type MultilineInputHandle } from './multiline-input'
56
import { Button } from './button'
@@ -75,8 +76,8 @@ export const FeedbackModal: React.FC<FeedbackModalProps> = ({ open, onClose, onS
7576
if (!open) return null
7677

7778
const categoryOptions = [
78-
{ id: 'good_code', label: 'Good code', highlight: theme.success },
79-
{ id: 'bad_code', label: 'Bad code', highlight: theme.error },
79+
{ id: 'good_code', label: 'Good result', highlight: theme.success },
80+
{ id: 'bad_code', label: 'Bad result', highlight: theme.error },
8081
{ id: 'bug', label: 'Bug', highlight: theme.warning },
8182
{ id: 'other', label: 'Other', highlight: theme.info },
8283
] as const
@@ -186,7 +187,7 @@ export const FeedbackModal: React.FC<FeedbackModalProps> = ({ open, onClose, onS
186187

187188
<box style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', gap: 2 }}>
188189
<text style={{ wrapMode: 'none' }}>
189-
<span fg={theme.muted}>Auto-attached: Message content • Trace data • Session info</span>
190+
<span fg={theme.muted}>Auto-attached: message • trace • session</span>
190191
</text>
191192
<Button
192193
onClick={() => {
@@ -200,10 +201,10 @@ export const FeedbackModal: React.FC<FeedbackModalProps> = ({ open, onClose, onS
200201
borderStyle: 'single',
201202
borderColor: canSubmit ? theme.foreground : theme.border,
202203
customBorderChars: BORDER_CHARS,
203-
backgroundColor: canSubmit ? theme.surface : undefined,
204+
backgroundColor: 'transparent',
204205
}}
205206
>
206-
<text style={{ wrapMode: 'none' }}>
207+
<text style={{ wrapMode: 'none' }} attributes={canSubmit ? undefined : TextAttributes.DIM | TextAttributes.ITALIC}>
207208
<span fg={canSubmit ? theme.foreground : theme.muted}>{'SUBMIT'}</span>
208209
</text>
209210
</Button>

0 commit comments

Comments
 (0)