Skip to content

Conversation

diegolmello
Copy link
Member

@diegolmello diegolmello commented Oct 14, 2025

Proposed changes

  • Fixes the file rendering as URL
  • Removed unused props from Markdown
  • Added file stories

Issue(s)

https://rocketchat.atlassian.net/browse/NATIVE-1049

How to test or reproduce

Screenshots

Before After
image image

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

Summary by CodeRabbit

  • New Features

    • Improved file-attachment preview in replies for clearer filename display.
  • Style

    • Unified Markdown appearance by removing custom color overrides and inline styles.
    • Consistent default styling across context blocks, attachments, canned responses, E2E guide, and room info.
  • Refactor

    • Simplified Markdown rendering and reduced unnecessary props; Markdown now renders only when message text exists.
  • Documentation

    • Added Storybook examples for file attachments and reply scenarios, including large-font variants.

@diegolmello diegolmello marked this pull request as ready for review October 14, 2025 12:35
@diegolmello diegolmello temporarily deployed to approve_e2e_testing October 14, 2025 12:35 — with GitHub Actions Inactive
Copy link
Contributor

coderabbitai bot commented Oct 14, 2025

Walkthrough

Removed theme-based color/styling from Markdown render paths, simplified Markdown props/API, dropped style/isReply from attachment component props and interfaces, changed Reply to use MarkdownPreview for file-only attachments, stopped forwarding some Markdown props from Message content, and added Storybook stories for file attachments/replies.

Changes

Cohort / File(s) Change summary
Markdown API simplification
app/containers/markdown/index.tsx
Removed public props: tmid, numberOfLines, customEmojis, enableMessageParser, testID, style; tightened imports.
UIKit context Markdown
app/containers/UIKit/index.tsx
Context blocks now return MarkdownPreview without theme-based color styling; removed useContext-based theming for that path.
Attachments components cleanup
app/containers/message/Components/Attachments/Attachments.tsx, app/containers/message/Components/Attachments/Audio.tsx, app/containers/message/Components/Attachments/Video.tsx, app/containers/message/Components/Attachments/Image/Container.tsx, app/containers/message/Components/Attachments/Image/definitions.ts, app/containers/message/Components/Attachments/CollapsibleQuote/index.tsx, app/containers/message/interfaces.ts
Dropped style/isReply from types and component signatures; removed style props passed to child components; Markdown rendering is conditional on msg where applicable; removed related StyleProp/TextStyle imports.
Reply behavior update
app/containers/message/Components/Attachments/Reply.tsx
Added MarkdownPreview import; Description uses MarkdownPreview for file attachments with no text else Markdown; removed theme param and theme-driven styling; updated memo dependencies and prop shapes.
Message content adjustments
app/containers/message/Content.tsx
Stopped passing enableMessageParser, tmid, and testID to Markdown, changing isPreview-dependent rendering likelihood.
Storybook additions / markdown story tweak
app/containers/markdown/Markdown.stories.tsx, app/containers/message/Message.stories.tsx
Removed color override in Links story; added story exports showcasing file attachments and replies in normal and large font variants.
Views styling removal
app/views/CannedResponseDetail.tsx, app/views/E2EHowItWorksView.tsx, app/views/RoomInfoView/Item.tsx
Removed local itemContent/info style definitions and removed style props passed to Markdown; components now rely on default Markdown styling.

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant MR as MessageRenderer
  participant A as Attachments
  participant R as Reply
  participant MD as Markdown
  participant MP as MarkdownPreview

  U->>MR: Render message
  MR->>A: Render attachments (no style/isReply props)
  alt message has reply
    A->>R: Render reply block
    alt attachment.type == 'file' AND no text
      R-->>MP: Render filename via MarkdownPreview
    else
      R-->>MD: Render description via Markdown (username/emojis)
    end
  else
    A-->>MD: Render msg only when msg exists
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • OtavioStasiak

