Skip to content

fix: prevent username truncation in system messages with long topics#38236

Closed
dodaa08 wants to merge 1 commit intoRocketChat:developfrom
dodaa08:fix/username-Truncation
Closed

fix: prevent username truncation in system messages with long topics#38236
dodaa08 wants to merge 1 commit intoRocketChat:developfrom
dodaa08:fix/username-Truncation

Conversation

@dodaa08
Copy link
Contributor

@dodaa08 dodaa08 commented Jan 17, 2026

Proposed changes (including videos or screenshots)

When a system message contains a long room topic, the username gets truncated, This happens because the MessageNameContainer component shrinks to accommodate the long topic text in the flex layout.

Added flexShrink: 0 to the MessageNameContainer style in SystemMessage.tsx to prevent it from shrinking when the topic text is long.

Screenshot From 2026-01-18 01-16-17 Screenshot From 2026-01-18 01-28-05

Issue(s)

Fixes #38234

COMM-121

Steps to test or reproduce

  1. Open any channel in Rocket.Chat
  2. Change the room topic to a very long string (e.g., "Project Alpha Development Quick Links: Wiki | API Documentation | Sprint Board | Design Files | Meeting Notes | Deployment Pipeline | Status: Active Development | Sprint 47 | Release Target: Q2 2021")
  3. Observe the system message that appears
  4. Expected: Username displays fully without truncation
  5. Before fix: Username was truncated

Further comments

FlexShrink: 0 to the MessageNameContainer prevents it from shrinking in the flex layout when the MessageSystemBody (topic text) is long. This ensures the username always displays fully, while the topic text can still wrap naturally.

@dodaa08 dodaa08 requested a review from a team as a code owner January 17, 2026 20:00
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Jan 17, 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 17, 2026

⚠️ No Changeset found

Latest commit: f63cea4

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 17, 2026

Walkthrough

A CSS styling adjustment that prevents the MessageNameContainer from shrinking in flex layouts by setting flexShrink: 0. This resolves username truncation in system messages when displayed alongside long channel topics.

Changes

Cohort / File(s) Summary
Style fix for system message username
apps/meteor/client/components/message/variants/SystemMessage.tsx
Added flexShrink: 0 to MessageNameContainer style to prevent flex item shrinkage and avoid username truncation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • dougfabris

Poem

🐰 A tiny flex fix, oh so light,
Usernames now shine, never shrink from sight!
No truncation tricks, just flexShrink: 0,
The admin shines proud, full-named glow! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: preventing username truncation in system messages with long topics by adding flexShrink: 0 to MessageNameContainer.
Linked Issues check ✅ Passed The PR directly addresses issue #38234 by preventing MessageNameContainer from shrinking, ensuring usernames display fully without truncation when topic text is long.
Out of Scope Changes check ✅ Passed The change is narrowly scoped to the specific UI bug; only one line modified in SystemMessage.tsx to add flexShrink: 0, with no unrelated alterations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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

@codecov
Copy link

codecov bot commented Jan 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.65%. Comparing base (37e7b75) to head (f63cea4).
⚠️ Report is 36 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #38236      +/-   ##
===========================================
- Coverage    70.66%   70.65%   -0.02%     
===========================================
  Files         3135     3135              
  Lines       108592   108592              
  Branches     19555    19542      -13     
===========================================
- Hits         76740    76724      -16     
- Misses       29845    29861      +16     
  Partials      2007     2007              
Flag Coverage Δ
e2e 60.30% <ø> (-0.02%) ⬇️
e2e-api 48.01% <ø> (+<0.01%) ⬆️
unit 71.72% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@dougfabris dougfabris left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution 🚀
As you can see this component lives in fuselage which is our components library.
The correct fix should be done there, would you up to raise a PR fixing this property there?

@dougfabris dougfabris added the area: ui Touches the code on client side label Jan 26, 2026
@dodaa08
Copy link
Contributor Author

dodaa08 commented Jan 27, 2026

Thanks for the contribution 🚀 As you can see this component lives in fuselage which is our components library. The correct fix should be done there, would you up to raise a PR fixing this property there?

Sure, let me take a look!

@dodaa08
Copy link
Contributor Author

dodaa08 commented Jan 27, 2026

Thanks for the contribution 🚀 As you can see this component lives in fuselage which is our components library. The correct fix should be done there, would you up to raise a PR fixing this property there?

RocketChat/fuselage#1850

Hi, I have added a PR fixing this issue in Fuselage Repo.

@dougfabris
Copy link
Member

Thanks for the contribution 🚀
I'm closing this one since we're going to fix in fuselage

@dougfabris dougfabris closed this Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ui Touches the code on client side community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Username gets truncated in system messages with long Channel topics

3 participants