-
Notifications
You must be signed in to change notification settings - Fork 648
feat: add comment reactions (thumbs up) feature #2812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Allows users to react to comments with a thumbs up emoji instead of creating new comments. This reduces ticket clutter when acknowledging a comment. Changes: - Add new HD Comment Reaction DocType to store reactions - Add toggle_reaction and get_comment_reactions API endpoints - Add reaction UI to CommentBox.vue with hover tooltip showing users - Send notification to comment author when reaction is added Backend: - helpdesk/helpdesk/doctype/hd_comment_reaction/ - new DocType - API: toggle_reaction(comment, reaction) - add/remove reaction - API: get_comment_reactions(comment) - list reactions with users Frontend: - CommentBox.vue - thumbs up button with count and user tooltip - Highlights button when current user has reacted - Real-time update via publish_event
|
Niceee!!! @samarth93 Some feedback:
|
|
Checkout how GP handles reactions: |
Based on feedback from @RitvikSardana: - Replace standalone HD Comment Reaction with HD Reaction child table - Store reactions inside HD Ticket Comment (like Gameplan) - Add emoji picker with multiple emoji options (👍👎❤️😄🎉😕👀🚀) - Users can only have one reaction per comment (clicking different emoji replaces) Changes: - New HD Reaction DocType (child table with emoji + user) - Add reactions Table field to HD Ticket Comment - Add toggle_reaction() and get_reactions() APIs - Update CommentBox.vue with emoji picker popover - Remove old HD Comment Reaction standalone DocType
|
@RitvikSardana I have done an update based on your feedback. |
|
Add the ss in description, also can a single user add multiple reactions? |
|
HD Comment Reaction will be the name of the child table |
One user can only react with one single emoji listed among them. |
|
Yes they can, check how GP does this. |
Addressing feedback from @RitvikSardana: 1. Renamed child table from 'HD Reaction' to 'HD Comment Reaction' 2. Allow users to add multiple different reactions (not just one) 3. Updated PR description with screenshot Changes: - Rename HD Reaction → HD Comment Reaction (DocType name) - Update toggle_reaction logic to allow multiple reactions per user - Users can now react with different emojis (👍 + ❤️ + 🎉 etc) - Clicking same emoji toggles it off - Updated all references in code
|
One reaction per user should be fine. We can also preset the reactions to be either of 4/5 just how it is on LinkedIn const presetEmojis = ['👍', '👎', '❤️', '🎉', '👀', '✅']; Ensure no other emojis can be added via api When a user adds an emoji reaction to a comment, a HD Notification should be sent with type of reaction. When this is done Please write test cases for it. Test cases should cover
|
Addressing feedback: 1. One reaction per user (not multiple) 2. Preset emojis only: ['👍', '👎', '❤️', '🎉', '👀', '✅'] 3. API validation to block non-preset emojis 4. Updated notification message: 'reacted with X on your comment' 5. Comprehensive test cases covering all requirements Backend changes: - Add PRESET_EMOJIS constant - Add emoji validation in toggle_reaction API - Change to one reaction per user (replaces on different emoji) - Update notification message format - Add get_preset_emojis() API Frontend changes: - Update emojiList to match preset emojis Test cases added: - test_one_reaction_per_user: Verifies only one reaction allowed - test_reaction_count_accuracy: Tests count with 10 hearts, 3 thumbs up - test_notification_created_on_reaction: Validates HD Notification creation - test_only_preset_emojis_allowed: Ensures only preset emojis accepted - test_reaction_toggle_behavior: Tests toggle on/off behavior - test_get_reactions_returns_correct_data: Validates API response structure
Fixes linter error from unused variable
The test was failing because it tried to use hardcoded 'TEST-TICKET-001' name but HD Ticket uses autoname. Changed to: - Create ticket dynamically and store in self.test_ticket - Reference self.test_ticket.name for comments - Clean up ticket in tearDown
|
Thank you for providing these details I am working on this. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2812 +/- ##
==========================================
Coverage ? 42.72%
==========================================
Files ? 123
Lines ? 5156
Branches ? 0
==========================================
Hits ? 2203
Misses ? 2953
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
7a18b33 to
dcaca78
Compare
Implements comment reactions logic, notifications, and UI updates.
dcaca78 to
7a18b33
Compare








Fixes #2629
Description
Adds emoji reactions to comments, allowing users to acknowledge comments without creating additional replies.
Screenshots
Problem Solved
When someone is tagged in a comment for informational purposes, they previously had two options:
Now users can react with emojis to acknowledge they have seen the comment.
Changes
Backend
HD Comment Reactionto store reactions inside commentsreactionsTable field toHD Ticket Commenttoggle_reaction(comment, emoji)- add/remove reactionget_reactions(comment)- get reactions grouped by emojiFrontend
Implementation Details
Testing
Test cases added covering: