fix: resolve HorizontalMilestoneCard right overflow in Reports screen#206
fix: resolve HorizontalMilestoneCard right overflow in Reports screen#206suhas2006-code wants to merge 2 commits intoAOSSIE-Org:mainfrom
Conversation
- Wrapped text Column with Flexible to prevent overflow in tight viewports - Reduced SizedBox gap from 16 to 8 to reclaim horizontal space - Added TextOverflow.ellipsis on label to guard against long strings Fixes overflow of 1.4 pixels on Missed/Regressed cards visible on standard Android screen sizes.
📝 WalkthroughWalkthroughThe milestone_cards widget layout is restructured from a fixed horizontal arrangement to a flexible column-based layout. The change reduces spacing between icon and text from 16 to 8 pixels and adds text truncation with ellipsis handling for better accommodation of long labels and varying widget widths. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@patient/lib/presentation/reports/widgets/milestone_cards.dart`:
- Around line 160-164: The Text widget displaying the label (the Text(label,
style: Theme.of(context).textTheme.bodyMedium, overflow: TextOverflow.ellipsis))
should include maxLines: 1 so the ellipsis is applied instead of wrapping;
update that Text instance in milestone_cards.dart (the label Text inside the
milestone card widget) to add maxLines: 1 while keeping the existing style and
overflow settings.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2689e0e8-7752-456b-b71c-4153986bd9a0
📒 Files selected for processing (1)
patient/lib/presentation/reports/widgets/milestone_cards.dart
| Text( | ||
| label, | ||
| style: Theme.of(context).textTheme.bodyMedium, | ||
| overflow: TextOverflow.ellipsis, | ||
| ), |
There was a problem hiding this comment.
Add maxLines: 1 for TextOverflow.ellipsis to work correctly.
TextOverflow.ellipsis only triggers when the text exceeds the available lines. Without maxLines, the text will wrap to new lines before ellipsis is applied, which could still cause layout issues in this fixed-height (90px) card.
Proposed fix
Text(
label,
style: Theme.of(context).textTheme.bodyMedium,
+ maxLines: 1,
overflow: TextOverflow.ellipsis,
),📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Text( | |
| label, | |
| style: Theme.of(context).textTheme.bodyMedium, | |
| overflow: TextOverflow.ellipsis, | |
| ), | |
| Text( | |
| label, | |
| style: Theme.of(context).textTheme.bodyMedium, | |
| maxLines: 1, | |
| overflow: TextOverflow.ellipsis, | |
| ), |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@patient/lib/presentation/reports/widgets/milestone_cards.dart` around lines
160 - 164, The Text widget displaying the label (the Text(label, style:
Theme.of(context).textTheme.bodyMedium, overflow: TextOverflow.ellipsis)) should
include maxLines: 1 so the ellipsis is applied instead of wrapping; update that
Text instance in milestone_cards.dart (the label Text inside the milestone card
widget) to add maxLines: 1 while keeping the existing style and overflow
settings.
📝 Description
Fixes a right-side RenderFlex overflow in Reports milestone cards (Missed / Regressed) on narrower Android widths.
🔧 Changes Made
📷 Screenshots or Visual Changes
Before
After
✅ Checklist