Poem

I nibble through props, light as a breeze,
Styles hop away like leaves from trees.
Markdown trimmed, previews take the floor,
Attachments leaner than before.
Thump-thump, little rabbit cheers—refactor galore! 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Linked Issues Check ⚠️ Warning The changes detailed in the summary focus on removing style props and adding storybook stories but do not include any modifications to URL detection or handling logic required by NATIVE-1049 to prevent filenames that look like URLs from opening in a browser. There is no evidence of the core bugfix implementation for treating such filenames as downloadable attachments. Add or include the code changes that detect filenames formatted as URLs and ensure they are rendered as files (downloadable attachments) rather than as navigable links per the linked issue requirements.
Out of Scope Changes Check ⚠️ Warning This PR includes widespread removal of styling and isReply props across multiple components and adds new storybook exports, none of which relate to the URL rendering bug described in NATIVE-1049. These changes introduce unrelated refactors and UI cleanup in the same branch as the bugfix. Isolate the URL rendering fix in this PR and move the styling prop removals and storybook additions into separate, dedicated pull requests to keep the scope focused and reviewable.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title “fix: File rendering as URL” directly refers to the primary change of addressing files being rendered as URLs and is concise and focused on that fix. It avoids vague terms and clearly signals a bugfix. Although it could be slightly more descriptive, it still conveys the main intent.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix.file-name-url

📜 Recent 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 c034d18 and 2e693de.

⛔ Files ignored due to path filters (3)
  • app/containers/UIKit/__snapshots__/UiKitModal.test.tsx.snap is excluded by !**/*.snap
  • app/containers/markdown/__snapshots__/Markdown.test.tsx.snap is excluded by !**/*.snap
  • app/containers/message/__snapshots__/Message.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (13)
  • app/containers/UIKit/index.tsx (1 hunks)
  • app/containers/markdown/Markdown.stories.tsx (1 hunks)
  • app/containers/markdown/index.tsx (1 hunks)
  • app/containers/message/Components/Attachments/Attachments.tsx (3 hunks)
  • app/containers/message/Components/Attachments/Audio.tsx (2 hunks)
  • app/containers/message/Components/Attachments/CollapsibleQuote/index.tsx (1 hunks)
  • app/containers/message/Components/Attachments/Image/Container.tsx (1 hunks)
  • app/containers/message/Components/Attachments/Image/definitions.ts (0 hunks)
  • app/containers/message/Components/Attachments/Reply.tsx (6 hunks)
  • app/containers/message/Components/Attachments/Video.tsx (3 hunks)
  • app/containers/message/Content.tsx (0 hunks)
  • app/containers/message/Message.stories.tsx (3 hunks)
  • app/containers/message/interfaces.ts (1 hunks)
💤 Files with no reviewable changes (2)
  • app/containers/message/Components/Attachments/Image/definitions.ts
  • app/containers/message/Content.tsx
🚧 Files skipped from review as they are similar to previous changes (3)
  • app/containers/message/Components/Attachments/CollapsibleQuote/index.tsx
  • app/containers/message/Components/Attachments/Image/Container.tsx
  • app/containers/markdown/Markdown.stories.tsx
🧰 Additional context used
🧬 Code graph analysis (4)
app/containers/message/Components/Attachments/Reply.tsx (2)
app/definitions/IAttachment.ts (1)
  • IAttachment (9-48)
app/definitions/IEmoji.ts (1)
  • TGetCustomEmoji (23-23)
app/containers/UIKit/index.tsx (2)
app/containers/markdown/Markdown.stories.tsx (1)
  • Text (51-59)
app/lib/constants/colors.ts (1)
  • themes (304-304)
app/containers/message/Components/Attachments/Attachments.tsx (1)
app/containers/message/interfaces.ts (1)
  • IMessageAttachments (18-24)
