Skip to content

Conversation

@butschster
Copy link
Member

Depends on #245

Summary

This PR adds events pagination on the frontend and integrates infinite scrolling for a dynamic event stream.

The implementation is designed for a continuously updating list where new events may appear at the top, while older events are loaded incrementally as the user scrolls.


What is implemented

  • Initial page load:
    • fetches event counts per type
    • loads the first page (limit = 25) for each event type
  • Requests are executed in parallel, UI updates incrementally as data arrives
  • Pagination metadata (has_more, next_cursor) is used to load subsequent pages
  • Infinite scrolling is implemented via IntersectionObserver
    • rootMargin = 200px is used to preload data before reaching the bottom

Edge cases handled

  • No scroll appears when content fits the screen
    → next page is loaded automatically
  • Scroll stuck at the bottom when new items are prepended
    → scroll position is slightly adjusted to allow observer triggering
  • Scroll height smaller than rootMargin after initial load
    → additional page is auto-loaded to prevent pagination stall

Result

The frontend now supports stable, smooth infinite scrolling for events and scales to loading all available events without artificial limits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants