Skip to content

fix: improve infinite scroll reset logic in TableWidgetV2#40609

Merged
rahulbarwal merged 1 commit intoreleasefrom
rahulbarwal/issue40411/Bug-Infinite-scroll-When-we-resize-the-table-or-when-we-toggle-the-infinite-scroll-the-data-inside-the-table-goes-missing-for-few-seconds
May 8, 2025
Merged

fix: improve infinite scroll reset logic in TableWidgetV2#40609
rahulbarwal merged 1 commit intoreleasefrom
rahulbarwal/issue40411/Bug-Infinite-scroll-When-we-resize-the-table-or-when-we-toggle-the-infinite-scroll-the-data-inside-the-table-goes-missing-for-few-seconds

Conversation

@rahulbarwal
Copy link
Contributor

@rahulbarwal rahulbarwal commented May 8, 2025

Description

Problem
Table would show inconsistent views or appear empty when infinite scroll setting changed or component height was modified.

Root cause
Page number was not reset properly during changes to infinite scroll or component height, causing the table to render an incorrect or empty state.

Solution
This PR handles improving the reset logic for the table when infinite scroll is enabled or component height changes. It refactors the reset conditions, introduces variables to track relevant state changes, and ensures the table resets correctly to maintain consistent behavior.

Fixes #40411
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/14903775919
Commit: efe1c54
Cypress dashboard.
Tags: @tag.Table
Spec:


Thu, 08 May 2025 10:36:21 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • Refactor
    • Improved the logic for resetting the table when infinite scroll is enabled or when the component height changes, resulting in clearer and more consistent behavior. No visible changes to features or exported entities.

- Refactored the logic for resetting the table state when infinite scroll is enabled or when the component height changes.
- Introduced variables to track changes in infinite scroll and component height for clearer condition checks.
- Ensured that the table resets correctly under the new conditions to maintain consistent user experience.
@rahulbarwal rahulbarwal requested a review from a team as a code owner May 8, 2025 09:27
@rahulbarwal rahulbarwal requested review from jacquesikot and removed request for a team May 8, 2025 09:27
@rahulbarwal rahulbarwal self-assigned this May 8, 2025
@rahulbarwal rahulbarwal requested review from AmanAgarwal041 and removed request for jacquesikot May 8, 2025 09:27
@rahulbarwal rahulbarwal enabled auto-merge (squash) May 8, 2025 09:27
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 8, 2025

Walkthrough

The update refactors the logic in the TableWidgetV2 component's componentDidUpdate method to clarify and consolidate the conditions under which the table state is reset. It introduces boolean flags to make the reset logic more explicit when infinite scroll is enabled or the component height changes.

Changes

File(s) Change Summary
app/client/src/widgets/TableWidgetV2/widget/index.tsx Refactored componentDidUpdate to use boolean flags for infinite scroll and height change; consolidated reset logic.

Sequence Diagram(s)

sequenceDiagram
    participant TableWidgetV2
    participant TableState

    TableWidgetV2->>TableWidgetV2: componentDidUpdate(prevProps)
    alt Infinite scroll enabled state changed OR (Infinite scroll enabled AND height changed)
        TableWidgetV2->>TableState: resetTableForInfiniteScroll()
    end
Loading

Possibly related PRs

Suggested labels

Bug, Widgets Product, Table Widget V2, ok-to-test, Query Widgets & IDE Pod

Suggested reviewers

  • jacquesikot
  • AmanAgarwal041

Poem

When tables scroll and heights ascend,
Logic’s refactored, clear to the end.
With booleans bright and resets in sight,
Infinite scroll now works just right.
Code flows smooth, with bugs out of view—
TableWidgetV2, we’re proud of you!
🧑‍💻✨

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0e5252c and efe1c54.

📒 Files selected for processing (1)
  • app/client/src/widgets/TableWidgetV2/widget/index.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: checkTestLabel
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-build / client-build
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-prettier / prettier-check
🔇 Additional comments (1)
app/client/src/widgets/TableWidgetV2/widget/index.tsx (1)

1048-1056: Improved code readability with clear variable names

The refactoring introduces well-named boolean flags to clarify when the table should reset, making the logic more maintainable. This directly fixes the issue where tables displayed inconsistently when infinite scroll settings changed or component height was modified.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 docstrings to generate docstrings for this 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.

@github-actions github-actions bot added the Bug Something isn't working label May 8, 2025
@rahulbarwal rahulbarwal added ok-to-test Required label for CI and removed Bug Something isn't working labels May 8, 2025
@github-actions github-actions bot added the Bug Something isn't working label May 8, 2025
@rahulbarwal
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@rahulbarwal rahulbarwal added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 8, 2025
@github-actions
Copy link

github-actions bot commented May 8, 2025

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

@github-actions github-actions bot added High This issue blocks a user from building or impacts a lot of users Low An issue that is neither critical nor breaks a user flow Needs Triaging Needs attention from maintainers to triage 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 May 8, 2025
@github-actions
Copy link

github-actions bot commented May 8, 2025

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

@rahulbarwal rahulbarwal added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 8, 2025
@rahulbarwal rahulbarwal merged commit 1c53166 into release May 8, 2025
87 of 92 checks passed
@rahulbarwal rahulbarwal deleted the rahulbarwal/issue40411/Bug-Infinite-scroll-When-we-resize-the-table-or-when-we-toggle-the-infinite-scroll-the-data-inside-the-table-goes-missing-for-few-seconds branch May 8, 2025 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working High This issue blocks a user from building or impacts a lot of users Low An issue that is neither critical nor breaks a user flow Needs Triaging Needs attention from maintainers to triage ok-to-test Required label for CI 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-When we resize the table or when we toggle the infinite scroll the data inside the table goes missing for few seconds

2 participants