Skip to content

Rewrite infinite scroll, add album pagination and thumbnail previews#20

Merged
pedrokarim merged 1 commit intomainfrom
dev
Mar 15, 2026
Merged

Rewrite infinite scroll, add album pagination and thumbnail previews#20
pedrokarim merged 1 commit intomainfrom
dev

Conversation

@pedrokarim
Copy link
Owner

  • Rewrite useInfiniteScroll hook from scratch: state-driven loading loop with [inView, loading, hasMore] deps, generation counter for race conditions, atomic reset(data, hasMore)
  • Clean up gallery client: render-time ref assignment, mountedRef filter effect, remove tangled ref sync useEffect
  • Add pagination to /api/albums/[id]/files with page param (PAGE_SIZE=12)
  • Rewrite album detail page to use useInfiniteScroll instead of loading all files at once
  • Use /api/thumbnails/ for album card previews instead of full-size images

- Rewrite useInfiniteScroll hook from scratch: state-driven loading loop
  with [inView, loading, hasMore] deps, generation counter for race
  conditions, atomic reset(data, hasMore)
- Clean up gallery client: render-time ref assignment, mountedRef filter
  effect, remove tangled ref sync useEffect
- Add pagination to /api/albums/[id]/files with page param (PAGE_SIZE=12)
- Rewrite album detail page to use useInfiniteScroll instead of loading
  all files at once
- Use /api/thumbnails/ for album card previews instead of full-size images
@pedrokarim pedrokarim merged commit 364256b into main Mar 15, 2026
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

None yet

Development

Successfully merging this pull request may close these issues.

1 participant