fix: long usernames push timestamp and right icons out of view#7109
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📜 Recent review details⏰ 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). (2)
WalkthroughAdded Storybook stories and long-name author fixtures for message header testing; extended MessageTime to accept an optional TextStyle prop; replaced Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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: 1
🧹 Nitpick comments (1)
app/containers/message/Message.stories.tsx (1)
408-419: Consider extracting repeated “icon stress-case” props in stories.This is purely maintainability, but pulling shared props into one constant would reduce repetition and make future scenario tweaks easier.
♻️ Optional cleanup
+const iconStressProps = { + isEdited: true, + isTranslated: true, + pinned: true, + type: E2E_MESSAGE_TYPE, + hasError: true, + isReadReceiptEnabled: true, + read: true +} as const; + export const Names = () => ( <> <Message msg='Small name (2 chars)' author={shortNameAuthor} useRealName /> - <Message - msg='Small name with icons' - author={shortNameAuthor} - useRealName - isEdited - isTranslated - pinned - type={E2E_MESSAGE_TYPE} - hasError - isReadReceiptEnabled - read - /> + <Message msg='Small name with icons' author={shortNameAuthor} useRealName {...iconStressProps} /> ... </> );Also applies to: 421-432, 434-445, 452-462, 464-474, 476-486
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/containers/message/Message.stories.tsx` around lines 408 - 419, Several Storybook entries render the Message component with the same "icon stress-case" props repeated (e.g., useRealName, isEdited, isTranslated, pinned, type/E2E_MESSAGE_TYPE, hasError, isReadReceiptEnabled, read); extract these shared props into a single constant (e.g., ICON_STRESS_PROPS or commonMessageProps) and spread that constant into each Message usage to remove duplication in Message.stories.tsx (look for Message components around the shortNameAuthor cases and the ranges noted: 408-419, 421-432, 434-445, 452-462, 464-474, 476-486).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/containers/message/User.tsx`:
- Around line 123-129: The username Text used as a press target (in the User
component) lacks accessibility semantics; update the Text element (the one with
props numberOfLines, ellipsizeMode, onPress and testID
`username-header-${username}`) to expose button semantics—either add
accessibilityRole="button" and accessible={true} plus a descriptive
accessibilityLabel (e.g., include username) and accessibilityHint where
appropriate, or replace it with a Pressable wrapper that forwards onPress and
testID and sets accessibilityRole="button" and accessible={true}; ensure the
onUserPress handler and displayed textContent remain unchanged.
---
Nitpick comments:
In `@app/containers/message/Message.stories.tsx`:
- Around line 408-419: Several Storybook entries render the Message component
with the same "icon stress-case" props repeated (e.g., useRealName, isEdited,
isTranslated, pinned, type/E2E_MESSAGE_TYPE, hasError, isReadReceiptEnabled,
read); extract these shared props into a single constant (e.g.,
ICON_STRESS_PROPS or commonMessageProps) and spread that constant into each
Message usage to remove duplication in Message.stories.tsx (look for Message
components around the shortNameAuthor cases and the ranges noted: 408-419,
421-432, 434-445, 452-462, 464-474, 476-486).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fa9527c7-4e3c-4e6e-af3c-e71909affa20
📒 Files selected for processing (3)
app/containers/message/Message.stories.tsxapp/containers/message/Time.tsxapp/containers/message/User.tsx
📜 Review details
⏰ 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). (3)
- GitHub Check: E2E Build iOS / ios-build
- GitHub Check: E2E Build Android / android-build
- GitHub Check: ESLint and Test / run-eslint-and-test
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: Rohit3523
Repo: RocketChat/Rocket.Chat.ReactNative PR: 6808
File: app/containers/MessageComposer/components/ComposerInput.tsx:337-341
Timestamp: 2026-04-04T21:34:27.535Z
Learning: In Rocket.Chat React Native, the markdown composer's autocomplete insertion (ComposerInput.tsx onAutocompleteItemSelected) does NOT need to add a space between an underscore italic delimiter `_` and a `@` or `#` mention sigil. The web platform (using the same rocket.chat/message-parser) does not add such a space either, so parity with web is the correct behavior. The previous learning about "space between `_` and mention sigil" applies only to test/story file content strings, not to the composer's runtime autocomplete behavior.
📚 Learning: 2026-03-15T13:55:42.038Z
Learnt from: Rohit3523
Repo: RocketChat/Rocket.Chat.ReactNative PR: 6911
File: app/containers/markdown/Markdown.stories.tsx:104-104
Timestamp: 2026-03-15T13:55:42.038Z
Learning: In Rocket.Chat React Native, the markdown parser requires a space between the underscore wrapping italic text and a mention sigil (_ mention _ instead of _mention_). Ensure stories and tests that include italic-wrapped mentions follow this form to guarantee proper parsing. Specifically, for files like app/containers/markdown/Markdown.stories.tsx, and any test/content strings that exercise italic-mentions, use the pattern _ mention _ (with spaces) to prevent the mention from being treated as plain text. Validate any test strings or story content accordingly.
Applied to files:
app/containers/message/Message.stories.tsx
🔇 Additional comments (3)
app/containers/message/Time.tsx (1)
11-21: Good extension point for message header layout.Adding optional
styleand composing it last in theTextstyle array is a clean, low-risk way to support caller-side spacing tweaks.app/containers/message/User.tsx (1)
36-47: Layout fix is solid for truncation + timestamp/icon preservation.
titleContainerwithflex: 1+minWidth: 0, usernamenumberOfLines={1}, and explicitMessageTimespacing achieves the intended header behavior.Also applies to: 122-132
app/containers/message/Message.stories.tsx (1)
31-47: Great story coverage for the reported regression.The new short/medium/long fixtures plus
NamesandUsernamesscenarios are well-targeted to validate truncation with timestamp and right-side icon combinations.Also applies to: 405-488
Proposed changes
Fixes layout issue where long usernames push the timestamp and right-side icons out of view.
Issue(s)
https://rocketchat.atlassian.net/browse/CORE-1981
How to test or reproduce
Screenshots
Types of changes
Checklist
Further comments
Summary by CodeRabbit
Tests
Style
New Features