Add pagination for closed streams with status filtering #148

Merged
talksik merged 1 commits from claude/evaluate-issue-138-risk-LqWHK into master 2026-04-12 18:55:23 +00:00
talksik commented 2026-04-12 18:53:58 +00:00 (Migrated from github.com)

Closes #138

Summary

This PR implements pagination for closed streams and adds status-based filtering to the stream list. Open streams are now loaded in full with real-time updates, while closed streams are paginated with a "Load more" button to improve performance and UX.

Key Changes

  • Status-based filtering: useStreamParticles now accepts a status option ("open" or "closed") and filters streams accordingly using Firestore where constraints
  • Pagination for closed streams: Closed streams are paginated with an initial page size of 50 items, incrementing by 50 on each "Load more" click
  • Firestore query optimization: Added limit parameter support to useLiveParticleChildren and subscribeToParticleChildren to cap query results
  • UI updates: Added "Load more" button to ParticleListView that appears when additional closed streams may exist
  • Tab switching: Closed stream pagination window resets when switching back to the closed tab to avoid ever-growing subscriptions during long sessions

Implementation Details

  • Stable filter references (OPEN_STATUS_FILTER, CLOSED_STATUS_FILTER) prevent unnecessary Firestore re-subscriptions on render
  • Pagination heuristic: if returned items equal the requested limit, assume more may exist
  • Open streams maintain full real-time coverage needed for autoplay/huddles functionality
  • The filtering logic moved from NetworkRoot component into the hook, simplifying the component and improving separation of concerns

https://claude.ai/code/session_01M9w7RQvj5CBQwkn8ZgLpSE

Closes #138 ## Summary This PR implements pagination for closed streams and adds status-based filtering to the stream list. Open streams are now loaded in full with real-time updates, while closed streams are paginated with a "Load more" button to improve performance and UX. ## Key Changes - **Status-based filtering**: `useStreamParticles` now accepts a `status` option ("open" or "closed") and filters streams accordingly using Firestore `where` constraints - **Pagination for closed streams**: Closed streams are paginated with an initial page size of 50 items, incrementing by 50 on each "Load more" click - **Firestore query optimization**: Added `limit` parameter support to `useLiveParticleChildren` and `subscribeToParticleChildren` to cap query results - **UI updates**: Added "Load more" button to `ParticleListView` that appears when additional closed streams may exist - **Tab switching**: Closed stream pagination window resets when switching back to the closed tab to avoid ever-growing subscriptions during long sessions ## Implementation Details - Stable filter references (`OPEN_STATUS_FILTER`, `CLOSED_STATUS_FILTER`) prevent unnecessary Firestore re-subscriptions on render - Pagination heuristic: if returned items equal the requested limit, assume more may exist - Open streams maintain full real-time coverage needed for autoplay/huddles functionality - The filtering logic moved from `NetworkRoot` component into the hook, simplifying the component and improving separation of concerns https://claude.ai/code/session_01M9w7RQvj5CBQwkn8ZgLpSE
Sign in to join this conversation.