Skip to content

Commit c9d5261

Browse files
committed
Fix feedback submission and form label accessibility bugs
- Fix feedback silently discarded when text is empty: Remove early return that prevented submitFeedback.mutate() from being called when textarea was empty. The thumbs up/down vote (isPositiveFeedback) is now recorded even without optional text feedback. - Fix form labels replaced with non-semantic paragraph elements: Replace <p> tags with proper <Label> components with htmlFor attributes for the Request, Subject, and Message form fields, restoring click-to-focus behavior and screen reader association.
1 parent e9b82ee commit c9d5261

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

apps/sim/app/workspace/[workspaceId]/components/message-actions/message-actions.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,12 @@ export function MessageActions({ content, chatId, userQuery }: MessageActionsPro
9292
const handleSubmitFeedback = useCallback(() => {
9393
if (!pendingFeedback || !chatId || !userQuery) return
9494
const text = feedbackText.trim()
95-
if (!text) {
96-
setPendingFeedback(null)
97-
setFeedbackText('')
98-
return
99-
}
10095
submitFeedback.mutate({
10196
chatId,
10297
userQuery,
10398
agentResponse: content,
10499
isPositiveFeedback: pendingFeedback === 'up',
105-
feedback: text,
100+
feedback: text || undefined,
106101
})
107102
setPendingFeedback(null)
108103
setFeedbackText('')

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/help-modal/help-modal.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
Button,
1313
Combobox,
1414
Input,
15+
Label,
1516
Modal,
1617
ModalBody,
1718
ModalContent,
@@ -431,7 +432,7 @@ export function HelpModal({ open, onOpenChange, workflowId, workspaceId }: HelpM
431432
<div ref={scrollContainerRef} className='min-h-0 flex-1 overflow-y-auto'>
432433
<div className='space-y-3'>
433434
<div className='flex flex-col gap-2'>
434-
<p className='font-medium text-[var(--text-secondary)] text-sm'>Request</p>
435+
<Label htmlFor='type' className='text-[var(--text-secondary)] text-sm'>Request</Label>
435436
<Combobox
436437
id='type'
437438
options={REQUEST_TYPE_OPTIONS}
@@ -446,7 +447,7 @@ export function HelpModal({ open, onOpenChange, workflowId, workspaceId }: HelpM
446447
</div>
447448

448449
<div className='flex flex-col gap-2'>
449-
<p className='font-medium text-[var(--text-secondary)] text-sm'>Subject</p>
450+
<Label htmlFor='subject' className='text-[var(--text-secondary)] text-sm'>Subject</Label>
450451
<Input
451452
id='subject'
452453
placeholder='Brief description of your request'
@@ -456,7 +457,7 @@ export function HelpModal({ open, onOpenChange, workflowId, workspaceId }: HelpM
456457
</div>
457458

458459
<div className='flex flex-col gap-2'>
459-
<p className='font-medium text-[var(--text-secondary)] text-sm'>Message</p>
460+
<Label htmlFor='message' className='text-[var(--text-secondary)] text-sm'>Message</Label>
460461
<Textarea
461462
id='message'
462463
placeholder='Please provide details about your request...'

0 commit comments

Comments
 (0)