-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Feat: Label indicating a reply must be sent in chatbox #1149
base: master
Are you sure you want to change the base?
Conversation
Removes console log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You made a good try but I don't think we need to add a role column to user_profile table to show a label. There is a better way to show the label. You fetch user_id of the last message sent in a chat. Then compare the id of the user calling the API and user_id of the last message. If the user_id does not match then you show the message.
We wanted to make this only available to certain users like Thomas, as this is a tool for community building. If this was for regular users we would need to add a way to dismiss the label for the cases in which their conversation is over for the time being and the label may become annoying to those users. |
I don't think we established that this requirement should only be for climate connect community building. I believe this can be a very useful tool for everyone on the platform. |
@ddhanesha I agree that this feature could be useful to regular users. I've removed the role column and instead introduced a slider which state is stored in a cookie. Hopefully, this will enable users to also use this feature, without annoying users who do not want to use it. |
Description
Closes #1150
This PR implements a label onto chat previews for messages in which the logged in user was not the last one to write a message. Should a user not want to see the labels, they can use a slider at the top of the inbox to turn them off. A cookie will track this state for 30 days.
The label shows under the condition that the user was not the last one to send a message, or the chat has not had any messages sent in it yet.
The new label is only implemented for non mobile screens.
Interface before:
![Screenshot from 2022-11-21 14-52-57](https://user-images.githubusercontent.com/49129464/203072244-2893912a-f16c-4cb5-a61a-18848426cf6e.png)
Screenshot displays new interface.
Test plan
Before landing
yarn lint
passes (frontend)yarn format
passes (frontend)make format
passes (backend)