Skip to content

docs: correct the pageCount -1 note in the pagination guides - #6518

Open
dfedoryshchev wants to merge 1 commit into
TanStack:mainfrom
dfedoryshchev:docs/pagination-page-count-note
Open

docs: correct the pageCount -1 note in the pagination guides#6518
dfedoryshchev wants to merge 1 commit into
TanStack:mainfrom
dfedoryshchev:docs/pagination-page-count-note

Conversation

@dfedoryshchev

@dfedoryshchev dfedoryshchev commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Changes

In the manual-pagination guide, the Page Count and Row Count section says that with pageCount: -1 both getCanNextPage and getCanPreviousPage "will always return true". That holds for getCanNextPage only. table_getCanPreviousPage never reads pageCount: in rowPaginationFeature.utils.ts it is return (table.atoms.pagination?.get()?.pageIndex ?? 0) > 0, so it is still false on page 0, and a reader following the guide would leave a "Previous" button enabled on the first page.

Both JSDoc blocks in that file already describe the real behaviour, and the unit tests cover the -1 case for getCanNextPage only, so this is the guide prose having drifted rather than a code bug.

Corrected in all 10 framework copies of the guide, which carry the sentence verbatim. Prose only.

Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Documentation
    • Clarified pagination behavior across framework guides.
    • Documented that previous-page availability depends only on whether the current page index is greater than zero.
    • Clarified that when the total page count is unknown (pageCount: -1), next-page navigation remains enabled.
    • Updated server-side and manual pagination guidance for consistent behavior across supported frameworks.

The manual-pagination section says that with `pageCount: -1` both
`getCanNextPage` and `getCanPreviousPage` always return `true`. Only
`getCanNextPage` does. `table_getCanPreviousPage` never reads `pageCount`;
it returns `pageIndex > 0`, so it is `false` on the first page whatever the
page count is.
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9103040e-ba2e-4b3d-a331-628d5138f8d1

📥 Commits

Reviewing files that changed from the base of the PR and between 50feff8 and 413b5fa.

📒 Files selected for processing (10)
  • docs/framework/alpine/guide/pagination.md
  • docs/framework/angular/guide/pagination.md
  • docs/framework/ember/guide/pagination.md
  • docs/framework/lit/guide/pagination.md
  • docs/framework/octane/guide/pagination.md
  • docs/framework/preact/guide/pagination.md
  • docs/framework/react/guide/pagination.md
  • docs/framework/solid/guide/pagination.md
  • docs/framework/svelte/guide/pagination.md
  • docs/framework/vue/guide/pagination.md

📝 Walkthrough

Walkthrough

Changes

Pagination documentation

Layer / File(s) Summary
Navigation availability documentation
docs/framework/*/guide/pagination.md
The guides clarify that getCanNextPage remains true when pageCount is -1. getCanPreviousPage depends only on whether pageIndex is greater than zero.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: kevinvandy

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the documentation correction for the pageCount -1 note across pagination guides.
Description check ✅ Passed The description clearly explains the documentation-only change and release impact, but it omits the required Checklist section.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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