Skip to content

feat: folder upvote/downvote system, smart sorting, activity feed, and milestone notifications - #177

Merged
trtajim merged 5 commits into
mainfrom
feature/folder-voting-system
Aug 26, 2026
Merged

feat: folder upvote/downvote system, smart sorting, activity feed, and milestone notifications#177
trtajim merged 5 commits into
mainfrom
feature/folder-voting-system

Conversation

@trtajim

@trtajim trtajim commented Aug 26, 2026

Copy link
Copy Markdown
Member

No description provided.

- 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
@trtajim
trtajim merged commit c4fdf1b into main Aug 26, 2026
5 checks passed
@trtajim
trtajim deleted the feature/folder-voting-system branch August 26, 2026 09:55
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