feat: Add footer to messages#37450
Conversation
|
|
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 |
|
Lay Sandeep Shah seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the WalkthroughThe changes add optional footer support to attachment types and update the AttachmentText component to accept attachment objects and conditionally render footer content with specific styling and typography. Changes
Sequence DiagramsequenceDiagram
participant DefaultAttachment
participant AttachmentText
DefaultAttachment->>AttachmentText: Pass attachment object + Markdown as children
rect rgb(230, 240, 250)
Note over AttachmentText: Render children (Markdown content)
end
alt attachment.footer exists
rect rgb(240, 230, 250)
Note over AttachmentText: Render footer with styling
AttachmentText->>AttachmentText: Apply neutral-600 color, c1 scale, opacity
end
end
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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)
packages/core-typings/src/IMessage/MessageAttachment/MessageAttachmentDefault.ts (1)
16-17: Consider grouping the footer field with its comment section.The
footerproperty is added at line 25, but lines 16-17 contain related comments suggestingfooterandfooter_iconshould be grouped together. Consider moving thefooterproperty closer to these comments for better organization.Additionally,
footer_iconis mentioned in the comments but not implemented. Is this planned for a future update?Also applies to: 25-25
📜 Review details
Configuration used: CodeRabbit 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 ignored due to path filters (1)
packages/apps-engine/deno-runtime/deno.lockis excluded by!**/*.lock
📒 Files selected for processing (4)
apps/meteor/client/components/message/content/attachments/DefaultAttachment.tsx(1 hunks)apps/meteor/client/components/message/content/attachments/structure/AttachmentText.tsx(1 hunks)packages/core-typings/src/IMessage/MessageAttachment/MessageAttachmentBase.ts(1 hunks)packages/core-typings/src/IMessage/MessageAttachment/MessageAttachmentDefault.ts(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/meteor/client/components/message/content/attachments/structure/AttachmentText.tsx (1)
packages/core-typings/src/IMessage/MessageAttachment/MessageAttachmentDefault.ts (1)
MessageAttachmentDefault(9-31)
🔇 Additional comments (5)
packages/core-typings/src/IMessage/MessageAttachment/MessageAttachmentBase.ts (1)
11-11: LGTM! Clean type addition.The optional
footerfield is correctly typed and maintains backward compatibility.apps/meteor/client/components/message/content/attachments/DefaultAttachment.tsx (1)
75-75: LGTM! Clean prop forwarding.Passing the
attachmentprop toAttachmentTextenables footer rendering while preserving existing markdown processing logic.apps/meteor/client/components/message/content/attachments/structure/AttachmentText.tsx (3)
5-8: LGTM! Well-typed props.The prop type definition correctly extends Box props and adds optional
attachmentandchildrenfields, maintaining backward compatibility.
11-24: LGTM! Proper text wrapping styles.The inline styles for
whiteSpace,wordBreak, andoverflowWrapensure proper text wrapping behavior for attachment content.
26-35: Footer rendering looks good. Verify plain text is intentional.The footer is rendered with appropriate styling (small font, muted color, reduced opacity). However, unlike the
textfield which can be rendered as markdown viaapplyMarkdownIfRequires, the footer is always rendered as plain text.Is this intentional, or should footer also support markdown rendering through the
mrkdwn_infield?
Proposed changes
This PR introduces support for rendering a footer field (footer?: string) in message attachments.
Rocket.Chat already supports the footer property at the API / message schema level, but the Web client did not render it.
Because of this, users could send attachments containing footer, but the UI simply ignored it.
This PR adds:
- fontScale='c1'
- color='neutral-600'
- marginBlockStart='x4'
- Subtle opacity for visual separation.
message list.
Before
Attachment with a footer sent through the API did not display any footer in the UI.
After
Footer text displays below the attachment body, styled consistently with Rocket.Chat’s visual system.
Issue(s)
Closes: #37428
The issue requests adding UI support for displaying footers in attachments, since the field existed in the backend schema but not in the web client.
Steps to test or reproduce
Run this in console
POST http://localhost:3000/api/v1/chat.postMessage
Further comments
The implementation follows Rocket.Chat’s component structure for message attachments, respecting existing patterns such as:
No breaking changes were introduced.
The feature remains optional and only activates when footer is provided.
Summary by CodeRabbit
New Features