From f1b6172f9187b1c275e292718066164c74f0bf19 Mon Sep 17 00:00:00 2001 From: Yared Yemane Date: Wed, 13 May 2026 05:34:50 -0700 Subject: [PATCH] fix(content): uniform lesson card heights and wire descriptions Co-authored-by: Cursor --- .../CourseModuleDetailPage.tsx | 1 + .../content-management/ModuleDetailPage.tsx | 1 + .../components/VideoCard.tsx | 49 ++++++++++++------- 3 files changed, 32 insertions(+), 19 deletions(-) diff --git a/src/pages/content-management/CourseModuleDetailPage.tsx b/src/pages/content-management/CourseModuleDetailPage.tsx index 870c42c..7d51e2d 100644 --- a/src/pages/content-management/CourseModuleDetailPage.tsx +++ b/src/pages/content-management/CourseModuleDetailPage.tsx @@ -719,6 +719,7 @@ export function CourseModuleDetailPage() { hoverModuleActions onEdit={() => openEditLesson(lesson)} onDelete={() => setDeletingLessonId(lesson.id)} + description={lesson.description} /> )) ) diff --git a/src/pages/content-management/ModuleDetailPage.tsx b/src/pages/content-management/ModuleDetailPage.tsx index f486226..3acda79 100644 --- a/src/pages/content-management/ModuleDetailPage.tsx +++ b/src/pages/content-management/ModuleDetailPage.tsx @@ -398,6 +398,7 @@ export function ModuleDetailPage() { thumbnailGradient={LESSON_THUMB_GRADIENTS[i % LESSON_THUMB_GRADIENTS.length]} onEdit={() => openEditLesson(lesson)} onDelete={() => setDeletingLesson(lesson)} + description={lesson.description} onAddPractice={() => navigate( `/new-content/learn-english/${level}/courses/add-practice?backTo=module&courseId=${courseId}&moduleId=${moduleId}&lessonId=${lesson.id}&lessonTitle=${encodeURIComponent(lesson.title)}`, diff --git a/src/pages/content-management/components/VideoCard.tsx b/src/pages/content-management/components/VideoCard.tsx index cbeba6e..16e73a6 100644 --- a/src/pages/content-management/components/VideoCard.tsx +++ b/src/pages/content-management/components/VideoCard.tsx @@ -41,6 +41,8 @@ interface VideoCardProps { /** When set (e.g. on module lesson cards), shows an "Add practice" control scoped to this lesson. */ onAddPractice?: () => void; onPublish?: () => void; + /** Shown under title on module lesson cards; reserved height keeps grid rows even. */ + description?: string | null; } export function VideoCard({ @@ -55,6 +57,7 @@ export function VideoCard({ onPublish, onAddPractice, hoverModuleActions = false, + description, }: VideoCardProps) { const [thumbFailed, setThumbFailed] = useState(false); const [previewOpen, setPreviewOpen] = useState(false); @@ -113,13 +116,13 @@ export function VideoCard({ return (
{/* Thumbnail */}
- {/* Content */} -
+ {/* Content — flex-1 + min-h-0 so grid rows equalize; title min-height stabilizes card body */} +
@@ -341,28 +344,36 @@ export function VideoCard({ ) : null}
-

+

{title}

+ {hoverModuleActions ? ( +

+ {description?.trim() ? description.trim() : "\u00a0"} +

+ ) : null} + {hoverModuleActions && onAddPractice ? ( - +
+ +
) : null} {/* Actions (footer) — not used for API lesson cards with hover tools */} {!hoverModuleActions ? ( -
+