fix: reorder message content to fix order on mobile to match web view
On mobile, webhook messages that contain both text and attachments were showing attachments first and the text later. On the web, the text always appears first. This caused an inconsistent experience.
Closes #5015
What’s changed
I updated the order of components inside Message.tsx so that:
- The message text (
Content) always shows before quotes and attachments. - This update applies to both preview messages and regular messages.
How it behaves now
- Mobile now shows text → attachments, same as the web.
- This makes the message order consistent across all platforms.
Files updated
app/containers/message/Message.tsx
How to test
- Send a webhook message that has both
textandattachments. - Open it on mobile → text should appear above the attachment block.
- Compare with the web → both now match.
- Test attachments like images, quotes, and links to confirm all work fine.
Screenshots
Before:
After:
Summary by CodeRabbit
- Style
- Adjusted message rendering so linked quotes and main content are ordered contextually—when a message contains a linked quote the quote is shown before/after content as appropriate for clearer conversation flow and improved readability.
✏️ Tip: You can customize this high-level summary in your review settings.
Walkthrough
Adjusts internal rendering order so linked Quote components are conditionally rendered before or after message Content/Attachments based on a derived hasLinkedQuote flag; also updates a few Xcode build configuration quoting styles in the iOS project file.
Changes
| Cohort / File(s) | Summary |
|---|---|
Message rendering logic app/containers/message/Message.tsx |
Introduces hasLinkedQuote from attachments and conditionally switches render order between Quote and Content in multiple non-preview and thread/info render paths. No public API changes. |
iOS Xcode project config edits ios/RocketChatRN.xcodeproj/project.pbxproj |
Removed quotes around some build variables in inputPaths and HEADER_SEARCH_PATHS (e.g., "$INFOPLIST_PATH" → $INFOPLIST_PATH, "$PODS_CONFIGURATION_BUILD_DIR/Firebase" → $PODS_CONFIGURATION_BUILD_DIR/Firebase). |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~15–30 minutes
- Review
app/containers/message/Message.tsxfor correct conditional ordering in all render branches and ensure no regressions in message display (attachments, quotes, previews, threads). - Verify iOS pbxproj edits do not alter build behavior across configurations and that variable expansions remain valid in CI/macOS environments.
Suggested reviewers
- OtavioStasiak
Poem
🐰
I nudge the Quote to dance aside,
Content and images hop in pride.
A carrot wink, a joyful squeak,
Now messages show each little peek.
Hoppity render — tidy and spry! 🥕
Pre-merge checks and finishing touches
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Out of Scope Changes check | ⚠️ Warning | The PR contains out-of-scope changes to ios/RocketChatRN.xcodeproj/project.pbxproj unrelated to the message rendering order fix. | Remove or revert the unrelated iOS project file changes (Bugsnag upload paths and Firebase header search paths) into a separate PR. |
✅ Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title accurately describes the main change: reordering message content on mobile to match web view behavior. |
| Linked Issues check | ✅ Passed | The PR addresses the core issue by reordering message components so text renders before attachments, aligning mobile with web behavior and fixing the attachment text display problem. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✨ 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.
Comment @coderabbitai help to get the list of available commands and usage tips.