Skip to content

Conversation

@AVNSKS
Copy link

@AVNSKS AVNSKS commented Jan 10, 2026

Proposed changes

This PR fixes the text overflow issue in the Forward Chat modal's comment textarea. Previously, long text without spaces would overflow horizontally outside the textarea. Now it wraps properly to multiple lines.

Changes made:

  • Added style prop with wordBreak: 'break-word' and whiteSpace: 'pre-wrap' to the TextAreaInput component in ForwardChatModal.tsx

Issue(s)

Fixes #26723

Steps to test or reproduce

  1. Go to Omnichannel → Accept a chat
  2. Click the Forward button
  3. In the "Leave a comment" textarea, type a very long text without spaces (e.g., aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
  4. Verify the text wraps to multiple lines instead of overflowing horizontally

Expected behavior: Text wraps properly across multiple lines
Screen affected: Forward Chat Modal in Omnichannel

Summary by CodeRabbit

  • Bug Fixes
    • Fixed text wrapping in the forward chat dialog to properly display long text without layout issues.

✏️ Tip: You can customize this high-level summary in your review settings.

Fixes RocketChat#26723

Added style prop with wordBreak: 'break-word' and whiteSpace: 'pre-wrap'
to the TextAreaInput component in ForwardChatModal to ensure long text
without spaces wraps to multiple lines instead of overflowing horizontally.
Fixes RocketChat#26723

Added style prop with wordBreak and whiteSpace to TextAreaInput component
to ensure long text wraps properly instead of overflowing.
@AVNSKS AVNSKS requested a review from a team as a code owner January 10, 2026 06:49
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Jan 10, 2026

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Jan 10, 2026

⚠️ No Changeset found

Latest commit: 14a47a3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 10, 2026

Walkthrough

This PR applies a styling fix to the ForwardChatModal textarea component to enable proper text wrapping for long comments in omnichannel chat transfers. CSS properties are added to the textarea to prevent text from extending beyond visible boundaries and becoming truncated or hidden.

Changes

Cohort / File(s) Summary
Textarea text wrapping fix
apps/meteor/client/views/omnichannel/modals/ForwardChatModal.tsx
Replaces plain TextAreaInput with styled variant including wordBreak: break-word and whiteSpace: pre-wrap CSS properties to enable multi-line text wrapping in the forward chat comment field. Addresses issue #26723.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested labels

stat: ready to merge, stat: QA assured

Poem

A textarea was cramped and tight,
Long words wouldn't wrap just right!
But now with CSS's gentle care,
Comments flow with space to spare! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding text wrapping to the forward chat comment textarea to fix the long text overflow issue.
Linked Issues check ✅ Passed The changes directly implement the fix required by issue #26723 by adding word-break and white-space CSS properties to enable text wrapping in the ForwardChatModal textarea.
Out of Scope Changes check ✅ Passed All changes are focused on fixing the text wrapping issue in the ForwardChatModal textarea; no unrelated modifications were introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @apps/meteor/client/views/omnichannel/modals/ForwardChatModal.tsx:
- Around line 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.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 05c415b and 14a47a3.

📒 Files selected for processing (1)
  • apps/meteor/client/views/omnichannel/modals/ForwardChatModal.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/client/views/omnichannel/modals/ForwardChatModal.tsx

Comment on lines 132 to 149
<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>
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Omnichannel transfer comment is not wrapped to multiple lines

1 participant