app/containers/message/Components/Attachments/Audio.tsx (1)
app/containers/message/hooks/useMediaAutoDownload.tsx (1)
  • useMediaAutoDownload (51-188)
🔇 Additional comments (9)
app/containers/message/interfaces.ts (1)

1-24: LGTM! Interface cleanup aligns with prop removal across attachment components.

The removal of style and isReply from IMessageAttachments is consistent with the broader refactoring across attachment components (Audio, Video, Image, etc.) where these props are no longer needed.

app/containers/markdown/index.tsx (1)

24-35: LGTM! Markdown API simplified by removing unused props.

The removed props (tmid, numberOfLines, customEmojis, enableMessageParser, testID, style) are not referenced in the component implementation, making this a clean API surface reduction.

app/containers/message/Components/Attachments/Audio.tsx (1)

18-29: LGTM! Props removed and conditional rendering added correctly.

The removal of style and isReply props aligns with interface changes, and the conditional rendering {msg ? <Markdown ... /> : null} prevents attempting to render when msg is undefined.

app/containers/message/Message.stories.tsx (2)

983-1103: LGTM! Excellent Storybook coverage for file attachments.

These new stories provide comprehensive test cases for the PR's main objective - ensuring file attachments with URL-like names render correctly. The coverage includes various scenarios (single/multiple files, with/without descriptions) in both normal and large font modes.


1175-1342: LGTM! Good coverage for file attachments in reply contexts.

These stories test file attachments within reply/quote contexts, including files with descriptions and multiple files. This ensures the fix works correctly across different message types.

app/containers/message/Components/Attachments/Attachments.tsx (1)

18-76: LGTM! Attachment props correctly updated throughout.

The removal of style and isReply from the component signature and all child component calls (Image, Audio, Video) is consistent with the interface changes and maintains correct prop passing.

app/containers/message/Components/Attachments/Reply.tsx (2)

132-142: Excellent rationale for using MarkdownPreview, but numberOfLines={0} needs attention.

The comment clearly explains why MarkdownPreview is used for file names (to prevent treating them as URLs) - this directly addresses the PR objective. However, numberOfLines={0} on line 139 may hide content per previous review comments.

Consider this fix:

  if (isFileName) {
-   return <MarkdownPreview msg={text} numberOfLines={0} />;
+   return <MarkdownPreview msg={text} />;
  }

255-277: LGTM! Description and Markdown rendering updated correctly.

The removal of theme from the Description component and the conditional Markdown rendering on line 277 are both correct improvements.

app/containers/message/Components/Attachments/Video.tsx (1)

37-111: LGTM! Video component props cleaned up correctly.

The removal of style and isReply from the interface and component signature, along with the conditional Markdown rendering, aligns perfectly with the changes in Audio.tsx and other attachment components.


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.

@diegolmello diegolmello temporarily deployed to experimental_ios_build October 14, 2025 12:38 — with GitHub Actions Inactive
@diegolmello diegolmello temporarily deployed to experimental_android_build October 14, 2025 12:38 — with GitHub Actions Inactive
Copy link
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)
app/containers/message/Components/Attachments/CollapsibleQuote/index.tsx (1)

38-42: Consider removing the unused fieldText style.

The fieldText style definition is no longer used after removing the style prop from the Markdown component at line 96.

Apply this diff to remove the unused style:

 	fieldContainer: {
 		flexDirection: 'column',
 		paddingLeft: 10,
 		paddingVertical: 10
 	},
-	fieldText: {
-		fontSize: 15,
-		padding: 10,
-		...sharedStyles.textRegular
-	},
 	fieldTitle: {
 		fontSize: 15,
 		...sharedStyles.textBold
 	},
📜 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 d3b9ea6 and c034d18.

