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

Started working #83 #1288

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Started working #83 #1288

wants to merge 4 commits into from

Conversation

E-m-i-n-e-n-c-e
Copy link

@E-m-i-n-e-n-c-e E-m-i-n-e-n-c-e commented Jan 17, 2025

Closes #83

Closes #82

Started working on this.
Here's what i did

  • Added an optional parameter anchor to MessageList and started fetching newer Messages similar to how older messages were being fetched around the anchor(if one is given)

  • Changed the single sliver to two slivers that grow in opposite directions. The center is after the anchor message with newer messages growing downward in the bottom sliver

  • Handled the case of when user is looking at the latest messages by adding a condition that when the scroll is less than (viewport size + 300 px) away from the bottom it scrolls down to the bottom. This is required now as adding new messages doesn't cause the messages to jump up. Fetching newer messages causes no jump or scroll though

  • The navigateToBottom button was initially set to scroll down to 0 which was after the changes was only scrolling down to the zero index of the toplist so i changed it to scrolldown to maxScrollExtent.

But still the navigate button works correctly when new messages are fetched as part of the scrolling process but when a single message is added to the list the maxScrollExtent does not scroll all the way down as it (for some reason) calculates the maxScrollExtent wrong.

What I did to fix the above problem was to call the scrollDown function repeatedly until the end is reached.

Videos:

20250119-1825-45.3281596.mp4
20250119-1831-50.5506127.mp4

Chat:

https://chat.zulip.org/#narrow/channel/516-mobile-dev-help/topic/Control.20scroll.20position.20on.20new.20and.20newly-fetched.20messages

@E-m-i-n-e-n-c-e E-m-i-n-e-n-c-e marked this pull request as draft January 17, 2025 15:12
@E-m-i-n-e-n-c-e E-m-i-n-e-n-c-e force-pushed the #82 branch 2 times, most recently from 6512c1e to 3d9e342 Compare January 19, 2025 18:13
@E-m-i-n-e-n-c-e E-m-i-n-e-n-c-e changed the title Started working Started working #82 Jan 19, 2025
@E-m-i-n-e-n-c-e E-m-i-n-e-n-c-e changed the title Started working #82 Started working #83 Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant