Skip to content

fix: notebook pagination styling - #479

Merged
dmitriy-kostianetskiy merged 5 commits into
mainfrom
fix/notebook-pagination
Mar 18, 2026
Merged

dmitriy-kostianetskiy merged 5 commits into
mainfrom
fix/notebook-pagination

Conversation

@dmitriy-kostianetskiy

@dmitriy-kostianetskiy dmitriy-kostianetskiy commented Mar 18, 2026 •

Copy link
Copy Markdown
Collaborator

Task: #438

  • Fix outline\overflow issue and hide arrows in numeric input
image
  • Refactor DataTablePaginated

Summary by CodeRabbit

  • Refactor

    • Pagination and footer logic reorganized: footer moved to a dedicated component and paginated table exported as a named module (import shape updated).
  • New Features

    • Added a reusable page-size selector and enhanced pagination controls (first/prev/next/last, page input).
  • Style

    • Added a utility to hide number-input spinners for consistent numeric input styling.
  • Documentation

    • Formatting and layout updates to CLAUDE.md.
  • Bug Fixes

    • Improved JSON-schema autocomplete to more reliably resolve property names.

@coderabbitai

coderabbitai Bot commented Mar 18, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d6e75c56-24f9-42c6-a98f-85d1e6c66680

📥 Commits

Reviewing files that changed from the base of the PR and between 5567490 and 7085ae2.

📒 Files selected for processing (1)
  • packages/data-table/src/DataTablePaginatedFooter.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/data-table/src/DataTablePaginatedFooter.tsx

📝 Walkthrough

Walkthrough

Refactors 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

Cohort / File(s) Summary
Export Shape Updates
packages/data-table/src/DataTablePaginated.tsx, packages/data-table/src/DataTableArrowPaginated.tsx, packages/data-table/src/index.ts
Converted DataTablePaginated from a default export to a named export and updated imports/exports accordingly.
Footer Component Extraction
packages/data-table/src/DataTablePaginatedFooter.tsx (new)
Introduced DataTablePaginatedFooter to encapsulate footer UI/state: page navigation, page input, page size control, optional row count and footer actions.
DataTablePaginated Refactor
packages/data-table/src/DataTablePaginated.tsx
Removed inline footer and internal page-index state; delegates footer rendering to DataTablePaginatedFooter; reduced UI-library imports.
Page Size Selection
packages/data-table/src/PageSizeSelect.tsx (new)
Added PageSizeSelect component providing selectable page-size options and change callback.
Import Typings Update
packages/data-table/src/QueryDataTable.tsx
Changed DataTablePaginatedProps import to a type-only import (no runtime change).
Styling Utilities
packages/ui/tailwind-preset.css
Added .no-spinner utility to remove number-input spinners via WebKit rules.
Editor Autocomplete Fix
packages/codemirror/src/extensions/json-schema-autocomplete.ts
Improved getPropertyName to climb the AST to the nearest Property before extracting PropertyName.
Docs Formatting
CLAUDE.md
Whitespace and Markdown reflow changes; formatting-only edits to examples and code fences.

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I nudged the footer out to play,
Named exports hopped into the day,
Spinners vanished, sizes picked with glee,
JSON names climbed up the tree,
A tiny refactor—hip hooray! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: notebook pagination styling' accurately summarizes the main focus of the PR—fixing pagination-related styling issues, which aligns with the core changes refactoring DataTablePaginated and adding pagination footer styling.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/notebook-pagination
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?.pageIndex with prevPageIndex and calling setInternalPageIndex during render) is a valid React pattern for syncing derived state with props. This replaces the deprecated getDerivedStateFromProps. 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

📥 Commits

Reviewing files that changed from the base of the PR and between 5100260 and b6ebdc5.

📒 Files selected for processing (8)
  • CLAUDE.md
  • packages/data-table/src/DataTableArrowPaginated.tsx
  • packages/data-table/src/DataTablePaginated.tsx
  • packages/data-table/src/DataTablePaginatedFooter.tsx
  • packages/data-table/src/PageSizeSelect.tsx
  • packages/data-table/src/QueryDataTable.tsx
  • packages/data-table/src/index.ts
  • packages/ui/tailwind-preset.css

Comment thread packages/data-table/src/DataTablePaginatedFooter.tsx Outdated

Copilot AI commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

@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]>
@dmitriy-kostianetskiy
dmitriy-kostianetskiy merged commit ed9b08a into main Mar 18, 2026
4 checks passed
@dmitriy-kostianetskiy
dmitriy-kostianetskiy deleted the fix/notebook-pagination branch March 18, 2026 11:30
dmitriy-kostianetskiy added a commit that referenced this pull request Mar 20, 2026
Co-authored-by: Copilot <[email protected]>
Co-authored-by: dmitriy-kostianetskiy <[email protected]>
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.

3 participants