Skip to content

feat: implement infinite scroll on article list using Intersection Observer#7

Merged
owlinstack merged 2 commits into
mainfrom
feature/pinned-articles
Jul 12, 2026
Merged

feat: implement infinite scroll on article list using Intersection Observer#7
owlinstack merged 2 commits into
mainfrom
feature/pinned-articles

Conversation

@owlinstack

Copy link
Copy Markdown
Owner

Description

Replaces the manual "Load more" button with a smooth, automated infinite scroll (endless scroll) by batches of 10 articles.

Key Changes

  • Client Component ('use client'): Converted ArticleGrid to handle the dynamic infinite scroll logic.
  • Intersection Observer: Integrates the native browser API to trigger next-page fetches automatically before the user reaches the bottom.
  • Dynamic Keying: Added a dynamic React key to ArticleGrid based on current filters (activeCategory, activeTag) in page.tsx to cleanly reset the list state when filters change.

@owlinstack
owlinstack merged commit 44c0a4e into main Jul 12, 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