This commit is contained in:
Arjun Patel
2026-06-09 10:10:32 -07:00
parent 38cecd84bd
commit 0604b260d2
+5 -10
View File
@@ -10,8 +10,8 @@ export type StreamParticle = Particle & {
properties: StreamProperties; properties: StreamProperties;
}; };
const INITIAL_PAGE_SIZE = 3; const INITIAL_PAGE_SIZE = 12;
const PAGE_INCREMENT = 3; const PAGE_INCREMENT = 12;
// Stable where-constraint references so the Firestore subscription only // Stable where-constraint references so the Firestore subscription only
// re-attaches when the tab actually changes, not on every render. // re-attaches when the tab actually changes, not on every render.
@@ -28,12 +28,7 @@ function useVisibilityScopes(userId?: string, networkId?: string) {
} }
interface UseStreamParticlesOptions { interface UseStreamParticlesOptions {
/** // Which streams to subscribe to
* Which streams to subscribe to. Open streams are loaded in full (bounded
* by active work — full realtime coverage is needed for autoplay/huddles).
* Closed streams are paginated via `loadMore`.
*/
// TODO: can't we paginate open streams, and if the top set changes then our auto-play would still trigger?
status: 'open' | 'closed'; status: 'open' | 'closed';
} }
@@ -41,9 +36,9 @@ interface UseStreamParticlesResult {
streams: StreamParticle[]; streams: StreamParticle[];
isLoading: boolean; isLoading: boolean;
networkId: string; networkId: string;
/** True when more closed streams may exist beyond the current window. */ /** True when more streams may exist beyond the current window. */
canLoadMore: boolean; canLoadMore: boolean;
/** Extend the pagination window. No-op on the open tab. */ /** Extend the pagination window. */
loadMore: () => void; loadMore: () => void;
} }