Skip to content

Feat: Added Scroll-to-Message Functionality#667

Merged
Spiral-Memory merged 10 commits intoRocketChat:developfrom
abirc8010:fix-issue
Dec 15, 2024
Merged

Feat: Added Scroll-to-Message Functionality#667
Spiral-Memory merged 10 commits intoRocketChat:developfrom
abirc8010:fix-issue

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
github-actions bot added a commit that referenced this pull request Dec 15, 2024
@Spiral-Memory Spiral-Memory added the epic this is a must have feature label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

epic this is a must have feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants