feat: folder upvote/downvote system, smart sorting, activity feed, and milestone notifications - #177
Merged
Merged
Conversation
- Create migration for node_votes with user_id, node_id, and type (up/down) - Add unique constraint on [node_id, user_id] and index on [node_id, type] - Add migration to assign user_id on nodes table for internal author tracking - Define NodeVote Eloquent model and relationships on Node and User models
…and sorting logic
- Add POST /nodes/{node}/vote route for toggling upvotes/downvotes
- Create NodeVoteObserver to invalidate parent node and subject page caches
- Keep top-level curriculum chapters strictly sorted by sort_order on subject page
- Sort subfolders inside chapters by net votes (upvotes - downvotes) then sort_order
- Pass upvotesCount, downvotesCount, userVote, and upvoters list to inertia props
- Ensure downvoter identity list is private and never exposed
- Add comprehensive feature test suite covering all voting and sorting behavior
…badges - Add optimistic upvote and downvote buttons with ArrowBigUp / ArrowBigDown icons - Add modal to view the list of upvoters (name, avatar, institution, role badge) - Add guest sign-in dialog prompt when unauthenticated user attempts to vote - Display folder upvote count badge on child folder rows in desktop and mobile views
…y feed - Query latest 4 upvoted folders with multi-level parent eager loading - Construct full hierarchical canonical paths without N+1 query overhead - Render upvoted folder activity card with ArrowBigUp badge in Activity tab - Add automated test verifying upvoted folders in public user profile
- Create NodeNotificationMail mailable reusing the branded bulk_announcement email layout - Queue milestone emails to folder author at 1, 5, 10, 25, 50, 100, 250, 500, 1000 upvotes - Respect user email preferences (receive_emails) and avoid self-notification - Add feature tests for folder upvote milestone email triggers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
No description provided.