Skip to content

Made the code editior#10

Merged
Puxhkar merged 1 commit intomainfrom
Chapter-12-Done-very-hard
Dec 8, 2025
Merged

Made the code editior#10
Puxhkar merged 1 commit intomainfrom
Chapter-12-Done-very-hard

Conversation

@Puxhkar
Copy link
Copy Markdown
Owner

@Puxhkar Puxhkar commented Dec 8, 2025

Summary by CodeRabbit

Release Notes

  • New Features

    • Exercise content viewer with structured Task and Hint sections
    • Global exercise numbering across all course chapters
    • Exercise difficulty level tracking
    • Two-pane learning interface for exercise content and code workspace
  • Improvements

    • Enhanced visual styling for code and HTML content display
    • Clearer exercise navigation with XP rewards and enrollment status indicators

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Dec 8, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR introduces a complete exercise management system including a new exercise detail page with split-pane layout, API endpoint for fetching exercise content, database schema for storing exercises, and components for rendering exercise information with content sections supporting rich HTML rendering.

Changes

Cohort / File(s) Summary
Exercise Display Components
app/(routes)/courses/[courseId]/[chapterId]/[exerciseslug]/_components/ContentSection.tsx, app/(routes)/courses/[courseId]/[chapterId]/[exerciseslug]/page.tsx
New ContentSection component renders exercise name, content, task, and hint with loading skeleton support. New Playground page component fetches exercise data via API, manages loading state, and renders two-pane layout with ContentSection and placeholder code editor using SplitterLayout.
Navigation & Component Updates
app/(routes)/courses/[courseId]/_components/CourseChapters.tsx, app/(routes)/dashboard/_components/UpgradeToPro.tsx
CourseChapters refactored with global exercise numbering, conditional access control via EnableExercise check, and linking to exercise detail pages. UpgradeToPro updated to use Next.js Link component for routing instead of lucide-react icon.
Type Definitions
app/(routes)/courses/_components/CourseList.tsx
Previously internal types (completedExcercises, courseEnrolledInfo, Chapter, exercise) now exported; exercise type extended with difficulty field.
Backend Infrastructure
config/schema.ts, app/api/exercise/route.ts, app/api/admin/save-exercises/route.ts, app/api/course/route.ts
New ExerciseTable schema added to database. New POST endpoint for /api/exercise returns exercise content and chapter details by courseId, chapterId, exerciseId. New GET endpoint /api/admin/save-exercises seeds database with predefined exercise curriculum. Course endpoint enhanced with chapter ordering.
Styling & Dependencies
app/globals.css, package.json
Added .html-tag and .exercise-content CSS utility classes for styling exercise content. Added react-splitter-layout and \@types/react-splitter-layout dependencies for split-pane layout.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

  • CourseChapters.tsx requires careful review of the new numbering calculation logic and conditional rendering flow with EnableExercise access control
  • page.tsx (Playground) state management and API integration pattern should be verified for error handling completeness
  • ContentSection.tsx dangerouslySetInnerHTML usage warrants security review of content source
  • API routes lack explicit error handling for missing query results; consider verifying expected data availability
  • New ExerciseTable schema integration with existing database patterns should be validated

Poem

🐰 Hop into exercises, content so bright,
Split-pane views show the code on the right,
HTML rendering with hints and with tasks,
Your curriculum loaded—no need to ask!
Learning by chapter, by exercise too,
Progress awaits every coder like you!


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Free

📥 Commits

Reviewing files that changed from the base of the PR and between a211089 and 68712b6.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (11)
  • app/(routes)/courses/[courseId]/[chapterId]/[exerciseslug]/_components/ContentSection.tsx (1 hunks)
  • app/(routes)/courses/[courseId]/[chapterId]/[exerciseslug]/page.tsx (1 hunks)
  • app/(routes)/courses/[courseId]/_components/CourseChapters.tsx (2 hunks)
  • app/(routes)/courses/_components/CourseList.tsx (2 hunks)
  • app/(routes)/dashboard/_components/UpgradeToPro.tsx (1 hunks)
  • app/api/admin/save-exercises/route.ts (1 hunks)
  • app/api/course/route.ts (1 hunks)
  • app/api/exercise/route.ts (1 hunks)
  • app/globals.css (1 hunks)
  • config/schema.ts (1 hunks)
  • package.json (2 hunks)

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@Puxhkar Puxhkar merged commit 2da1ad4 into main Dec 8, 2025
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant