RocketChat / EmbeddedChat

An easy to use full-stack component (ReactJS) embedding Rocket.Chat into your webapp
https://www.npmjs.com/package/@embeddedchat/react
107 stars 214 forks source link

[Feat] Add a "Scroll to Top" button #512

Open thesynthax opened 3 months ago

thesynthax commented 3 months ago

Brief Title

Feature: Adding a "Scroll to Top" button to go to the start of conversation

Acceptance Criteria fulfillment

Fixes Issue RocketChat/Rocket.Chat#511

Video/Screenshots

https://github.com/RocketChat/EmbeddedChat/assets/29705333/8758b14e-3f14-4b5c-a4ea-1b38a7e17463

Spiral-Memory commented 3 months ago

Good work! However, I don't see the necessity for this feature. In any chatting app, I have never encountered such a feature because there isn't much use case for it. Imagine a scenario with thousands of messages; does it make sense to go to the top message? Additionally, the placement of this feature is incorrect. It should not be in the kebab menu, options in this menu are used for opening sidebars here. Perhaps adding the option to go to the recent message could be considered, triggered by a floating down icon in chat body when users scroll up as you might see in whatsapp. However, this feature is also not available in the main RC app. So, I don't think these features would be very useful. Anyway, maintainers will know better. Let them review.

thesynthax commented 3 months ago

This issue describes the necessity. I have personally faced situations in WhatsApp and Discord where it was required to reach the top. It allows to establish the context of the origin of the conversation. Even with the GSoC team channels, most of them had certain messages at the start that were crucial for the aspiring GSoC contributors. Other than that, I feel that this feature may come to use for many, if not all people. Talking about the positioning of the button, I will place it wherever as required or as suggested

Spiral-Memory commented 3 months ago

I understand, but there is a reason why WhatsApp/Discord does not offer this feature. If there are numerous messages, when scrolling up, the application has to load the older messages each time. This process of reloading continues as you scroll up, making the overall experience very inefficient. Additionally, there is no control over how far back you want to go. A more effective feature would be to provide a date option, allowing users to select the specific date they want to navigate to. This gives users more control and streamlines the process. So, having the option to scroll down to go to recent message is one thing that can be added or providing a date picker for accessing older messages and selecting the desired time frame can be added. Rest is up to you..

thesynthax commented 3 months ago

That is indeed a good idea to go to a message by date, even Whatsapp has recently implemented this feature. And whatsapp mods already have this feature since long. Maybe integrating this scroll to top option into the date picker would be the best case for this feature.

Spiral-Memory commented 3 months ago

Yep! But that also has to be efficient. It depends on how messages are categorized on the backend. If they are categorized by date, users can access key-value pairs and navigate to those messages efficiently. Many factors need to be taken care of, and it also depends heavily on how the Rocket Chat server handles it. So, I suggest first proposing this feature there. Once it is optimized for message navigation by date, it can be implemented here.

thesynthax commented 3 months ago

Yes I understand

thesynthax commented 3 months ago

Hey @sidmohanty11, @abhinavkrin. We can implement this feature first, then as a complement to the searching message with date feature as mentioned above. Please take a look at this PR whenever you are available. Thank you