Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,22 @@ const ForwardChatModal = ({ onForward, onCancel, room, ...props }: ForwardChatMo
</FieldRow>
</Field>
<Field marginBlock={15}>

<FieldLabel>
{t('Leave_a_comment')}{' '}
<Box is='span' color='annotation'>
({t('Optional')})
</Box>
</FieldLabel>
<FieldRow>
<TextAreaInput data-qa-id='ForwardChatModalTextAreaInputComment' {...register('comment')} rows={8} flexGrow={1} />
{/* Fix for issue #26723 - wrap long text */}
<TextAreaInput
data-qa-id='ForwardChatModalTextAreaInputComment'
{...register('comment')}
rows={8}
flexGrow={1}
style={{ wordBreak: 'break-word', whiteSpace: 'pre-wrap' }}
/>
</FieldRow>
Comment on lines 132 to 149
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove the inline JSX comment and wire up the label to the textarea (a11y), plus prefer overflowWrap for long-word breaking.
The JSX comment conflicts with repo guidelines for TS/TSX/JS, and the label currently isn’t associated with the input.

Proposed patch
 					<Field marginBlock={15}>
 						<FieldLabel>
 							{t('Leave_a_comment')}{' '}
 							<Box is='span' color='annotation'>
 								({t('Optional')})
 							</Box>
 						</FieldLabel>
 						<FieldRow>
-							{/* Fix for issue #26723 - wrap long text */}
-							<TextAreaInput 
-									data-qa-id='ForwardChatModalTextAreaInputComment' 
-									{...register('comment')} 
-									rows={8} 
-									flexGrow={1}
-									style={{ wordBreak: 'break-word', whiteSpace: 'pre-wrap' }}
-								/>
+							<TextAreaInput
+								id={`${departmentFieldId}__comment`}
+								data-qa-id='ForwardChatModalTextAreaInputComment'
+								{...register('comment')}
+								rows={8}
+								flexGrow={1}
+								style={{ overflowWrap: 'anywhere', wordBreak: 'break-word', whiteSpace: 'pre-wrap' }}
+							/>
 						</FieldRow>
 					</Field>
-						<FieldLabel>
+						<FieldLabel htmlFor={`${departmentFieldId}__comment`}>
🤖 Prompt for AI Agents
In @apps/meteor/client/views/omnichannel/modals/ForwardChatModal.tsx around
lines 132 - 149, Remove the inline JSX comment and wire the label to the
textarea for accessibility: delete the JSX comment above TextAreaInput, add a
unique id (e.g. "forward-comment") to the TextAreaInput (the element created via
register('comment')) and set that id on FieldLabel via its htmlFor/for prop so
the label is associated with the input; also replace the inline style
wordBreak/whiteSpace with overflowWrap: 'break-word' (and keep pre-wrap behavior
via whiteSpace: 'pre-wrap' if needed) to prefer overflowWrap for long-word
breaking.

</Field>
</FieldGroup>
Expand Down