⛔ Files ignored due to path filters (3)
  • app/containers/UIKit/__snapshots__/UiKitModal.test.tsx.snap is excluded by !**/*.snap
  • app/containers/markdown/__snapshots__/Markdown.test.tsx.snap is excluded by !**/*.snap
  • app/containers/message/__snapshots__/Message.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (16)
  • app/containers/UIKit/index.tsx (1 hunks)
  • app/containers/markdown/Markdown.stories.tsx (1 hunks)
  • app/containers/markdown/index.tsx (1 hunks)
  • app/containers/message/Components/Attachments/Attachments.tsx (3 hunks)
  • app/containers/message/Components/Attachments/Audio.tsx (2 hunks)
  • app/containers/message/Components/Attachments/CollapsibleQuote/index.tsx (1 hunks)
  • app/containers/message/Components/Attachments/Image/Container.tsx (1 hunks)
  • app/containers/message/Components/Attachments/Image/definitions.ts (0 hunks)
  • app/containers/message/Components/Attachments/Reply.tsx (6 hunks)
  • app/containers/message/Components/Attachments/Video.tsx (3 hunks)
  • app/containers/message/Content.tsx (0 hunks)
  • app/containers/message/Message.stories.tsx (3 hunks)
  • app/containers/message/interfaces.ts (1 hunks)
  • app/views/CannedResponseDetail.tsx (1 hunks)
  • app/views/E2EHowItWorksView.tsx (1 hunks)
  • app/views/RoomInfoView/Item.tsx (1 hunks)
💤 Files with no reviewable changes (2)
  • app/containers/message/Components/Attachments/Image/definitions.ts
  • app/containers/message/Content.tsx
🧰 Additional context used
🧬 Code graph analysis (5)
app/containers/message/Components/Attachments/Audio.tsx (1)
app/containers/message/hooks/useMediaAutoDownload.tsx (1)
  • useMediaAutoDownload (51-188)
app/containers/UIKit/index.tsx (2)
app/containers/markdown/Markdown.stories.tsx (1)
  • Text (51-59)
app/lib/constants/colors.ts (1)
  • themes (304-304)
app/containers/message/Components/Attachments/Reply.tsx (2)
app/definitions/IAttachment.ts (1)
  • IAttachment (9-48)
app/definitions/IEmoji.ts (1)
  • TGetCustomEmoji (23-23)
app/containers/message/Components/Attachments/Attachments.tsx (1)
app/containers/message/interfaces.ts (1)
  • IMessageAttachments (10-16)
app/views/RoomInfoView/Item.tsx (1)
app/containers/MessageComposer/components/Toolbar/Markdown.tsx (1)
  • Markdown (9-46)
⏰ 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). (1)
  • GitHub Check: ESLint and Test / run-eslint-and-test
🔇 Additional comments (14)
app/views/RoomInfoView/Item.tsx (1)

24-24: LGTM! Markdown styling simplified.

The removal of the style prop aligns with the PR's broader refactor to standardize Markdown rendering with default styling across the codebase.

app/containers/markdown/Markdown.stories.tsx (1)

127-127: LGTM! Story updated for default styling.

The story correctly demonstrates Markdown link rendering without custom styling, consistent with the broader refactor to remove theme-dependent styling from Markdown components.

app/views/CannedResponseDetail.tsx (1)

80-80: LGTM! Markdown simplified in canned response detail.

The removal of style customization is consistent with the broader refactor. Content will now render with default Markdown styling instead of custom font/color settings.

app/containers/UIKit/index.tsx (1)

64-74: LGTM! UIKit Markdown rendering simplified.

The removal of theme-based styling from MarkdownPreview and Markdown components in the UIKit context simplifies the rendering logic. However, ensure that UIKit messages remain visually distinguishable and that the removal of color styling doesn't impact the user experience for UIKit interactions.

app/views/E2EHowItWorksView.tsx (1)

33-36: LGTM! E2E help content simplified.

The removal of custom styling from the E2E "How It Works" view Markdown components is consistent with the broader refactor to standardize Markdown rendering with default styles.

app/containers/message/Message.stories.tsx (1)

983-1342: Excellent test coverage for file attachments!

The four new story exports provide comprehensive coverage for file attachment scenarios:

  • Single files with filenames
  • Files with markdown descriptions
  • Multiple file attachments
  • Both normal and large font variants

These stories effectively demonstrate the fix for the issue where attachments with URL-like filenames were opening in the browser. The use of type: 'file', title, and title_link properties correctly represents file attachments.

app/containers/message/interfaces.ts (1)

1-16: No remaining style/isReply usages found; safe to merge.

app/containers/markdown/index.tsx (1)

1-35: Verified: No <Markdown> usages with removed props.
All outdated props (tmid, numberOfLines, customEmojis, enableMessageParser, testID, style) have been dropped from callsites.

app/containers/message/Components/Attachments/Image/Container.tsx (1)

12-20: LGTM!

The removal of style and isReply props simplifies the component interface and aligns with the broader refactoring across attachment components. The Markdown rendering now uses default styling consistently.

Also applies to: 37-37

app/containers/message/Components/Attachments/Reply.tsx (2)

151-151: Correct memoization update.

Properly updated the memoization check to include attachment.type comparison, which is necessary since the Description component now branches on this field.


132-142: Approve MarkdownPreview usage for file attachments

The attachment.type === 'file' check correctly covers all file‐type cases and !attachment.text reliably isolates filename‐only attachments for MarkdownPreview.

app/containers/message/Components/Attachments/Video.tsx (1)

37-43: LGTM!

The interface simplification and conditional Markdown rendering are consistent with the changes across other attachment components (Audio, Image). The component now uses default Markdown styling and only renders the description when msg is present.

Also applies to: 73-73, 105-105

app/containers/message/Components/Attachments/Attachments.tsx (1)

19-19: LGTM!

The parent Attachments component correctly propagates the interface simplification by no longer passing style and isReply props to child attachment components. This aligns with the updated IMessageAttachments interface and the changes in the child components (Image, Audio, Video).

Also applies to: 34-44, 48-48, 53-61

app/containers/message/Components/Attachments/Audio.tsx (1)

11-16: LGTM!

The interface simplification and conditional Markdown rendering are consistent with the parallel changes in Video and Image attachment components. The component maintains its audio playback functionality while simplifying the description rendering.

Also applies to: 18-18, 26-26

Copy link
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: 1

🧹 Nitpick comments (6)
app/containers/message/Components/Attachments/CollapsibleQuote/index.tsx (1)

96-96: LGTM! Remove unused fieldText style.

The Markdown component now uses default styling. Consider removing the now-unused fieldText style definition at lines 38-42.

Apply this diff to remove the unused style:

 	fieldTitle: {
 		fontSize: 15,
 		...sharedStyles.textBold
 	},
-	fieldText: {
-		fontSize: 15,
-		padding: 10,
-		...sharedStyles.textRegular
-	},
 	marginTop: {
 		marginTop: 4
 	},
app/containers/message/Components/Attachments/Attachments.tsx (1)

18-22: API reduction is cohesive; consider memo comparator breadth

  • Removing style/isReply and passing only required props to children is consistent.
  • The memo comparator only checks attachments; if author/showAttachment/getCustomEmoji change, children won’t re-render. If that’s a concern, include them in the comparator (or keep as-is if performance > freshness here).

Example tweak:

- (prevProps, nextProps) => dequal(prevProps.attachments, nextProps.attachments)
+ (prevProps, nextProps) =>
+   dequal(prevProps.attachments, nextProps.attachments) &&
+   prevProps.author === nextProps.author &&
+   prevProps.showAttachment === nextProps.showAttachment &&
+   prevProps.getCustomEmoji === nextProps.getCustomEmoji

Also applies to: 30-45, 47-49, 75-76

app/containers/message/Components/Attachments/Reply.tsx (2)

122-143: Using MarkdownPreview for file-name text prevents linkification — this addresses the bug

