Skip to content

Commit b720312

Browse files
authored
fix(ui): update TaskCard description truncation for improved display (AndyMik90#637)
- Changed the description truncation logic in TaskCard to show a maximum of 120 characters instead of 0, allowing for a more informative preview. - Updated the CSS class to apply a line clamp for better visual consistency in the card layout. This change enhances the user experience by providing a clearer view of task descriptions while still allowing full details to be accessed in the modal.
1 parent 46c41f8 commit b720312

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

apps/frontend/src/renderer/components/TaskCard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ export const TaskCard = memo(function TaskCard({ task, onClick }: TaskCardProps)
100100
const isIncomplete = isIncompleteHumanReview(task);
101101

102102
// Memoize expensive computations to avoid running on every render
103-
// Pass 0 to disable truncation - show full description on cards
103+
// Truncate description for card display - full description shown in modal
104104
const sanitizedDescription = useMemo(
105-
() => task.description ? sanitizeMarkdownForDisplay(task.description, 0) : null,
105+
() => task.description ? sanitizeMarkdownForDisplay(task.description, 120) : null,
106106
[task.description]
107107
);
108108

@@ -279,7 +279,7 @@ export const TaskCard = memo(function TaskCard({ task, onClick }: TaskCardProps)
279279

280280
{/* Description - sanitized to handle markdown content (memoized) */}
281281
{sanitizedDescription && (
282-
<p className="mt-2 text-xs text-muted-foreground">
282+
<p className="mt-2 text-xs text-muted-foreground line-clamp-2">
283283
{sanitizedDescription}
284284
</p>
285285
)}

0 commit comments

Comments
 (0)