Skip to content

fix: update visibility condition for infinite scroll in TableWidgetV2#40474

Merged
rahulbarwal merged 2 commits intoreleasefrom
rahulbarwal/infinite-toggle-to-be-disabled-when-server-side-pagination-is-disabled
Apr 30, 2025
Merged

fix: update visibility condition for infinite scroll in TableWidgetV2#40474
rahulbarwal merged 2 commits intoreleasefrom
rahulbarwal/infinite-toggle-to-be-disabled-when-server-side-pagination-is-disabled

Conversation

@rahulbarwal
Copy link
Contributor

@rahulbarwal rahulbarwal commented Apr 29, 2025

Description

Updated the 'hidden' property in the TableWidgetV2 configuration to account for both the INFINITE_SCROLL_ENABLED feature flag and the serverSidePaginationEnabled prop, ensuring proper visibility control based on these conditions.

Fixes #40409
or
Fixes Issue URL

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

Automation

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

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/14733305658
Commit: cba8275
Cypress dashboard.
Tags: @tag.Table
Spec:


Tue, 29 Apr 2025 16:01:26 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • Refactor
    • Updated the visibility logic for the infinite scroll option in table pagination settings to better reflect feature availability and widget configuration.
  • Tests
    • Enhanced test coverage by enabling server-side pagination alongside infinite scroll in table widget scenarios.

Updated the 'hidden' property in the TableWidgetV2 configuration to account for both the INFINITE_SCROLL_ENABLED feature flag and the serverSidePaginationEnabled prop, ensuring proper visibility control based on these conditions.
@rahulbarwal rahulbarwal requested review from vivek-appsmith and removed request for a team April 29, 2025 12:17
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 29, 2025

Walkthrough

The change updates the visibility logic for the "infiniteScrollEnabled" property in the TableWidgetV2's property configuration. Now, the toggle for infinite scroll is hidden if either the corresponding feature flag is disabled or if server-side pagination is not enabled in the widget's properties. This introduces an additional dependency on the server-side pagination setting for displaying the infinite scroll option. Corresponding Cypress tests were updated to enable server-side pagination alongside infinite scroll to align with the new visibility logic.

Changes

File(s) Change Summary
app/client/src/widgets/TableWidgetV2/widget/propertyConfig/contentConfig.ts Updated the visibility condition for the "infiniteScrollEnabled" property to also depend on server-side pagination being enabled. Added "serverSidePaginationEnabled" to dependencies.
app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/InfiniteScrollVariableHeightRows_spec.ts,
app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Table_InfiniteScroll_spec.ts
Modified tests to enable "Server side pagination" property before enabling infinite scroll in the Table widget test setups. No other test logic changes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant TableWidgetV2 Property Config
    participant FeatureFlag
    participant WidgetProps

    User->>TableWidgetV2 Property Config: Opens property pane
    TableWidgetV2 Property Config->>FeatureFlag: Check INFINITE_SCROLL_ENABLED
    TableWidgetV2 Property Config->>WidgetProps: Check serverSidePaginationEnabled
    alt Feature flag disabled or server-side pagination disabled
        TableWidgetV2 Property Config-->>User: Hide infiniteScrollEnabled toggle
    else
        TableWidgetV2 Property Config-->>User: Show infiniteScrollEnabled toggle
    end
Loading

Assessment against linked issues

