Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .github/assets/reports-overflow-after.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/reports-overflow-before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 20 additions & 17 deletions patient/lib/presentation/reports/widgets/milestone_cards.dart
Original file line number Diff line number Diff line change
Expand Up @@ -144,23 +144,26 @@ class HorizontalMilestoneCard extends StatelessWidget {
),
child: _getIcon,
),
const SizedBox(width: 16),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
value,
style: Theme.of(context).textTheme.displayMedium?.copyWith(
fontWeight: FontWeight.bold,
fontSize: 22, // Slightly smaller for horizontal layout
),
),
Text(
label,
style: Theme.of(context).textTheme.bodyMedium,
),
],
const SizedBox(width: 8),
Flexible(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
value,
style: Theme.of(context).textTheme.displayMedium?.copyWith(
fontWeight: FontWeight.bold,
fontSize: 22, // Slightly smaller for horizontal layout
),
),
Text(
label,
style: Theme.of(context).textTheme.bodyMedium,
overflow: TextOverflow.ellipsis,
),
Comment on lines +160 to +164
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟑 Minor

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.

Suggested change
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.

],
),
),
],
),
Expand Down