Reactions Sprint 2b - Add Post Reactions System: Display, Count, API, and UI Enhancements#48
Open
gao-yuhan wants to merge 3 commits into
Open
Reactions Sprint 2b - Add Post Reactions System: Display, Count, API, and UI Enhancements#48gao-yuhan wants to merge 3 commits into
gao-yuhan wants to merge 3 commits into
Conversation
yukiiii04
reviewed
Feb 28, 2025
yukiiii04
approved these changes
Feb 28, 2025
Contributor
yukiiii04
left a comment
There was a problem hiding this comment.
I think the logic itself looks good, next steps would be to changing other related files because this is just the "main components" and flow of the logic, but the data itself needs to be changed and more variables needed to be declared. Right now, there also isn't any actions linked to the button itself, mainly because you haven't really looked at events.js, topics/posts/votes (similar to what we're doing), and many more. Feel free to refer to the doc @lynzhlang and I made that looked more at upvote/downvote (which I believe is more similar to our issue): https://docs.google.com/document/d/19IliLN_3vqqb-hlR2MCBgwjhhXwsxUy8r6mByMTBIhs/edit?tab=t.f0tnle1jht7j
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.
Context:
Worked on issue #21 #22 #46 #47 ** This PR introduces a post reactions system, allowing users to react to posts, view reaction counts, and toggle reactions dynamically. The implementation includes front-end UI enhancements, API endpoints, and database updates to store and manage reactions.
Codebase changes:
node_modules/nodebb-plugin-composer-default/static/templates/partials/composer-formatting.tpl : Updated composer formatting to support reaction UI elements. Ensured compatibility with the reaction feature in the post editor.
nodebb-theme-harmony/scss/topic.scss: Added styles for reaction buttons, including hover effects and active states. Adjusted post layout to accommodate reactions while maintaining readability.
nodebb-theme-harmony/templates/account/posts.tpl: Added support for displaying reactions in the user's account post history.
nodebb-theme-harmony/templates/partials/topic/post.tpl: Integrated reaction buttons into the post action section. Displays existing reactions and allows users to react to posts.
nodebb-theme-harmony/templates/partials/topic/reactions.tpl: Created a reusable component for displaying post reactions.
Supports multiple reaction types and reaction counts.
public/src/client/topic/posts.js: Added event listeners to handle user reactions. Updated post rendering logic to dynamically display reactions.
public/src/modules/api.js: Implemented a new API function (postReaction) to handle reaction requests.Sends reaction data to the backend via an AJAX request.
src/api/posts.js: Added new API endpoints: react, unreact, getReactions
src/routes/api.js: Defined new API routes for handling post reactions. Connected frontend actions to backend reaction handling.
src/socket.io/helpers.js: Implemented WebSocket events to update reactions in real time. Ensured reactions update across multiple users without refreshing the page.
Issue: the button does not show up after changing the functions.