-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: prevent message text from being cut off in channel list #6815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
fix: prevent message text from being cut off in channel list #6815
Conversation
- Add proper flex constraints and overflow handling to prevent text clipping - Increase base row height to accommodate larger font sizes - Ensure ellipsis truncation works correctly at all font scales - Add width constraints and flexShrink to text containers - Fix text truncation to show ellipsis instead of cutting mid-word
WalkthroughWraps the markdown preview in a new container, adjusts cross-platform align/width handling for last message layout, tightens flex constraints in RoomItem styles, adds small-font base row height constants and conditional row-height logic, and introduces a hairline-based border width in the wrapper styles. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
|
Screenshot for before and after seems same Also can you please add images like this | Scale | Before | After | It will be easy to compare the changes |
|
The major issue was with smallest font... |
There was a problem hiding this 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 (2)
app/containers/RoomItem/Wrapper.tsx (1)
14-14: Remove unnecessary fallback operator.
StyleSheet.hairlineWidthalways returns a number (minimum 0), so the|| 0fallback is unnecessary.Apply this diff:
- const borderWidth = Math.max(StyleSheet.hairlineWidth || 0, 0.5); + const borderWidth = Math.max(StyleSheet.hairlineWidth, 0.5);app/lib/hooks/useResponsiveLayout/useResponsiveLayout.tsx (1)
23-25: Confusing constant naming: "SMALL_FONT" constants are numerically larger.The naming is counterintuitive:
BASE_ROW_HEIGHT_SMALL_FONT = 82is larger thanBASE_ROW_HEIGHT = 75BASE_ROW_HEIGHT_CONDENSED_SMALL_FONT = 68is larger thanBASE_ROW_HEIGHT_CONDENSED = 60Consider renaming to clarify intent, e.g.:
BASE_ROW_HEIGHT_INCREASED_FOR_SMALL_FONTorBASE_ROW_HEIGHT_SMALL_FONT_ADJUSTEDThis would better convey that these are compensatory increases to prevent clipping at reduced font scales.
📜 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 selected for processing (3)
app/containers/RoomItem/LastMessage.tsx(3 hunks)app/containers/RoomItem/Wrapper.tsx(3 hunks)app/lib/hooks/useResponsiveLayout/useResponsiveLayout.tsx(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- app/containers/RoomItem/LastMessage.tsx
🔇 Additional comments (2)
app/containers/RoomItem/Wrapper.tsx (1)
26-27: Border width change appears unrelated to text truncation fix.While the border styling enhancement is fine, it doesn't appear to directly address the PR's primary objective of preventing message text from being cut off. The ellipsis truncation logic is likely implemented in other files not shown in this review (e.g., styles.ts, LastMessage.tsx).
Please confirm that:
- The core text truncation fix (ellipsis, flexShrink, etc.) is properly implemented in the related style and layout files.
- This border change is intentional and not an unrelated cosmetic tweak.
app/lib/hooks/useResponsiveLayout/useResponsiveLayout.tsx (1)
33-38: Unable to verify row height UX impact due to infrastructure limitations.The repository is currently inaccessible through both direct codebase access and GitHub CLI queries, preventing verification of:
- Constant values for row height calculations at small font scales
- Whether test coverage exists for row height behavior
- The specific feedback from reviewer Rohit3523 regarding "extra bottom space" hiding channels
- Current status of any post-review discussions or fixes
The original concerns remain valid and warrant manual verification:
- Confirm the height increase for
fontScale < 0.9doesn't reduce visible channel count in practice- Coordinate with Rohit3523 to confirm whether the concern persists or has been resolved
- Evaluate whether style-based solutions (ellipsis, flexShrink) could address text clipping without increasing row heights
|
have tested and fixed all issues mentioned by u... |

Fixes #4740
In the channel list, long message previews were cut off mid-word or mid-sentence without an ellipsis, especially when the device font size was increased.
Before vs After Comparison
What We Fixed
...) instead of cutting text abruptly.Result
This ensures message previews are always readable and properly truncated at any device font size.
Summary by CodeRabbit
Style
Bug Fixes
Notes
✏️ Tip: You can customize this high-level summary in your review settings.