Skip to content

Conversation

@vchurbanov
Copy link

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.

@butschster butschster changed the base branch from master to feature/events-pagination January 29, 2026 14:17
@butschster butschster merged commit 0db0684 into buggregator:feature/events-pagination Jan 29, 2026
0 of 6 checks 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.

2 participants