feat: add activity discussion/comments system with threaded replies#20
Open
ayesha1145 wants to merge 1 commit intoalphaonelabs:mainfrom
Open
feat: add activity discussion/comments system with threaded replies#20ayesha1145 wants to merge 1 commit intoalphaonelabs:mainfrom
ayesha1145 wants to merge 1 commit intoalphaonelabs:mainfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a threaded discussion/comments system to activity pages, allowing enrolled users and hosts to discuss activities in real time.
Changes:
Features:
Pull Request Summary: Add Activity Discussion/Comments System with Threaded Replies
Purpose
Adds a threaded discussion/comments system to activity pages, enabling enrolled users and hosts to discuss activities in real time with hierarchical parent-child comment relationships.
Key Changes
Database (schema.sql)
commentstable with support for threaded replies via optionalparent_idself-reference andON DELETE CASCADEbodystorage (at-rest encryption matching platform security model)activity_id,parent_id, anduser_idfor performancecreated_atandupdated_attimestampsBackend API (src/worker.py)
api_get_comments: Fetches and decrypts all comments for an activityapi_post_comment: Creates new comments with 2000-character limit and optionalparent_idfor replies; requires authenticationapi_delete_comment: Allows deletion by comment author, activity host, or admin_DDLschema to include comments table and indexesFrontend (public/course.html)
GET /api/activities/{actId}/commentsand posts viaPOSTwith bearer token authenticationparent_idescHtml()and conditional form visibility based on authenticationInput Validation
The API routes are not wired into the dispatcher. While all three handler functions are fully implemented and the database schema is complete, no route matchers have been added to the
_dispatchfunction. The_dispatchfunction will return404 "API endpoint not found"for all comment requests because the routes checking for/api/activities/:id/commentsand/api/comments/:idare missing. The feature is currently non-functional and requires routing to be added to_dispatchbefore the API endpoints can be accessed.