Skip to content

feat: Add infinite scroll in the templates list#442

Merged
Kraci merged 1 commit into
mainfrom
implement-infinite-scroll-in-the-templates-list-en-1028
Jun 22, 2026
Merged

feat: Add infinite scroll in the templates list#442
Kraci merged 1 commit into
mainfrom
implement-infinite-scroll-in-the-templates-list-en-1028

Conversation

@Kraci

@Kraci Kraci commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Add infinite scrolling to the templates list. The list should automatically load additional results as the user scrolls.

Scenarios

  • The user scrolls through the list, and additional templates are loaded automatically.
  • On larger screens, additional templates are loaded automatically if the initial results do not fill the available viewport.

@Kraci Kraci self-assigned this Jun 21, 2026
@linear-code

linear-code Bot commented Jun 21, 2026

Copy link
Copy Markdown

EN-1028

@cla-bot cla-bot Bot added the cla-signed label Jun 21, 2026
@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web Ready Ready Preview, Comment Jun 21, 2026 1:50pm

Request Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b5e6a522ab

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/features/dashboard/templates/list/table-body.tsx

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — small, standard infinite-scroll addition built on the existing virtualizer and pagination plumbing.

Extended reasoning...

Overview

Single-file change to src/features/dashboard/templates/list/table-body.tsx adding automatic prefetch when the virtualized scroll position is within 8 rows of the end of the loaded list. The component already received hasNextPage, isFetchingNextPage, fetchNextPage, and isRefetching props (previously only wired to a manual LoadMoreButton, which is preserved as a fallback).

Security risks

None. Pure client-side UX change to a list component — no auth, crypto, permissions, or data-boundary handling.

Level of scrutiny

Low. Mechanical, follows the standard @tanstack/react-virtual infinite-scroll pattern: read last virtual item index, fire fetchNextPage() in a useEffect when within a threshold. The guard conditions (hasNextPage && !isFetchingNextPage && !isRefetching) prevent duplicate fetches, and the dependency array is complete.

Other factors

useVirtualRows already returns virtualizer (verified in src/lib/hooks/use-virtual-rows.ts:45), so the destructuring is sound. No bug hunter findings. The fallback LoadMoreButton remains, so even if prefetch misfires the user can still advance pagination manually.

@Kraci Kraci merged commit 0274a8d into main Jun 22, 2026
14 checks passed
@Kraci Kraci deleted the implement-infinite-scroll-in-the-templates-list-en-1028 branch June 22, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants