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: implement loading of older messages functionality #810

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

SinghaAnirban005
Copy link
Contributor

@SinghaAnirban005 SinghaAnirban005 commented Jan 5, 2025

Brief Title

Implement Loading of Older Messages Feature

Acceptance Criteria fulfillment

  • Implemented functionality to load older messages on scroll
  • Created backend endpoint getOlderMessages to fetch older messages.
  • Ensured UI displays older messages smoothly when loaded.

Fixes #793

Video/Screenshots

EmbeddedChat._.Simple.-.Simple.Storybook.-.Personal.-.Microsoft.Edge.2025-01-06.02-18-31.mp4

PR Test Details

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

@abirc8010
Copy link
Contributor

Hey @SinghaAnirban005, could you please check something? In your workspace, try reducing the number of messages returned by the API (say 4 or 6 maybe for testing purpose). After that, try loading the messages again. Are the older messages being fetched correctly ? I noticed that you're increasing the offset by 50 everytime.

@SinghaAnirban005
Copy link
Contributor Author

The endpoint responds back with around 50 as limit so having offset as 4 or 6 would not make sense . In every batch around 50 is limit so is the offset accordingly, and yes it does fetch all messages .

@abirc8010
Copy link
Contributor

No no I am not telling you to set offset increment to 4 or 6. You said the api returns in batches of 50 but you can modify this value from your workspace right? I am telling you to try reducing this value.

@SinghaAnirban005
Copy link
Contributor Author

Well , got it ...
i believe then hardcoding the offset value isn't a very good thing , will make changes
Thank You !

@Spiral-Memory
Copy link
Collaborator

Spiral-Memory commented Jan 11, 2025

Hey @SinghaAnirban005
This is an awesome PR and a very much needed addition.
Thanks a lot for this!

Just one request: the alignment isn’t very good. Can you move the loader a bit higher, farther to the date? Right now, it looks too close.

image

Also, how did it fetch older messages before? Was there no such functionality earlier?
I saw in your issue that you mentioned some manual trigger—what’s that?

@SinghaAnirban005
Copy link
Contributor Author

Hey @SinghaAnirban005 This is an awesome PR and a very much needed addition. Thanks a lot for this!

Just one request: the alignment isn’t very good. Can you move the loader a bit higher, farther to the date? Right now, it looks too close.

image

Also, how did it fetch older messages before? Was there no such functionality earlier? I saw in your issue that you mentioned some manual trigger—what’s that?

There was no provision to fetch older messages earlier
Regarding the manual trigger thing i believe it was related to rendering of emojis on the chatInput section where i had to manually trigger a function so that emojis could be seen in visual manner

@SinghaAnirban005
Copy link
Contributor Author

@Spiral-Memory
After changes

EmbeddedChat._.Simple.-.Simple.Storybook.-.Personal.-.Microsoft.Edge.2025-01-11.19-20-03.mp4

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.

Feat: Infinite Scroll for Older Messages
3 participants