Skip to content

Add pagination to the blog listing in src/features/blog/pages/BlogPage.tsx #499

Description

@Jagadeeshftw

📌 Description

src/features/blog/pages/BlogPage.tsx (with its own test file already) appears to render the full post list via RecentPostsGrid/FeaturedPost with no pagination. As the blog grows, an unpaginated list will keep growing the initial page payload and DOM size indefinitely.

🧩 Requirements and context

  • Add pagination (or a 'load more') control to the blog listing, reusing src/shared/components/ui/pagination.tsx if it fits the existing pattern used on ContributorsPage.tsx/DataPage.tsx.
  • Preserve the featured-post treatment for the first item independent of pagination.
  • Add a test for page navigation and for the boundary (last page, single-page result set).

Non-functional requirements

  • Must be secure, tested, and documented.
  • Should be efficient and easy to review.

🛠️ Suggested execution

1. Fork the repo and create a branch

git checkout -b feature/blog-page-pagination

2. Implement changes

  • Modify: src/features/blog/pages/BlogPage.tsx — add pagination state and controls.
  • Modify: src/features/blog/components/RecentPostsGrid.tsx if it needs a paged subset prop.

3. Test and commit

  • Run tests:
npm test -- run BlogPage
  • Cover edge cases: fewer posts than one page (pagination controls should hide), exactly one full page, last page with a partial set, featured post pinned across page changes.
  • Include test output and details in the PR description.

Example commit message

feat: add pagination to the blog listing page

✅ Acceptance criteria

  • Blog listing paginates correctly with no duplicate/missing posts across pages.
  • Featured post treatment is preserved regardless of pagination state.
  • Existing single-page behavior (small data sets) renders without pagination clutter.

🔒 Security notes

None beyond standard regression risk.

📋 Guidelines

  • Minimum 95% test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

GrantFox OSSGrantFox open-source programMaybe RewardedGrantFox: potentially rewarded contributionOfficial Campaign | FWC26GrantFox official campaign issueenhancementNew feature or requestfrontendFrontend / UI work

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions