Skip to content

Conversation

@VenkataRohan
Copy link

Proposed changes (including videos or screenshots)

isssue #32297

This PR notifies the user when someone reacts on the message and also increases the unread count in the sidebar

rocket_chat

Issue(s)

Steps to test or reproduce

Further comments

@changeset-bot
Copy link

changeset-bot bot commented May 23, 2024

⚠️ No Changeset found

Latest commit: a9a4052

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@VenkataRohan VenkataRohan changed the title feat:notify on reactions feat: notify on reactions May 23, 2024
@VenkataRohan
Copy link
Author

Hi @reetp , I'm new to open source contributions and have recently developed a feature based on an issue. I submitted a PR a few days ago. Could you please suggest what my next steps should be to ensure my PR gets merged successfully?

@reetp
Copy link
Collaborator

reetp commented Jun 3, 2024

You don't need to ping me.

You have the attention of a dev.

Keep your PR in line with the latest code and hope they choose to merge it.

That will likely be up to the product team.

An "Enable/Disable" preference might be worth looking at too - not everyone wants to be bombarded with notifications!

@casalsgh casalsgh added need help Need Help - Community and removed need help Need Help - Community labels Jun 14, 2024
@casalsgh
Copy link
Contributor

@VenkataRohan can you make it availabe as a possible setting?
We don't want to change the default behavior we have, but also want to permit this to be a possible setup.

@VenkataRohan
Copy link
Author

Hi @casalsgh , sure I am working on it , I will update here as soon as I implement it

@VenkataRohan VenkataRohan force-pushed the feat-notify-reactions branch from 81b77e1 to a6d70ed Compare June 20, 2024 13:58
@VenkataRohan VenkataRohan requested review from a team as code owners June 20, 2024 13:58
@ggazzo ggazzo self-assigned this Jun 20, 2024
Copy link
Member

@ggazzo ggazzo left a comment

Choose a reason for hiding this comment

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

I think its totally fine doing this with no setting.

what I disagree is to increment the unread, let keep this as ephemeral

@VenkataRohan VenkataRohan force-pushed the feat-notify-reactions branch from a6d70ed to 01585d5 Compare June 20, 2024 14:37
@VenkataRohan
Copy link
Author

Hi @ggazzo @casalsgh , now in this commit I have removed increase unread count and added an option of selecting notification on reaction
image

@ggazzo
Copy link
Member

ggazzo commented Jun 20, 2024

hey @VenkataRohan thanks for all the changes. lets keep the setting so, its not a big deal.

export function parseReaction(reactionText: string, roomtype: RoomType): string {
let reaction = '';
if (roomtype === 'd') {
reaction = `reacted with ${getEmojiClassNameAndDataTitle(reactionText.trim()).children}`;
Copy link
Member

Choose a reason for hiding this comment

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

what if we just use the reaction name and build the message on the clients?

anyway the translation is missing

Copy link
Author

Choose a reason for hiding this comment

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

Hi @ggazzo ,
I have been working on a translation task to obtain reaction names from the back-end and build messages on the client-side. To achieve this, changes need to be made to one of the following files:

konchatNotifications.ts at line 86, where we receive the notification payload from the back-end.
KonchatNotification.ts at line 36, where the above file calls this function.

However, since useTranslation is a hook and cannot be used in either of these files as they lack React components, I devised an alternative approach. Though it is somewhat verbose, it successfully translates the messages. I will make a commit with this working approach , please take a look.

Screenshot 2024-06-22 at 10 30 22 PM

@VenkataRohan VenkataRohan requested a review from a team as a code owner June 22, 2024 18:28
@casalsgh casalsgh requested a review from ggazzo July 5, 2024 17:19
@Akshanshkaushal
Copy link

I would like to work on this issue if it is not closed.

@VenkataRohan
Copy link
Author

VenkataRohan commented Sep 22, 2024

Hi @Akshanshkaushal I was waiting for a reply from @casalsgh , @ggazzo , I have already implement the feature and made changes suggested , waiting for the team to review it , and ready to work on any suggestion if required.

@reetp
Copy link
Collaborator

reetp commented Sep 22, 2024

Hi @ggazzo @casalsgh , now in this commit I have removed increase unread count and added an option of selecting notification on reaction

Good job. These sorts of things are like Marmite. Some love them, some hate them.

I'd guess it could chew through a lot of push notifications too?

This could drive many people mad, especially in busy channels.

So options to disable it are good.

Comment on lines 44 to 45
reactionWithTranslation,
reacted: reaction !== '',

Choose a reason for hiding this comment

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

The reactionWithTranslation field is introduced but does not seem to have a default value or fallback mechanism when the translation fails. Ensure that reactionWithTranslation gracefully defaults to the untranslated reaction string to prevent any undefined behavior or empty notifications.

Copy link
Author

Choose a reason for hiding this comment

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

Hi @Parvezkhan0 ,Sure I am working on it

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Nov 23, 2024

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@VenkataRohan
Copy link
Author

Hi @Parvezkhan0, @ggazzo , @casalsgh

I have added added fallback mechanism if translation fails as request by @Parvezkhan0 and also some good amount for changes to the code to optimse the translation of "Reacted With" process

also I have added the message to which in the notification as shown below.

the latest commit a9a4052 has all the change. we can also rebase all the previous commit

Screenshot 2024-11-23 at 6 05 00 PM

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.

6 participants