- Notifications
You must be signed in to change notification settings - Fork4.4k
feat: added setPageNumber function for Table v2 widget#41421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:release
Are you sure you want to change the base?
Conversation
coderabbitaibot commentedNov 26, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
WalkthroughAdds a public setter Changes
Sequence Diagram(s)sequenceDiagram participant Caller as External code participant Setter as Widget Setter API participant Widget as TableWidgetV2 participant Runtime as Evaluation / DataTree participant Server as onPageChange handler Note over Caller,Setter: New public setter exposed Caller->>Setter: setPageNumber(targetPage) Setter->>Widget: set pageNo = targetPage %%cyan%% alt targetPage > maxPage Widget->>Widget: clamp pageNo = maxPage %%orange%% Widget->>Widget: mark navigation = NEXT_PAGE Widget-->>Setter: resolved (clamped) else not clamped Widget->>Runtime: propagate pageNo change / re-evaluate bindings %%cyan%% Runtime-->>Widget: evaluation complete alt server-side pagination enabled & onPageChange exists Widget->>Server: updatePageNumber(eventType=ON_NEXT_PAGE|ON_PREV_PAGE) %%green%% Server-->>Widget: fetch/ack end Widget-->>Setter: resolved endNotes: colored notes indicate (cyan) typical propagation path, (orange) clamp path, (green) server callback. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates thehigh-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Thanks for usingCodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
tomjose92 commentedNov 26, 2025
/build-deploy-preview skip-tests=true |
Deploying Your Preview:https://github.com/appsmithorg/appsmith/actions/runs/19710098635. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
app/client/src/widgets/TableWidgetV2/widget/index.tsx(1 hunks)app/client/src/widgets/wds/WDSTableWidget/config/settersConfig.ts(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: client-build / client-build
- GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
- GitHub Check: client-lint / client-lint
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: client-prettier / prettier-check
🔇 Additional comments (1)
app/client/src/widgets/wds/WDSTableWidget/config/settersConfig.ts (1)
17-20: I'll help you verify the review comment by examining how WDSTableWidget processes thepageNoproperty and checking for proper pagination handling.
<function_calls>
#!/bin/bashFind WDSTableWidget implementation files
echo "=== Finding WDSTableWidget files ==="
fd -t f "WDSTableWidget" app/client/src/widgets/wds/ 2>/dev/null | head -20echo -e "\n=== Directory structure ==="
find app/client/src/widgets/wds/WDSTableWidget -type f -name ".ts" -o -name ".tsx" 2>/dev/null | head -30
</function_calls><function_calls>
#!/bin/bashSearch for pageNo property handling in WDSTableWidget
echo "=== Searching for pageNo handling in WDSTableWidget ==="
rg -n "pageNo|updatePageNumber|onPageChange|setPageNumber" app/client/src/widgets/wds/WDSTableWidget/ -t ts -t tsx -A 3 -B 3 | head -100
</function_calls><function_calls>
#!/bin/bashCheck the settersConfig.ts file
echo "=== Current settersConfig.ts content ==="
cat -n app/client/src/widgets/wds/WDSTableWidget/config/settersConfig.ts | head -40
</function_calls>
Uh oh!
There was an error while loading.Please reload this page.
Deploy-Preview-URL:https://ce-41421.dp.appsmith.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
app/client/src/entities/DataTree/dataTreeWidget.test.ts (1)
558-561:LGTM! Setter config correctly added and transformed.The
setPageNumbersetter configuration is properly structured with:
- Path mapped to
pageNoproperty- Type set to
number- Correct transformation from relative path to absolute path (
Table1.pageNo)This follows the same pattern as other table setters like
setDataandsetSelectedRowIndex.Consider whether a
disabledcondition should be added (similar tosetSelectedRowIndexwhich checksmultiRowSelection). For example, shouldsetPageNumberbe disabled when the table has no data or only one page?Also applies to: 604-607
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
app/client/src/entities/DataTree/dataTreeWidget.test.ts(2 hunks)app/client/src/workers/Evaluation/__tests__/setters.test.ts(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: client-lint / client-lint
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: client-build / client-build
- GitHub Check: client-prettier / prettier-check
- GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
🔇 Additional comments (2)
app/client/src/workers/Evaluation/__tests__/setters.test.ts (2)
69-69:LGTM! Setter properly added to expected map.The
setPageNumbersetter is correctly included in the test expectations alongside existing Table widget setters.
92-102:Implementation verified and correctly implemented.The
setPageNumbersetter is properly configured in both TableWidgetV2 (app/client/src/widgets/TableWidgetV2/widget/index.tsx:568) and WDSTableWidget (app/client/src/widgets/wds/WDSTableWidget/config/settersConfig.ts:17), mapping to thepageNoproperty with typenumber. The test correctly verifies this mapping by callingsetPageNumber(2)and asserting thatpageNoequals 2.
…ter function has been introduced that can change the value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
app/client/src/widgets/TableWidgetV2/widget/propertyConfig/contentConfig.ts (1)
250-263:Polish the newpageNocontrol with help text (and optionally visibility rules)The config itself looks fine and the numeric validation matches how
pageNois used. For UX consistency with the rest of the Pagination section, consider adding a shorthelpText, and, if this control is meant mainly for server-side pagination, optionally gate it behindserverSidePaginationEnabledliketotalRecordsCount.Example minimal tweak for clarity:
{ propertyName: "pageNo", label: "Page number", controlType: "INPUT_TEXT", isBindProperty: true, isTriggerProperty: false,+ helpText: "Current page number (1-based). Can be controlled via JS (setPageNumber).", validation: { type: ValidationTypes.NUMBER, params: { min: 1, default: 1, }, }, },If you decide it should only surface for server-side pagination, you could also mirror the pattern used on
totalRecordsCountwithhiddenanddependencies.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/client/src/widgets/TableWidgetV2/widget/propertyConfig/contentConfig.ts(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: perform-test / server-build / server-unit-tests
- GitHub Check: perform-test / client-build / client-build
- GitHub Check: perform-test / rts-build / build
- GitHub Check: client-build / client-build
- GitHub Check: client-prettier / prettier-check
- GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: client-lint / client-lint
tomjose92 commentedNov 27, 2025
/build-deploy-preview skip-tests=true |
Deploying Your Preview:https://github.com/appsmithorg/appsmith/actions/runs/19723414681. |
Deploy-Preview-URL:https://ce-41421.dp.appsmith.com |
…d that only integers are allowed.
…e widget for users to quickly go to a later page. Also ensuring that whenever page changes for server side enabled page progrmatically, the onPageChange event gets triggered.
tomjose92 commentedNov 27, 2025
/build-deploy-preview skip-tests=true |
Deploying Your Preview:https://github.com/appsmithorg/appsmith/actions/runs/19724978804. |
Deploy-Preview-URL:https://ce-41421.dp.appsmith.com |
rahulbarwal commentedNov 27, 2025
Screen.Recording.2025-11-27.at.11.08.12.AM.movThis is not production-ready; I see multiple bugs.
|
tomjose92 commentedNov 27, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@rahulbarwal , regarding points 2 and 3, could you check if this happens with a newly created Table widget set up with server side pagination. |
Uh oh!
There was an error while loading.Please reload this page.
Description
Added a setPageNumber function for Table widget to programatically change pages on the table.
This change allows the user to set the pageNo to any number value. What this means is that
The setPageNumber function will throw error if any value that does not evaluate to a postive integer greater than 0 is passed.
Fixes24973
Fixes8440
Automation
/ok-to-test tags="@tag.Table"
🔍 Cypress test results
Warning
Tests have not run on the HEADd52ab88 yet
Thu, 27 Nov 2025 03:59:59 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Improvements
Tests
✏️ Tip: You can customize this high-level summary in your review settings.