Skip to content

refactor: Pagination in DataTable - #821

Merged
aXenDeveloper merged 1 commit into
canaryfrom
refactor/pragination
Sep 23, 2026
Merged

aXenDeveloper merged 1 commit into
canaryfrom
refactor/pragination

Conversation

@aXenDeveloper

Copy link
Copy Markdown
Owner

Improving Documentation

Description

What?

Why?

@vercel

vercel Bot commented Sep 22, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
vitnode-api Ready Ready Preview Sep 22, 2026 5:26pm UTC

Request Review

@github-actions github-actions Bot added the 🧱 Refactor A code change that neither fixes a bug nor adds a feature label Sep 22, 2026

@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: 55161e96e0

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const t = useTranslations("core.global");
const { isPending, navigate, searchParams } = useDataTableUrl();
const pageSize = readTablePageSize(searchParams);
const page = currentPage ?? readTablePage(searchParams);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve cursor navigation when currentPage is null

When a table is reached through a supported cursor URL, withPagination returns currentPage: null, but this fallback treats that cursor page as page 1. Consequently the displayed range is wrong, Previous removes the cursor and jumps to the first page, and Next navigates to numbered page 2 regardless of the cursor's actual position. Retain cursor-based controls whenever currentPage is null, or normalize cursor requests before rendering this pager.

Useful? React with 👍 / 👎.

Comment on lines +217 to +221
<TableRow
className={rowOpens ? "cursor-pointer" : undefined}
key={row.id}
onClick={
rowOpens

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Make clickable table rows keyboard-operable

When rowOpens is supplied, the row is activated only through onClick; a <tr> is not keyboard-focusable and there is no Enter/Space handler, so keyboard-only users cannot perform the row's primary action. Provide an equivalent semantic, focusable keyboard interaction rather than exposing a mouse-only action.

AGENTS.md reference: AGENTS.md:L55-L56

Useful? React with 👍 / 👎.

@aXenDeveloper
aXenDeveloper added this pull request to stack #823 September 23, 2026 16:34
@aXenDeveloper
aXenDeveloper merged commit 1ce9fd8 into canary Sep 23, 2026
6 checks passed
@aXenDeveloper
aXenDeveloper deleted the refactor/pragination branch September 23, 2026 18:44

This branch was successfully deployed

1 active deployment
Preview – vitnode-api 55161e96 Deployed Sep 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧱 Refactor A code change that neither fixes a bug nor adds a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant