Skip to content

feat: Add footer to messages#37450

Open
Layyzyy wants to merge 4 commits into
RocketChat:developfrom
Layyzyy:footer
Open

feat: Add footer to messages#37450
Layyzyy wants to merge 4 commits into
RocketChat:developfrom
Layyzyy:footer

Conversation

@Layyzyy
Copy link
Copy Markdown

@Layyzyy Layyzyy commented Nov 8, 2025

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:

  1. UI Rendering for attachment.footer
    • Updated AttachmentText.tsx to optionally render a footer block when attachment.footer is present.
    • Footer is styled using:
      - fontScale='c1'
      - color='neutral-600'
      - marginBlockStart='x4'
      - Subtle opacity for visual separation.
  2. Extended Type Definitions
    • Updated MessageAttachmentDefault typings to properly include footer?: string;.
  3. End-to-end validation
    • Sending a message using the REST API /api/v1/chat.postMessage with a footer now renders correctly in the
      message list.

Before

Attachment with a footer sent through the API did not display any footer in the UI.

Before

After

Footer text displays below the attachment body, styled consistently with Rocket.Chat’s visual system.

2025-11-09_00-04-07

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

  1. Start a local Rocket.Chat dev environment
  2. Authenticate and retrieve X-Auth-Token + X-User-Id
localStorage.getItem('Meteor.userId')
localStorage.getItem('Meteor._localStorageToken')

Run this in console

  1. Send test message via Postman (API) :
    POST http://localhost:3000/api/v1/chat.postMessage
{
  "channel": "GENERAL",
  "emoji": ":rocket:",
  "attachments": [
    {
      "title": "This is the title",
      "color": "#A9A9A9",
      "text": "This is the body of the message",
      "footer": "This is a footer message"
    }
  ]
}
  1. Open #general and verify:
  • Title renders
  • Text renders
  • Footer appears below, styled in muted color

Further comments

The implementation follows Rocket.Chat’s component structure for message attachments, respecting existing patterns such as:

  • AttachmentText for text sections
  • AttachmentContent for structured attachment elements
  • MessageAttachmentDefault typings for schema consistency

No breaking changes were introduced.
The feature remains optional and only activates when footer is provided.

Summary by CodeRabbit

New Features

  • Message attachments now support displaying optional footer text with custom formatting and styling.

@Layyzyy Layyzyy requested review from a team as code owners November 8, 2025 18:57
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Nov 8, 2025

⚠️ No Changeset found

Latest commit: 115c403

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

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot Bot commented Nov 8, 2025

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

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Nov 8, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ Layyzyy
❌ Lay Sandeep Shah


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.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 8, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • packages/apps-engine/deno-runtime/deno.lock is excluded by !**/*.lock

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The 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

Cohort / File(s) Summary
Type Definitions
packages/core-typings/src/IMessage/MessageAttachment/MessageAttachmentBase.ts, packages/core-typings/src/IMessage/MessageAttachment/MessageAttachmentDefault.ts
Added optional footer?: string property to both MessageAttachmentBase and MessageAttachmentDefault types
Component Updates
apps/meteor/client/components/message/content/attachments/structure/AttachmentText.tsx
Extended AttachmentTextProps to include optional attachment and children fields; converted component to destructure these props; added conditional rendering of attachment.footer with neutral-600 color, c1 font scale, reduced opacity, and white-space handling styles
Component Usage
apps/meteor/client/components/message/content/attachments/DefaultAttachment.tsx
Updated AttachmentText usage to pass attachment prop and wrap Markdown rendering result as children

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Type additions are straightforward and consistent across files
  • Component prop changes follow clear destructuring patterns
  • Footer rendering logic is straightforward conditional UI
  • No complex business logic or state management involved

Poem

🐰 Footers now grace our attachments with pride,
With styling so fine on each message's ride,
Types extended, components refined,
A cleaner display for content aligned!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR adds footer rendering to attachments but does not address the core requirement from issue #37428 to increase character limits per line. Modify the PR to also increase the character limit per line in attachment messages as requested in issue #37428, or clarify if this is a separate follow-up 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 'feat: Add footer to messages' accurately describes the main change: adding footer support to message attachments.
Out of Scope Changes check ✅ Passed The changes are focused on adding footer rendering support to attachments. While this differs from the linked issue's focus on line length, the footer feature aligns with enhancing attachment UI capabilities.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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
Copy Markdown
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: 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 footer property is added at line 25, but lines 16-17 contain related comments suggesting footer and footer_icon should be grouped together. Consider moving the footer property closer to these comments for better organization.

Additionally, footer_icon is 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 20490af and 0b65991.

⛔ Files ignored due to path filters (1)
  • packages/apps-engine/deno-runtime/deno.lock is 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 footer field 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 attachment prop to AttachmentText enables 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 attachment and children fields, maintaining backward compatibility.


11-24: LGTM! Proper text wrapping styles.

The inline styles for whiteSpace, wordBreak, and overflowWrap ensure 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 text field which can be rendered as markdown via applyMarkdownIfRequires, the footer is always rendered as plain text.

Is this intentional, or should footer also support markdown rendering through the mrkdwn_in field?

@Layyzyy
Copy link
Copy Markdown
Author

Layyzyy commented Nov 8, 2025

This PR implements footer rendering in message attachments.

It does not modify character limits per line.
Issue #37428 refers to increasing text limit in attachments, which will be handled separately.

Please consider this PR independent from issue #37428 and remove the issue link.

@d-gubert d-gubert removed the request for review from a team November 11, 2025 12:28
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.

fix: Allow longer lines in attachments messages

2 participants