Objective Addressed Explanation
Show valid properties (e.g., Total records, onPageChange, onPageSizeChange) when Infinite Scroll is true (#40409)

Poem

When toggles hide and toggles show,
Pagination’s secrets now we know!
Infinite scroll waits for its friend,
Server-side paging to ascend.
With logic clear and bugs now gone,
The Table marches bravely on!
📜✨


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between d68a8f8 and cba8275.

📒 Files selected for processing (3)
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/InfiniteScrollVariableHeightRows_spec.ts (1 hunks)
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Table_InfiniteScroll_spec.ts (1 hunks)
  • app/client/src/widgets/TableWidgetV2/widget/propertyConfig/contentConfig.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/client/src/widgets/TableWidgetV2/widget/propertyConfig/contentConfig.ts
🧰 Additional context used
📓 Path-based instructions (1)
`app/client/cypress/**/**.*`: Review the following e2e test code written using the Cypress test library. Ensure that: - Follow best practices for Cypress code and e2e automation. ...

app/client/cypress/**/**.*: Review the following e2e test code written using the Cypress test library. Ensure that:

  • Follow best practices for Cypress code and e2e automation.
  • Avoid using cy.wait in code.
  • Avoid using cy.pause in code.
  • Avoid using agHelper.sleep().
  • Use locator variables for locators and do not use plain strings.
  • Use data-* attributes for selectors.
  • Avoid Xpaths, Attributes and CSS path.
  • Avoid selectors like .btn.submit or button[type=submit].
  • Perform logins via API with LoginFromAPI.
  • Perform logout via API with LogOutviaAPI.
  • Perform signup via API with SignupFromAPI.
  • Avoid using it.only.
  • Avoid using after and aftereach in test cases.
  • Use multiple assertions for expect statements.
  • Avoid using strings for assertions.
  • Do not use duplicate filenames even with different paths.
  • Avoid using agHelper.Sleep, this.Sleep in any file in code.
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Table_InfiniteScroll_spec.ts
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/InfiniteScrollVariableHeightRows_spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-prettier / prettier-check
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-build / client-build
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
🔇 Additional comments (2)
app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/InfiniteScrollVariableHeightRows_spec.ts (1)

46-46: LGTM: Added server-side pagination toggle before infinite scroll

This change aligns with the updated widget behavior where infinite scroll visibility now depends on server-side pagination being enabled.

app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Table_InfiniteScroll_spec.ts (1)

51-51: LGTM: Added server-side pagination toggle before infinite scroll

This change properly updates the test to match the new widget behavior where infinite scroll visibility depends on server-side pagination being enabled.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@rahulbarwal rahulbarwal changed the base branch from rahulbarwal/issue40409/Bug-Infinite-scroll---Valid-properties-are-not-seen-on-setting-infinite-scroll to release April 29, 2025 12:17
@rahulbarwal rahulbarwal requested a review from jacquesikot April 29, 2025 12:18
@rahulbarwal rahulbarwal added the ok-to-test Required label for CI label Apr 29, 2025
@github-actions github-actions bot added Bug Something isn't working Needs Triaging Needs attention from maintainers to triage PR blocker Critical issues raised during feature testing & need to be fixed before PR is pushed to master Query Widgets & IDE Pod All issues related to Query, JS, Eval, Widgets & IDE Release Table Widget V2 Issues related to Table Widget V2 Widgets Product This label groups issues related to widgets labels Apr 29, 2025
@rahulbarwal
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@github-actions
Copy link

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

jacquesikot
jacquesikot previously approved these changes Apr 29, 2025
@github-actions
Copy link

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

Added the toggle for "Server side pagination" in the Cypress tests for both InfiniteScrollVariableHeightRows_spec and Table_InfiniteScroll_spec to ensure proper testing of the feature alongside infinite scrolling functionality.
@rahulbarwal
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@github-actions
Copy link

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

@github-actions
Copy link

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

@rahulbarwal rahulbarwal merged commit 557ee05 into release Apr 30, 2025
45 checks passed
@rahulbarwal rahulbarwal deleted the rahulbarwal/infinite-toggle-to-be-disabled-when-server-side-pagination-is-disabled branch April 30, 2025 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Needs Triaging Needs attention from maintainers to triage ok-to-test Required label for CI PR blocker Critical issues raised during feature testing & need to be fixed before PR is pushed to master Query Widgets & IDE Pod All issues related to Query, JS, Eval, Widgets & IDE Release Table Widget V2 Issues related to Table Widget V2 Widgets Product This label groups issues related to widgets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Infinite scroll - Valid properties are not seen on setting Infinite scroll to true

2 participants