Good call on treating file attachments (with no explicit text) as plain preview to avoid URL-like filenames becoming links.

Please add a story/E2E covering a file named like “https://foo.txt” inside a reply to ensure it renders as text and tapping downloads (not opens browser). I can help scaffold it.


277-277: Conditional Markdown for msg is fine; tiny safety nit

If user.username can be undefined in some contexts, pass username={user?.username} to avoid crashes. If guaranteed by context, ignore.

app/containers/message/Message.stories.tsx (2)

983-1042: Consider adding edge cases for URL-like filenames.

The new story demonstrates file attachments well, but doesn't include test cases for the core bug being fixed: attachments with filenames that resemble URLs (e.g., "https://example.com", "www.google.com").

Consider adding examples like:

{
  type: 'file',
  title: 'https://example.com',
  title_link: '/file-upload/edge123/https-example.com'
},
{
  type: 'file',
  title: 'www.google.com',
  title_link: '/file-upload/edge456/www-google.com'
}

This would ensure the fix is properly visible and testable in Storybook.


1175-1226: Consider adding URL-like filename edge cases in reply context.

Similar to the standalone file attachments story, this reply-with-file story would benefit from including edge cases where the file title resembles a URL to test the fix in the reply/quote context.

📜 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 d3b9ea6 and c034d18.

⛔ Files ignored due to path filters (3)
  • app/containers/UIKit/__snapshots__/UiKitModal.test.tsx.snap is excluded by !**/*.snap
  • app/containers/markdown/__snapshots__/Markdown.test.tsx.snap is excluded by !**/*.snap
  • app/containers/message/__snapshots__/Message.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (16)
  • app/containers/UIKit/index.tsx (1 hunks)
  • app/containers/markdown/Markdown.stories.tsx (1 hunks)
  • app/containers/markdown/index.tsx (1 hunks)
  • app/containers/message/Components/Attachments/Attachments.tsx (3 hunks)
  • app/containers/message/Components/Attachments/Audio.tsx (2 hunks)
  • app/containers/message/Components/Attachments/CollapsibleQuote/index.tsx (1 hunks)
  • app/containers/message/Components/Attachments/Image/Container.tsx (1 hunks)
  • app/containers/message/Components/Attachments/Image/definitions.ts (0 hunks)
  • app/containers/message/Components/Attachments/Reply.tsx (6 hunks)
  • app/containers/message/Components/Attachments/Video.tsx (3 hunks)
  • app/containers/message/Content.tsx (0 hunks)
  • app/containers/message/Message.stories.tsx (3 hunks)
  • app/containers/message/interfaces.ts (1 hunks)
  • app/views/CannedResponseDetail.tsx (1 hunks)
  • app/views/E2EHowItWorksView.tsx (1 hunks)
  • app/views/RoomInfoView/Item.tsx (1 hunks)
💤 Files with no reviewable changes (2)
  • app/containers/message/Content.tsx
  • app/containers/message/Components/Attachments/Image/definitions.ts
🧰 Additional context used
🧬 Code graph analysis (8)
app/containers/message/Components/Attachments/Attachments.tsx (1)
app/containers/message/interfaces.ts (1)
  • IMessageAttachments (10-16)
app/containers/message/Components/Attachments/Image/Container.tsx (1)
app/containers/MessageComposer/components/Toolbar/Markdown.tsx (1)
  • Markdown (9-46)
app/containers/message/Components/Attachments/Audio.tsx (1)
app/containers/message/hooks/useMediaAutoDownload.tsx (1)
  • useMediaAutoDownload (51-188)
app/views/CannedResponseDetail.tsx (1)
app/containers/MessageComposer/components/Toolbar/Markdown.tsx (1)
  • Markdown (9-46)
app/containers/UIKit/index.tsx (2)
app/containers/markdown/Markdown.stories.tsx (1)
  • Text (51-59)
