Repository navigation
fix: notebook pagination styling - #479
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughRefactors DataTablePaginated into a named export, extracts footer and page-size UI into new components, updates import/export sites and typings, adds a .no-spinner CSS utility, tweaks CodeMirror JSON property name resolution, and applies formatting changes to CLAUDE.md. Changes
Sequence DiagramsequenceDiagram
participant Client
participant DataTablePaginated
participant DataTablePaginatedFooter
participant PageSizeSelect
participant TableInstance
Client->>DataTablePaginated: render(pagination, isFetching, numRows, footerActions)
DataTablePaginated->>TableInstance: create/pass table instance
DataTablePaginated->>DataTablePaginatedFooter: provide table, pagination, isFetching, numRows, footerActions
DataTablePaginatedFooter->>DataTablePaginatedFooter: sync internalPageIndex with pagination.pageIndex
DataTablePaginatedFooter->>PageSizeSelect: render(current pageSize)
Client->>DataTablePaginatedFooter: click Next / Prev or edit page input
DataTablePaginatedFooter->>TableInstance: table.setPageIndex / table.nextPage / table.previousPage
TableInstance->>DataTablePaginatedFooter: update pagination state
Client->>PageSizeSelect: choose page size
PageSizeSelect->>TableInstance: table.setPageSize(newSize)
TableInstance->>DataTablePaginatedFooter: reflect new pageSize/pagination
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/data-table/src/DataTablePaginatedFooter.tsx (1)
40-48: State synchronization pattern is correct but consider adding a comment.The "state-in-render" pattern (comparing
pagination?.pageIndexwithprevPageIndexand callingsetInternalPageIndexduring render) is a valid React pattern for syncing derived state with props. This replaces the deprecatedgetDerivedStateFromProps. Consider adding a brief comment explaining this synchronization to help future maintainers.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/data-table/src/DataTablePaginatedFooter.tsx` around lines 40 - 48, Add an inline comment above the render-time state-sync block explaining why the code compares pagination?.pageIndex with prevPageIndex and calls setInternalPageIndex/setPrevPageIndex during render: note that this is an intentional "state-in-render" pattern to synchronize derived local state (internalPageIndex) with incoming prop pagination?.pageIndex (replacing older getDerivedStateFromProps) and that it avoids extra effects; reference the variables internalPageIndex, setInternalPageIndex, prevPageIndex, setPrevPageIndex and pagination?.pageIndex in the comment for clarity.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/data-table/src/DataTablePaginatedFooter.tsx`:
- Around line 140-144: In DataTablePaginatedFooter.tsx replace the global
isFinite check with Number.isFinite to match other uses and avoid coercion:
update the conditional that currently reads {numRows !== undefined &&
isFinite(numRows) ? ...} to use Number.isFinite(numRows) so only actual finite
numeric values pass (this affects the rendering block that shows
{`${formatCount(numRows)} rows`}).
---
Nitpick comments:
In `@packages/data-table/src/DataTablePaginatedFooter.tsx`:
- Around line 40-48: Add an inline comment above the render-time state-sync
block explaining why the code compares pagination?.pageIndex with prevPageIndex
and calls setInternalPageIndex/setPrevPageIndex during render: note that this is
an intentional "state-in-render" pattern to synchronize derived local state
(internalPageIndex) with incoming prop pagination?.pageIndex (replacing older
getDerivedStateFromProps) and that it avoids extra effects; reference the
variables internalPageIndex, setInternalPageIndex, prevPageIndex,
setPrevPageIndex and pagination?.pageIndex in the comment for clarity.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d34ce40f-ff2b-47e2-98fc-467250e883b5
📒 Files selected for processing (8)
CLAUDE.mdpackages/data-table/src/DataTableArrowPaginated.tsxpackages/data-table/src/DataTablePaginated.tsxpackages/data-table/src/DataTablePaginatedFooter.tsxpackages/data-table/src/PageSizeSelect.tsxpackages/data-table/src/QueryDataTable.tsxpackages/data-table/src/index.tspackages/ui/tailwind-preset.css
|
@dmitriy-kostianetskiy I've opened a new pull request, #482, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: dmitriy-kostianetskiy <[email protected]>
Co-authored-by: Copilot <[email protected]> Co-authored-by: dmitriy-kostianetskiy <[email protected]>
Task: #438
Summary by CodeRabbit
Refactor
New Features
Style
Documentation
Bug Fixes