Skip to content

fix: prevent partial rows in table pagination#42008

Open
jiuyige wants to merge 4 commits into
appsmithorg:releasefrom
jiuyige:fix/table-pagesize-rounding
Open

fix: prevent partial rows in table pagination#42008
jiuyige wants to merge 4 commits into
appsmithorg:releasefrom
jiuyige:fix/table-pagesize-rounding

Conversation

@jiuyige

@jiuyige jiuyige commented Jul 17, 2026

Copy link
Copy Markdown

Description

The Table widget could round a fractional pageSize up, which allowed a partially visible row and caused a vertical scrollbar even when the table was intended to fit one page.

This change always floors the calculated pageSize so that only complete fixed-height rows are counted. It also updates the existing Cypress regression coverage for the default, short, and tall row-height modes.

Dynamic page-size calculation for wrapped cells is intentionally out of scope, as discussed in the issue.

Fixes #42004

Testing

  • Prettier check for the changed files
  • ESLint for the Table widget derived property
  • ESLint for the Cypress spec
  • yarn check-types
  • Pre-commit lint-staged and gitleaks checks
  • Cypress E2E run (the local config requires Appsmith test credentials)

Automation

/ok-to-test tags="@tag.All"

🔍 Cypress test results

Caution

If you modify the content in this section, you are likely to disrupt the CI result for your PR.

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

Summary by CodeRabbit

  • Bug Fixes

    • Improved TableWidgetV2 pagination/page-size calculations to consistently use floor-based sizing, yielding more predictable rows per page across the default row-height options (including compact modes).
  • Tests

    • Updated end-to-end page-size assertions for the TableV2 segmented control to match the new behavior and compare values numerically.
    • Added Jest unit coverage for getPageSize across default, short, and tall scenarios.

@coderabbitai

coderabbitai Bot commented Jul 17, 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a3c4b981-a275-48d6-bc73-4fdcd9b1fc9f

📥 Commits

Reviewing files that changed from the base of the PR and between 62d829d and 8bbdb19.

📒 Files selected for processing (2)
  • app/client/src/widgets/TableWidgetV2/widget/__tests__/derived.test/getPageSize.test.js
  • app/client/src/widgets/TableWidgetV2/widget/derived.js

Walkthrough

TableV2 now uses updated header heights and always rounds calculated page sizes down. Jest and Cypress tests cover the resulting page-size values for default, short, and tall row-height configurations.

Changes

TableV2 page-size behavior

Layer / File(s) Summary
Floor page-size calculation and regression coverage
app/client/src/widgets/TableWidgetV2/widget/derived.js, app/client/src/widgets/TableWidgetV2/widget/__tests__/derived.test/getPageSize.test.js, app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Pagesize_spec.ts
Header heights change from 38 to 40, getPageSize always applies Math.floor, and tests cover the resulting page sizes for default, short, and tall modes.

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

Poem

Fractions fall with a gentle sway,
Extra rows now drift away.
Tables fit their measured space,
Scrollbars find a smaller place.
Three checks sing, “The floor is right!”

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately describes the main change to table pagination.
Description check ✅ Passed The description includes the change summary, issue link, testing, automation, and communication sections required by the template.
Linked Issues check ✅ Passed The code fixes the reported extra partial-row scrollbar issue by flooring pageSize and updates regression coverage, matching #42004.
Out of Scope Changes check ✅ Passed The changes stay focused on table page-size calculation and related regression tests, with no clear unrelated scope introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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.

@jiuyige
jiuyige marked this pull request as ready for review July 17, 2026 04:19
@jiuyige
jiuyige requested a review from a team as a code owner July 17, 2026 04:19

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Pagesize_spec.ts`:
- Line 27: Update the page-size assertions in the relevant Cypress test to
convert each extracted text value to a number before comparison, covering all
three expectations near the existing $text assertions. Keep the expected
page-size values numeric rather than string literals.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c8ddf497-0fd8-4e24-be97-2e0ed4f95d14

📥 Commits

Reviewing files that changed from the base of the PR and between 13ee80c and 5dc63a2.

📒 Files selected for processing (2)
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Pagesize_spec.ts
  • app/client/src/widgets/TableWidgetV2/widget/derived.js

Comment thread app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Pagesize_spec.ts Outdated
@sebastianiv21 sebastianiv21 added the ok-to-test Required label for CI label Jul 17, 2026
@sebastianiv21

Copy link
Copy Markdown
Contributor

/build-deploy-preview skip-tests=true

@github-actions

Copy link
Copy Markdown

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/29593233548.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 42008.
recreate: .
base-image-tag: .

@github-actions

Copy link
Copy Markdown

Deploy-Preview-URL: https://ce-42008.dp.appsmith.com

@sebastianiv21

Copy link
Copy Markdown
Contributor

@jiuyige you can test your changes here https://ce-42008.dp.appsmith.com/

@jiuyige

jiuyige commented Jul 17, 2026

Copy link
Copy Markdown
Author

@jiuyige you can test your changes here https://ce-42008.dp.appsmith.com/

Thanks! I checked the deploy preview and noticed there’s still a 2px vertical overflow. The pageSize calculation uses a 38px header height, but the actual height is 40px.
I’ve pushed a fix in 8bbdb19 and added regression tests for all three row-height modes. Could you rebuild the deploy preview so I can check it again?

@sebastianiv21

Copy link
Copy Markdown
Contributor

/build-deploy-preview skip-tests=true

@github-actions

Copy link
Copy Markdown

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/29605676490.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 42008.
recreate: .
base-image-tag: .

@github-actions

Copy link
Copy Markdown

Deploy-Preview-URL: https://ce-42008.dp.appsmith.com

@sebastianiv21

Copy link
Copy Markdown
Contributor

@jiuyige you can test it again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Required label for CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Table widget always shows a vertical scrollbar despite fitting exactly one page of rows

2 participants