app/lib/constants/colors.ts (1)
  • themes (304-304)
app/containers/message/Message.stories.tsx (1)
ios/RocketChat Watch App/Formatters/MessageFormatter.swift (1)
  • date (63-74)
app/containers/message/Components/Attachments/Reply.tsx (2)
app/definitions/IAttachment.ts (1)
  • IAttachment (9-48)
app/definitions/IEmoji.ts (1)
  • TGetCustomEmoji (23-23)
app/containers/message/Components/Attachments/Video.tsx (1)
app/containers/MessageComposer/components/Toolbar/Markdown.tsx (1)
  • Markdown (9-46)
⏰ 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). (1)
  • GitHub Check: ESLint and Test / run-eslint-and-test
🔇 Additional comments (15)
app/views/E2EHowItWorksView.tsx (1)

33-36: LGTM! Consistent Markdown styling removal.

All four Markdown components now use default styling. Ensure the removed infoStyle was not providing critical visual formatting for the E2E help content.

app/containers/message/Components/Attachments/Image/Container.tsx (2)

34-40: LGTM! Simplified conditional rendering.

The Markdown rendering now consistently uses username and getCustomEmoji when msg is present, removing the previous style-based conditional path.


12-20: Approve removal of style and isReply props. Verification confirms no call sites pass these props.

app/views/CannedResponseDetail.tsx (1)

80-80: LGTM! Markdown rendering simplified.

The removal of the itemContent style aligns with the broader refactor to standardize Markdown rendering across the codebase.

app/containers/message/Components/Attachments/Audio.tsx (2)

11-16: LGTM! Interface simplified consistently.

The removal of style and isReply props aligns with the broader API simplification across attachment components.


24-29: Conditional Markdown rendering aligned across attachments
Audio.tsx now only renders Markdown when msg is truthy, matching the behavior in Video.tsx and Reply.tsx; no changes required.

app/containers/markdown/index.tsx (1)

24-35: Removed Markdown props verified – no remaining references
Search across .tsx/.jsx files confirmed no usages of tmid, numberOfLines, customEmojis, enableMessageParser, testID, or style. Breaking change validated.

app/containers/message/interfaces.ts (1)

10-16: Verify removal of style and isReply in all IMessageAttachments consumers
Automated search found no matches; manually confirm that Attachments.tsx, Image, Audio, and Video components no longer reference these props.

app/views/RoomInfoView/Item.tsx (1)

24-24: Confirm Markdown styling change
Default Markdown rendering now uses fontSize 16 (vs previous 14) and italics for empty content. Ensure the larger text size and italic treatment are acceptable for RoomInfo items.

app/containers/markdown/Markdown.stories.tsx (1)

127-127: Story update aligns with styling removal

Switching to plain Markdown here matches the new API surface and styling approach.

app/containers/UIKit/index.tsx (1)

64-66: Context blocks: move to MarkdownPreview — good cleanup

Removing theme styling and using MarkdownPreview in context is consistent with the PR changes.

app/containers/message/Components/Attachments/Video.tsx (1)

73-76: Approve prop simplification and msg rendering—msg derives solely from attachment.description, so no filename linkification risk.

app/containers/message/Components/Attachments/Reply.tsx (1)

219-232: Allow file attachments to remain clickable even when message_link is set
Replace the disabled prop in Reply.tsx:

-disabled={!!(loading || attachment.message_link)}
+disabled={!!(
+  loading ||
+  (attachment.message_link && !(attachment.type === 'file' && attachment.title_link))
+)}

Verify whether any file-type reply attachments include a message_link.

app/containers/message/Message.stories.tsx (2)

1044-1103: LGTM! Consistent large font variant.

The large font variant properly mirrors the normal font story structure.


1291-1342: LGTM! Consistent large font variant for replies with files.

The large font variant properly mirrors the normal font story structure for reply-with-file scenarios.

