Skip to content

feat: course-linked discussions — per-lesson comment panels#792

Closed
clbotdev wants to merge 2 commits into
mainfrom
feat/course-discussions
Closed

feat: course-linked discussions — per-lesson comment panels#792
clbotdev wants to merge 2 commits into
mainfrom
feat/course-discussions

Conversation

@clbotdev
Copy link
Copy Markdown
Collaborator

Summary

Enables per-lesson discussions by linking Communities to Courses. Students can comment on each lesson directly from the lesson player — no more switching between lesson content and a separate discussion board.

How it works

  1. Course creator toggles Discussions ON from the course Manage screen
  2. A Community is auto-created in the background, linked to the course
  3. Each lesson automatically gets a CommunityPost for its discussion
  4. Students see a desktop sidebar or mobile slide-in panel with threaded comments
  5. Notifications deep-link directly to the lesson URL

Changes (22 files, +1,329 lines)

Data Model:

  • Course.discussions (boolean) + Course.discussionCommunityId (string)
  • Community.courseId — links community back to course
  • CommunityPost.lessonId — links post to a lesson
  • 4 new COURSE_DISCUSSION_* notification entity actions

Backend:

  • Auto-create Community + CommunityPosts when discussions enabled
  • Sync post titles on lesson rename, soft-delete on lesson removal
  • Filter course-linked communities from main community listing
  • Route all comment/like/reply notifications to course-specific types
  • Deep-link notifications to course/{slug}/{courseId}/{lessonId}
  • Auto-enroll students into discussion community on enrollment

Frontend:

  • Course Manage: Discussions toggle (Switch component)
  • Lesson page: Desktop sidebar (340px) + mobile FAB with slide-in drawer
  • LessonDiscussionPanel: threaded comments, replies, likes via existing APIs

Design

See PRD: docs/prd-course-discussions.md

…payment config

Fixes #583

- Added PAYMENT_METHOD_NONE as the first option in the payment method dropdown
- Removed placeholderMessage since 'None' is now a selectable option
- Users can now reset their payment configuration by selecting 'None'
Enable per-lesson discussions by linking Communities to Courses.

Data Model:
- Add discussions + discussionCommunityId fields to Course
- Add courseId field to Community (for course-linked communities)
- Add lessonId field to CommunityPost (for lesson-linked posts)
- Add COURSE_DISCUSSION_* notification entity actions

Backend:
- Auto-create Community when discussions toggled ON in course settings
- Auto-create CommunityPost per lesson (syncs title, soft-deletes on removal)
- Cascade soft-delete discussion community on course deletion
- Filter course-linked communities from main community listing
- New GraphQL queries: getCourseDiscussionPosts, getCourseDiscussionStream
- Notification routing: course discussion events get deep-linked to lesson URL
- Auto-enroll students into discussion community on course enrollment

Frontend:
- Course Manage page: Discussions toggle component (Switch)
- Lesson page: Desktop sidebar (340px) + mobile slide-in FAB/drawer
- LessonDiscussionPanel: Comments, threaded replies, likes via existing APIs
- use-product hook updated to fetch discussions + discussionCommunityId
@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
courselit-docs Ready Ready Preview, Comment May 30, 2026 3:50am

Request Review

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.

2 participants