Paginate saved items list with infinite scroll#198
Merged
disnet merged 1 commit intoMay 9, 2026
Conversation
Saved-item rendering now slices the merged list into 50-item pages so DOM stays light when many items are saved. Reuses the existing InfiniteScrollSentinel already wired in SavedListView. - Extract savedItemsAll: full merged/sorted/filtered list, pre-slice. - currentItems slices to loadedArticleCount in saved view. - hasMore returns loadedArticleCount < savedItemsAll.length. - loadMore increments the cursor; checked before viewMode dispatch since saved channels still report viewMode='articles'. - setSavedView resets the cursor on inbox/archive toggle. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Saved-item views (inbox, archive, and saved channels) now render in 50-item pages and load more via the existing
InfiniteScrollSentinel, instead of dumping the whole merged list into the DOM at once. Fixes the slowdown the user reported on large saved lists.The sentinel is already mounted in
SavedListView.svelte; onlyfeedView.svelte.tsneeded work.savedItemsAll: the full merged/sorted/filtered saved list, pre-pagination.currentItemsnow slices toloadedArticleCountin saved view.hasMorereturnsloadedArticleCount < savedItemsAll.lengthfor saved view (was hardcodedfalse).loadMorechecksisSavedViewbefore theviewModedispatch — saved channels still reportviewMode === 'articles', so the saved-specific branch must run first or it would pagefilteredArticles.length(article-only) instead of the merged saved-item count.setSavedViewresets the page cursor on inbox ↔ archive toggle. Other entry points (setFilters,loadArticles) already reset.Page size is
DEFAULT_PAGE_SIZE = 50, matching articles/combined modes — single knob.Test plan
npm run checkfromfrontend/→ 0 errors (pre-existing 25 a11y warnings only, unrelated files)./saved→ only first 50 cards render initially.🤖 Generated with Claude Code