Skip to content

Paginate saved items list with infinite scroll#198

Merged
disnet merged 1 commit into
mainfrom
radial/3mlgjwp6/makes-saved-items-list-infinite-scroll
May 9, 2026
Merged

Paginate saved items list with infinite scroll#198
disnet merged 1 commit into
mainfrom
radial/3mlgjwp6/makes-saved-items-list-infinite-scroll

Conversation

@disnet
Copy link
Copy Markdown
Owner

@disnet disnet commented May 9, 2026

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; only feedView.svelte.ts needed work.

  • Extract savedItemsAll: the full merged/sorted/filtered saved list, pre-pagination.
  • currentItems now slices to loadedArticleCount in saved view.
  • hasMore returns loadedArticleCount < savedItemsAll.length for saved view (was hardcoded false).
  • loadMore checks isSavedView before the viewMode dispatch — saved channels still report viewMode === 'articles', so the saved-specific branch must run first or it would page filteredArticles.length (article-only) instead of the merged saved-item count.
  • setSavedView resets 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 check from frontend/ → 0 errors (pre-existing 25 a11y warnings only, unrelated files).
  • With >100 saved items, navigate to /saved → only first 50 cards render initially.
  • Scroll to bottom → next 50 append, no flicker, scroll position preserved.
  • Continue paging until end → sentinel stops, total matches the full saved-items count.
  • Toggle inbox → archive → inbox: cursor resets, paging still works.
  • Apply a date / reading length / domain / tag filter on a saved channel and a sort change → list updates and paging works against the filtered total.
  • Open a reader on item ~49, close → scroll position restored.

🤖 Generated with Claude Code

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>
@disnet disnet merged commit a878463 into main May 9, 2026
3 of 4 checks passed
@disnet disnet deleted the radial/3mlgjwp6/makes-saved-items-list-infinite-scroll branch May 9, 2026 22:02
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