-
Notifications
You must be signed in to change notification settings - Fork 65
Upgrade Lesson Viewer — Video Player, Markdown Renderer, Lesson Navigation, and Quiz Prompt #220
Copy link
Copy link
Open
Labels
Description
Labels
Frontend
Description
ByteChain Academy's lesson viewer at /courses/[id]/lessons/[lessonId] exists but is very basic — it shows a title and description from mock data, has no real video embedding, no markdown content rendering, and no structured lesson layout. A bite-sized learning platform lives or dies by the quality of its lesson experience. This issue upgrades the lesson viewer into a proper interactive learning interface with video playback, rich content rendering, and a smooth completion flow.
Background & Context
frontend/app/courses/[id]/lessons/[lessonId]/page.tsxexists but reads from mock data viauseLearning()context- The
Lessonentity on the backend has:title,content(markdown text),videoUrl(YouTube embed URL),videoStartTimestamp,duration,type(text/video/interactive) - Lessons can be type
text(markdown only),video(YouTube embed + optional notes), orinteractive(future) - After Issues 9 and 10 the lesson data comes from the real backend — this issue improves how that data is presented
- The quiz widget should appear inline at the bottom of the lesson if the lesson has an associated quiz
Requirements
- Upgrade
frontend/app/courses/[id]/lessons/[lessonId]/page.tsx:- For
videotype lessons: embed the YouTube URL using a responsive<iframe>with thevideoStartTimestampapplied as?start=Nparameter. Show a "Notes" section below the video ifcontentis populated - For
texttype lessons: rendercontentas markdown usingreact-markdownwithremark-gfmfor tables, code blocks, and lists. Apply syntax highlighting usingrehype-highlight - Duration badge in the lesson header (e.g. "~5 min read" or "8 min video")
- Previous / Next lesson navigation buttons at the bottom, navigating within the same course in order
- If the lesson has an associated quiz (
hasQuiz: true), show a "Take Quiz" card below the content that links to/courses/[id]/quizzes/[quizId] - Mark complete button calls the backend (from Issue 10) with a loading state and success animation
- For
- Install
react-markdown,remark-gfm, andrehype-highlightif not already present
Suggested Execution
Branch: git checkout -b feat/interactive-lesson-viewer
Files to touch:
frontend/app/courses/[id]/lessons/[lessonId]/page.tsxfrontend/components/lessons/video-player.tsx← create thisfrontend/components/lessons/markdown-content.tsx← create thisfrontend/components/lessons/lesson-navigation.tsx← create thisfrontend/components/lessons/quiz-prompt-card.tsx← create this
Implement:
npm install react-markdown remark-gfm rehype-highlightVideoPlayer— responsive iframe wrapper withaspect-ratio: 16/9, start timestamp param, title overlayMarkdownContent—ReactMarkdownwithremarkGfmandrehypeHighlightplugins, custom component overrides for code blocks (add copy button), links (open in new tab), and images (max-width)LessonNavigation— prev/next buttons computed from the sorted lesson list, disabled at first/last lessonQuizPromptCard— card with quiz title, question count, and CTA button — shown only whenhasQuiz: true- Duration badge:
Math.ceil(duration)minutes with a clock icon
Test & Validate:
- A video lesson renders the YouTube embed with correct start timestamp
- A text lesson renders markdown with proper heading styles, code blocks with syntax highlighting, and tables
- Previous and next navigation correctly moves between lessons in order
- The quiz prompt card appears for lessons with an associated quiz
- Mark complete button shows a loading state and success checkmark animation
- Lesson renders correctly on mobile viewports
Acceptance Criteria
- Video lessons render a responsive YouTube embed with
videoStartTimestampapplied - Text lessons render markdown with
react-markdownincluding code highlighting - Duration badge displayed in lesson header
- Previous / Next navigation works correctly within the course
- Quiz prompt card shown when
hasQuizis true - Mark complete button has loading state and success animation
- Lesson viewer is mobile responsive
Example Commit Message
feat: upgrade lesson viewer with video embed, markdown renderer, and lesson navigation
Guidelines
- Assignment required before starting
- PR description must include
Closes #[issue_id] - Join our Telegram: https://t.me/ByteChainAcademy
- Complexity: High (200 pts)
Reactions are currently unavailable