Skip to content

feat: infinite scroll for past parties in registration tracker - #473

Merged
naasanov merged 4 commits into
mainfrom
vidur/regis-track-limit
Jun 26, 2026
Merged

feat: infinite scroll for past parties in registration tracker#473
naasanov merged 4 commits into
mainfrom
vidur/regis-track-limit

Conversation

@VidurShah

Copy link
Copy Markdown
Collaborator

The registration tracker rendered all past party cards at once with no limit, which could cause jank on mobile for users with many parties.

Changes:

  • Added useInfiniteScroll hook — wraps IntersectionObserver to progressively reveal items from an in-memory list as the user scrolls to a sentinel element. Uses refs for total/pageSize inside the callback to avoid stale closures, and only resets the visible count when the list shrinks (not on every data refresh).
  • Replaced the unbounded pastParties.map(...) in RegistrationTracker with visiblePastParties (sliced to visibleCount) and a sentinel <div> that triggers the next page load when it enters the viewport.
  • Kept active parties and incidents unbounded — active parties are expected to be few, and incidents don't benefit from the same pattern.
  • No backend pagination needed: researched the data volume question from the issue. A student's lifetime party count is unlikely to exceed a few dozen, so client-side slicing is sufficient. The hook is still fully decoupled and could be swapped for a server-paginated version later if needed.

Closes #438

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown

Test Results Summary

870 tests  ±0   870 ✅ ±0   1m 9s ⏱️ ±0s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 373bad4. ± Comparison against base commit 2004c9c.

♻️ This comment has been updated with latest results.

@naasanov naasanov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@naasanov
naasanov merged commit bd6594c into main Jun 26, 2026
3 checks passed
@naasanov
naasanov deleted the vidur/regis-track-limit branch June 26, 2026 18:28
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.

Limit Registration Tracker Card Rendering

2 participants