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

Completely redesign pagination code, support backwards pagination upon scroll #194

Merged
merged 2 commits into from
Oct 12, 2024

Conversation

kevinaboos
Copy link
Member

@kevinaboos kevinaboos commented Oct 12, 2024

Remove the separate pagination state subscriber task, which was previously being spawned once for every room. That was unnecessary and actually provided less information than just waiting for the result of the original task that actually called the paginate function.

Store the most-recently-scrolled-through item index in TimelineUiState such that we can determine whether when the user is scrolling upwards and has just hit the top-most item, at which point we fire off a backwards pagination request.

Closes #109

…n scroll

Remove the separate pagination state subscriber task, which was previously
being spawned once for every room. That was unnecessary and actually provided
less information than just waiting for the result of the original task
that actually called the paginate function.

Store the most-recently-scrolled-through item index in `TimelineUiState`
such that we can determine whether when the user is scrolling upwards
and has just hit the top-most item, at which point we fire off
a backwards pagination request.
Clean up various pagination code.

Re-format the TopSpace (for pagination loading messages) to be
a lightly-transparent green, and to be an Overlay atop the timeline
such that it doesn't affect the positional stability of timeline items.

Refactor RoomScreen event-handling functions to remove redundant calls
to `self.portal_list(id!(timeline.list))`. We now call this once
at the top of the `RoomScreen::handle_event()` in order to have a
single `PortalListRef` that can be used across all the related
event handling functions.
@kevinaboos kevinaboos merged commit 080df5d into project-robius:main Oct 12, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Automatically paginate timeline based on scroll position/movement
1 participant