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

Feat: Added Scroll-to-Message Functionality #667

Merged
merged 10 commits into from
Dec 15, 2024

Conversation

abirc8010
Copy link
Contributor

@abirc8010 abirc8010 commented Nov 12, 2024

Brief Title

This pull request introduces a feature that allows users to scroll to a specific message in the message list when clicked on a message in the sidebar (in Threads , Mentions, Starred Messages, Pinned Messages and Search Messages ).

Acceptance Criteria fulfillment

  • Introduced a setJumpToMessage function inside the MessageAggregator component

  • Added an onClick event handler to the arrow-back icon that calls setJumpToMessage(msg._id) when the icon is clicked.

  • the function setJumpToMessage searches for the message element using its ID (ec-message-body-${msgId}) and uses scrollIntoView() to smoothly scroll to the message.

Video/Screenshots

jump_to_message.webm

PR Test Details

Note: The PR will be ready for live testing at https://rocketchat.github.io/EmbeddedChat/pulls/pr-667 after approval. Contributors are requested to replace <pr_number> with the actual PR number.

@abirc8010
Copy link
Contributor Author

Hey @Spiral-Memory ,
I’ve implemented a feature that allows the user to be taken directly to the specific message in the message list when they click on the message body.
Is it ok?

@Spiral-Memory
Copy link
Collaborator

Yep, looks fine but for every message, you are maintaining a ref, not sure about it's performance impact when thousands of messages are present in the channel.. will have to discuss with other collaborators to integrate this.

@abirc8010
Copy link
Contributor Author

abirc8010 commented Nov 15, 2024

Yep, looks fine but for every message, you are maintaining a ref, not sure about it's performance impact when thousands of messages are present in the channel.. will have to discuss with other collaborators to integrate this.

I have changed my approach and updated my PR description.

In this approach we don't need to maintain ref , instead we find the element directly by its id as implemented in RC

@abirc8010
Copy link
Contributor Author

@Spiral-Memory will this new approach be better ?

@Spiral-Memory
Copy link
Collaborator

Yes, it do look like a good and feasible solution, have to test it once and I'll let you know

Thanks for the PR @abirc8010

Copy link
Collaborator

@Spiral-Memory Spiral-Memory left a comment

Choose a reason for hiding this comment

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

Testing deployment

@abirc8010
Copy link
Contributor Author

Hey @Spiral-Memory,
I fixed an alignment issue with the scroll-to-message icon in popup mode in my latest commit. You can review and approve the changes to see them reflected in the deployment.

@Spiral-Memory
Copy link
Collaborator

Awesome work @abirc8010
Happy contributing..

@Spiral-Memory Spiral-Memory merged commit 28a8202 into RocketChat:develop Dec 15, 2024
3 checks passed
github-actions bot added a commit that referenced this pull request Dec 15, 2024
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.

2 participants