fix: truncate long custom status text in sidebar (#6776) - #6787
fix: truncate long custom status text in sidebar (#6776)#6787vps-time-1 wants to merge 3 commits into
Conversation
|
|
WalkthroughRefactors CustomStatus so List.Item's title is rendered via a single-line, ellipsized Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 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 (1)
app/views/SidebarView/components/CustomStatus.tsx(2 hunks)
🔇 Additional comments (1)
app/views/SidebarView/components/CustomStatus.tsx (1)
2-2: LGTM! Text import added for ellipsis handling.The addition of
Textto the React Native imports is necessary to support the new truncation behavior in the title render function.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 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 (2)
app/views/SidebarView/components/CustomStatus.tsx(2 hunks)app/views/SidebarView/styles.ts(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
app/views/SidebarView/components/CustomStatus.tsx (1)
app/views/SidebarView/methods/sidebarNavigate.ts (1)
sidebarNavigate(4-8)
🪛 Biome (2.1.2)
app/views/SidebarView/components/CustomStatus.tsx
[error] 91-91: Shouldn't redeclare 'styles'. Consider to delete it or rename it.
'styles' is defined here:
(lint/suspicious/noRedeclare)
🪛 ESLint
app/views/SidebarView/components/CustomStatus.tsx
[error] 91-91: 'styles' is already defined.
(no-redeclare)
🔇 Additional comments (3)
app/views/SidebarView/styles.ts (1)
38-42: LGTM! Style addition supports text truncation.The
statusTextstyle correctly providesflex: 1andoverflow: 'hidden'properties necessary for the Text component's ellipsize behavior to work properly in the CustomStatus component.app/views/SidebarView/components/CustomStatus.tsx (2)
2-2: LGTM! Text import required for truncation implementation.The Text component import is necessary for the render-based title with ellipsizing behavior.
69-73: LGTM! Truncation implementation is correct.The title render function properly implements single-line text truncation using
numberOfLines={1}andellipsizeMode='tail'. Thestyles.statusTextreference will work correctly once the local styles redeclaration is removed.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
app/views/SidebarView/components/CustomStatus.tsx (1)
69-73: Excellent truncation implementation—consider accessibility enhancement.The single-line truncation is correctly implemented:
numberOfLines={1}ensures single-line displayellipsizeMode='tail'adds the ellipsisstyles.statusTextprovides the necessary flex layoutThe logic correctly falls back to the localized 'Edit_Status' label when
statusTextis empty, and all past review feedback has been properly addressed.Optional enhancement: For better screen reader support, consider adding
accessibilityLabelwith the full (untruncated) status text:<Text numberOfLines={1} ellipsizeMode='tail' style={styles.statusText}> + accessibilityLabel={statusText || I18n.t('Edit_Status')} {statusText || I18n.t('Edit_Status')} </Text>Wait, that's not valid syntax. Let me correct that:
-<Text numberOfLines={1} ellipsizeMode='tail' style={styles.statusText}> +<Text + numberOfLines={1} + ellipsizeMode='tail' + style={styles.statusText} + accessibilityLabel={statusText || I18n.t('Edit_Status')} +> {statusText || I18n.t('Edit_Status')} </Text>This ensures screen readers announce the complete status text even when it's visually truncated.
📜 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 (1)
app/views/SidebarView/components/CustomStatus.tsx(3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
app/views/SidebarView/components/CustomStatus.tsx (2)
app/containers/CustomIcon/index.tsx (1)
CustomIcon(38-38)app/views/SidebarView/methods/sidebarNavigate.ts (1)
sidebarNavigate(4-8)
🔇 Additional comments (1)
app/views/SidebarView/components/CustomStatus.tsx (1)
2-2: LGTM: Text import correctly added.The
Textimport is necessary for the new truncation implementation and is properly added to the existingreact-nativeimport statement.
|
We already have an PR for the same issue #6778 |
🧩 Summary
This PR fixes issue #6776 where the custom status text in the sidebar wrapped onto multiple lines.
Now the text is displayed on a single line and truncated with an ellipsis (…) when it’s too long.
🧪 Steps to Test
…) at the end when too long ✅Summary by CodeRabbit
Bug Fixes
Style