Comment on lines +72 to 75
return <MarkdownPreview msg={element.text} numberOfLines={0} />;
}
return <Markdown msg={element.text} style={[isContext && { color: themes[theme].fontSecondaryInfo }]} />;
return <Markdown msg={element.text} />;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

numberOfLines={0} can be invalid in RN Text trees — confirm MarkdownPreview behavior

RN Text expects numberOfLines > 0; passing 0 may be ignored or cause issues if forwarded. If unlimited lines are desired, omit the prop.

Apply this minimal change if safe:

- return <MarkdownPreview msg={element.text} numberOfLines={0} />;
+ return <MarkdownPreview msg={element.text} />;

To check other occurrences:


🏁 Script executed:

#!/bin/bash
rg -n "MarkdownPreview.*numberOfLines=\{0\}"

Length of output: 323


🏁 Script executed:

#!/bin/bash
# Find the file(s) defining MarkdownPreview
rg -l "MarkdownPreview" -g "*.tsx" | grep -vE "index.tsx|Reply.tsx"

# Show definition and prop types
rg -n "MarkdownPreview" -C5 -g "*.tsx"

# Look for numberOfLines usage within its implementation
rg -n "numberOfLines" -C5 -g "*.tsx"

Length of output: 80723


Remove numberOfLines={0} from MarkdownPreview
Delete the prop in all instances to avoid passing 0 to RN Text, which hides content.
Occurrences:

  • app/containers/UIKit/index.tsx (plain_text at line 64, mrkdwn at line 72)
  • app/containers/message/Components/Attachments/Reply.tsx (line 139)
    Use <MarkdownPreview msg={…} /> instead.
🤖 Prompt for AI Agents
In app/containers/UIKit/index.tsx around lines 72–75 (and also check the
plain_text at ~line 64) and in
app/containers/message/Components/Attachments/Reply.tsx around line 139, remove
the prop numberOfLines={0} from all <MarkdownPreview> usages so RN Text isn’t
passed 0 which hides content; update each usage to call MarkdownPreview with
only the msg prop (i.e., remove the numberOfLines attribute).

@diegolmello diegolmello had a problem deploying to upload_experimental_android October 14, 2025 13:11 — with GitHub Actions Error
Copy link

Android Build Available

Rocket.Chat Experimental 4.66.0.107562

Internal App Sharing: https://play.google.com/apps/test/RQVpXLytHNc/ahAO29uNQJ_NSkLypKZjQQNmS2pxnwgNRqjMBp3tPEngHaR-KNwMbkLUCwg_FKhAch9QVcp7bGho1Vkx5dFMsugXOB

Copy link

iOS Build Available

Rocket.Chat Experimental 4.66.0.107563

Comment on lines -30 to -39
tmid?: string;
numberOfLines?: number;
customEmojis?: boolean;
useRealName?: boolean;
channels?: IUserChannel[];
enableMessageParser?: boolean;
// TODO: Refactor when migrate Room
navToRoomInfo?: Function;
testID?: string;
style?: StyleProp<TextStyle>[];
Copy link
Member Author

Choose a reason for hiding this comment

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

This is technically out of scope, but I found it and wanted to fix it 🙈
I can open as a separate PR, if you think it's too chaotic.

Copy link
Contributor

@OtavioStasiak OtavioStasiak left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@diegolmello diegolmello requested a deployment to experimental_android_build October 15, 2025 17:22 — with GitHub Actions Waiting
@diegolmello diegolmello requested a deployment to official_android_build October 15, 2025 17:22 — with GitHub Actions Waiting
@diegolmello diegolmello requested a deployment to experimental_ios_build October 15, 2025 17:22 — with GitHub Actions Waiting
@diegolmello diegolmello merged commit aa94a59 into develop Oct 15, 2025
5 of 10 checks passed
@diegolmello diegolmello deleted the fix.file-name-url branch October 15, 2025 17:25
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.

2 participants