RocketChat / EmbeddedChat

An easy to use full-stack component (ReactJS) embedding Rocket.Chat into your webapp
https://rocketchat.github.io/EmbeddedChat/docs
113 stars 228 forks source link

Adding Quote feature in EmbeddedChat #172

Open KOMALDEWNANI opened 1 year ago

KOMALDEWNANI commented 1 year ago

As an EmbeddedChat developer

I need to: Add a Quote Functionality So That: users would be able to easily reference and respond to specific messages by simply selecting the quote option and selecting the message they want to reference. This would make conversations more organized and efficient, as users would no longer need to manually copy and paste previous messages in order to reference them. Acceptance Criteria

KOMALDEWNANI commented 1 year ago

Hey @sidmohanty11, I would like to work on this issue. Please assign it to me. Thanks!

YashTote commented 1 year ago

@sidmohanty11 Is this issue assigned to someone? I would like to work on this and submit the PR ASAP.

sidmohanty11 commented 1 year ago

Hey, @YashTote thanks a lot for showing interest in this feature. We are currently in the mid of a major refactoring spree and any feature addition is actually put on hold for a bit. But still, if you want to contribute feel free to take a pull from the develop branch, get in touch with @abhinavkrin regarding the development steps on https://open.rocket.chat and create a PR to that branch. Thanks!

umangutkarsh commented 9 months ago

Hey @sidmohanty11 . Is this feature required?

umangutkarsh commented 9 months ago

Hey @sidmohanty11 . Is this feature required?

If required, I'm working on this one.

sidmohanty11 commented 9 months ago

Hey @umangutkarsh sorry for the late response! Go ahead!

umangutkarsh commented 9 months ago

Hey @sidmohanty11 . No worries. I am currently working on this.

This is the solution I've come up with and the approach I'm following:

  1. Create a quote UI button to add messages to be quoted above the text-area of ChatInput component
  2. When clicking the button, adding the messsage to an array.
  3. The state of this array and the methods to make changes to it's state (i.e., addQuoteMessage(), removeQuoteMessage, clearQuoteMessage) will be managed by a context API from which the methods and states can be used anywhere in any component.
  4. Context API is used to avoid having to pass the data as a prop at every level of the component tree.
  5. The UI of the current QuotedMessage will be rendered by a QuoteAttachment component, this component will have an attachment prop, and an onCancel prop to remove the message from the array of quotedMessages.
  6. When the message is sent, then if there are quotedMessages in the array, will be sent as an attachment with the current sent message.

The code is almost ready, just the rendering of the quotedMessages as an attachment is left.

Please review this if I should work further on this.

umangutkarsh commented 9 months ago

Hi @sidmohanty11 . Please let me know whenever you are available. Thanks

umangutkarsh commented 9 months ago

Hey @sidmohanty11 . No worries. I am currently working on this.

This is the solution I've come up with and the approach I'm following:

  1. Create a quote UI button to add messages to be quoted above the text-area of ChatInput component
  2. When clicking the button, adding the messsage to an array.
  3. The state of this array and the methods to make changes to it's state (i.e., addQuoteMessage(), removeQuoteMessage, clearQuoteMessage) will be managed by a context API from which the methods and states can be used anywhere in any component.
  4. Context API is used to avoid having to pass the data as a prop at every level of the component tree.
  5. The UI of the current QuotedMessage will be rendered by a QuoteAttachment component, this component will have an attachment prop, and an onCancel prop to remove the message from the array of quotedMessages.
  6. When the message is sent, then if there are quotedMessages in the array, will be sent as an attachment with the current sent message.

The code is almost ready, just the rendering of the quotedMessages as an attachment is left.

Please review this if I should work further on this.

Hi @sidmohanty11 @abhinavkrin . I've almost integrated the 'Quote-Message feature' for embeddedChat, except for some issues which I'm currently facing. Anything else should I consider? Please let me know Thanks.

quote.webm

umangutkarsh commented 8 months ago

Hey @sidmohanty11 . No worries. I am currently working on this. This is the solution I've come up with and the approach I'm following:

  1. Create a quote UI button to add messages to be quoted above the text-area of ChatInput component
  2. When clicking the button, adding the messsage to an array.
  3. The state of this array and the methods to make changes to it's state (i.e., addQuoteMessage(), removeQuoteMessage, clearQuoteMessage) will be managed by a context API from which the methods and states can be used anywhere in any component.
  4. Context API is used to avoid having to pass the data as a prop at every level of the component tree.
  5. The UI of the current QuotedMessage will be rendered by a QuoteAttachment component, this component will have an attachment prop, and an onCancel prop to remove the message from the array of quotedMessages.
  6. When the message is sent, then if there are quotedMessages in the array, will be sent as an attachment with the current sent message.

The code is almost ready, just the rendering of the quotedMessages as an attachment is left. Please review this if I should work further on this.

Hi @sidmohanty11 @abhinavkrin . I've almost integrated the 'Quote-Message feature' for embeddedChat, except for some issues which I'm currently facing. Anything else should I consider? Please let me know Thanks.

quote.webm

Hi @abhinavkrin @sidmohanty11 . Should I create a draft PR for this? So that it is easy to review the approach I have followed? Please let me know. I have spent quite some time to integrate this, except for a few issues which are left to be resolved.

Thanks.

abhinavkrin commented 8 months ago

Sure @umangutkarsh you can create a draft pr.

umangutkarsh commented 8 months ago

Sure @umangutkarsh you can create a draft pr.

Hi @abhinavkrin . I've created a draft pr, please review it. I think the issues which are there in this pr, are some backend related issues since the quotedMessages are not rendered as an attachment in the rocket-chat hosted server. Also when the page is reloaded, the quoted-messages are not displayed with the message that is sent. Is it related to the EmbeddedChatApi.ts file?

Also about the 'Invalid time value' error, I'll look into it.

Please let me know. Thank you.