Skip to content
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

Add reactions to comments #4612

Merged
merged 4 commits into from
May 23, 2024
Merged

Add reactions to comments #4612

merged 4 commits into from
May 23, 2024

Conversation

falbru
Copy link
Contributor

@falbru falbru commented Mar 28, 2024

Description

Adds reactions to comments.

I faced a small issue and came up with a "hacky" solution: Models that can be reacted on, like articles and meetings, have a contentTarget property that determines what model the reaction should be added to. This property points to the model itself, so that if you react to an article, the reaction is added to that article. I imagined that I could to the same thing for comments: adding a contentTarget property that points back to the comment itself. However, comments already have a contentTarget property that is used to link to the parent model, like an article, causing reactions to be added to the article instead of the comment (never really tested that this actually happened, but it's my guess). My workaround was to add a contentSelf property and pass it to LegoReactions as the contentTarget property. Do you guys think this implementation is alright?

Result

If you've made visual changes, please check the boxes below and include images showing the changes. Descriptions are appreciated.

  • Changes look good on both light and dark theme.
  • Changes look good with different viewports (mobile, tablet, etc.).
  • Changes look good with slower Internet connections.

Screencast from 2024-03-28 13-23-09.webm

Testing

  • I have thoroughly tested my changes.

Adding and deletion works.

I haven't tested for comments that were made before these changes yet.


Resolves ABA-678

@falbru falbru added review-needed Pull requests that need review new-feature Pull requests that introduce a new feature labels Mar 28, 2024
Copy link

linear bot commented Mar 28, 2024

@falbru falbru requested a review from a team March 28, 2024 12:42
Copy link
Member

@eikhr eikhr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, I think this solution is the best option.
Not sure what I think about the name contentSelf. I feel like it should still contain "content target" as that is sort of the name of this concept in the code base. It should be easy to understand out of context what function the property has.

@falbru
Copy link
Contributor Author

falbru commented Mar 28, 2024

@eikhr Thanks for your input 😁. Would you rather prefer changing the name of the existing property contentTarget for Comment to something else? What about parentContent?

@eikhr
Copy link
Member

eikhr commented Mar 29, 2024

Idk, it doesn't matter that much. I just meant I think it should be f.ex. "selfContentTarget" or "parentContentTarget" so that it still contains the entire phrase "content target". Because I don't feel like it's obvious what "content" in "selfContent" is referring to.

@falbru falbru requested a review from eikhr April 11, 2024 18:51
Copy link
Member

@eikhr eikhr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! But you need to rebase and lint, and there seems to be a problem with the comment tests.

@falbru falbru force-pushed the add-reactions-to-comments branch from bb96fe4 to 45e4e94 Compare May 22, 2024 21:21
Copy link

vercel bot commented May 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
lego-bricks-storybook ⬜️ Ignored (Inspect) Visit Preview May 23, 2024 1:38pm

@falbru falbru force-pushed the add-reactions-to-comments branch from 5588e71 to 4c1ba38 Compare May 23, 2024 09:50
@falbru falbru force-pushed the add-reactions-to-comments branch from 4c1ba38 to 5b2844e Compare May 23, 2024 13:38
@falbru falbru removed the review-needed Pull requests that need review label May 23, 2024
@falbru falbru requested a review from eikhr May 23, 2024 13:44
Copy link
Member

@eikhr eikhr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@falbru falbru merged commit bf3b19e into master May 23, 2024
6 checks passed
@falbru falbru deleted the add-reactions-to-comments branch May 23, 2024 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature Pull requests that introduce a new feature
Projects
None yet
2 participants