fix: ensure omnichannel transfer comment text wraps to multiple lines#37987
Conversation
Fixes RocketChat#26723 The transfer comment in omnichannel system messages was not wrapping when the comment was longer than the available space. This was caused by the Fuselage MessageSystemBody component using text truncation styles and the parent flex container not allowing wrap. Changes: - Added flex-wrap: wrap to .rcx-message-system__block - Override white-space, text-overflow, and overflow on .rcx-message-system__body - Added flex-shrink and min-width to allow proper text wrapping The long comments now display correctly across multiple lines instead of being truncated with ellipsis.
|
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
WalkthroughThis PR adds CSS rules to the base theme stylesheet to fix text wrapping issues in Omnichannel transfer comments. The changes introduce flexbox wrapping on message system blocks and apply word-breaking properties to message bodies to ensure long comment text wraps correctly rather than overflowing. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/meteor/app/theme/client/imports/general/base.css (1)
119-128: Simplify redundant word-breaking properties.The CSS correctly enables text wrapping, but includes redundant word-breaking declarations:
word-wrap: break-wordis a legacy alias foroverflow-wrapword-break: break-wordis deprecated per W3C CSS Text Module Level 3 specoverflow-wrap: break-wordis the modern standardThese can be safely consolidated:
.rcx-message-system__body { white-space: normal !important; - word-wrap: break-word; - word-break: break-word; overflow-wrap: break-word; text-overflow: clip !important; overflow: visible !important; flex-shrink: 1; min-width: 0; }Note: This rule overrides Fuselage's internal
.rcx-message-system__bodyclass to fix text wrapping in system messages (issue #26723). If Fuselage updates its class structure, this override may need adjustment.
📜 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.
📒 Files selected for processing (1)
apps/meteor/app/theme/client/imports/general/base.css
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-19T18:20:07.720Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37419
File: packages/i18n/src/locales/en.i18n.json:918-921
Timestamp: 2025-11-19T18:20:07.720Z
Learning: Repo: RocketChat/Rocket.Chat — i18n/formatting
Learning: This repository uses a custom message formatting parser in UI blocks/messages; do not assume standard Markdown rules. For keys like Call_ended_bold, Call_not_answered_bold, Call_failed_bold, and Call_transferred_bold in packages/i18n/src/locales/en.i18n.json, retain the existing single-asterisk emphasis unless maintainers request otherwise.
Applied to files:
apps/meteor/app/theme/client/imports/general/base.css
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: cubic · AI code reviewer
🔇 Additional comments (1)
apps/meteor/app/theme/client/imports/general/base.css (1)
114-117: Theflex-wrap: wrapapproach is sound, and the global application to all system messages is appropriate.The
flex-wrap: wrapproperty correctly enables flex items to wrap to multiple lines. While this CSS rule applies globally to all.rcx-message-system__blockelements (not just Omnichannel transfer comments), this appears intentional—the complementary text-wrapping properties added to.rcx-message-system__body(lines 119–128) also apply globally and are part of the same fix. The change benefits all system messages by improving text wrapping and readability without negative side effects.
Proposed changes (including videos or screenshots)
The transfer comment in omnichannel system messages was not wrapping when the comment was longer than the available space. This was caused by the Fuselage
MessageSystemBodycomponent using text truncation styles (white-space: nowrap,text-overflow: ellipsis) and the parent flex container (.rcx-message-system__block) not allowing wrap.Changes Made:
flex-wrap: wrapto.rcx-message-system__blockto allow the flex container to wrap contentwhite-space,text-overflow, andoverflowon.rcx-message-system__bodyto allow text wrappingflex-shrinkandmin-widthproperties to enable proper text wrapping behaviorBefore (Bug):
After (Fixed):
Issue(s)
Fixes #26723
Steps to test or reproduce
/livechatin incognito browser)"ThisIsAVeryLongCommentThatShouldWrapToMultipleLinesInsteadOfOverflowingHorizontallyWhichWasThePreviousBehaviorBeforeTheFix"
Further comments
This is a CSS-only fix that overrides the default Fuselage component styles. The fix is minimal and targeted specifically at the system message body element to avoid unintended side effects on other components.
Root cause:
.rcx-message-system__blockusesdisplay: flexwithflex-direction: rowwhich keeps all items on one line.rcx-message-system__bodyuses Fuselage's truncation mixin which addswhite-space: nowrapandtext-overflow: ellipsisSolution:
flex-wrap: wrapSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.