Skip to content

feat: community post/comment/reply reactions (#809)#810

Open
clbotdev wants to merge 2 commits into
mainfrom
feat/community-reactions
Open

feat: community post/comment/reply reactions (#809)#810
clbotdev wants to merge 2 commits into
mainfrom
feat/community-reactions

Conversation

@clbotdev

Copy link
Copy Markdown
Collaborator

Summary

Evolve the community post/comment/reply like system to support multiple emoji reactions. Closes #809.

Changes

Backend:

  • New CommunityReaction type in common-models with emoji, count, hasReacted, reactors fields
  • Updated CommunityPost, CommunityComment, CommunityCommentReply interfaces to include reactions: CommunityReaction[]
  • Schema: replaced likes: [String] with reactions: { type: Map, of: [String], default: {} } on all three schemas. Kept likes: [String] for backward compatibility with existing data.
  • New GraphQL mutations: togglePostReaction, toggleCommentReaction, toggleCommentReplyReaction accepting emoji: String!
  • New field resolvers: getReactionsForEntity() populates reactor details (name, avatar)
  • Backward compatibility: existing likes: string[] data is automatically read as ❤️ reactions via getReactionsMap() fallback
  • Migration script to convert existing likes to reactions format

Frontend:

  • New emoji-picker.tsx — emoji picker popover with common reactions (👍 ❤️ 😄 🎉 😢 😮)
  • New reactions-bar.tsx — displays reaction emojis with counts, highlights user reactions, "+" button for picker, hover tooltip with reactor names
  • Updated post-card.tsx — replaced ThumbsUp button with reactions bar
  • Updated comment.tsx — replaced ThumbsUp on comments/replies with compact reactions bar
  • Updated comment-section.tsx — updated GraphQL queries/mutations for reactions

Technical notes:

  • All 641 tests pass, lint clean, prettier clean
  • ES5 target compatibility: Map iteration rewritten to use .forEach() instead of for...of

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.

Community post/comment/reply reactions.

1 participant