-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Introduce infinite scroll feature behind feature flag. #39207
Changes from 4 commits
4b8cfce
6a15d81
982dfce
037e613
182c03d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,6 +79,7 @@ interface BodyPropsType { | |
width?: number; | ||
tableSizes: TableSizes; | ||
innerElementType?: ReactElementType; | ||
isInfiniteScrollEnabled: boolean; | ||
} | ||
|
||
const TableVirtualBodyComponent = React.forwardRef( | ||
|
@@ -137,6 +138,7 @@ export const TableBody = React.forwardRef( | |
handleReorderColumn, | ||
headerGroups, | ||
isAddRowInProgress, | ||
isInfiniteScrollEnabled, | ||
isResizingColumn, | ||
isSortable, | ||
multiRowSelection, | ||
|
@@ -188,15 +190,22 @@ export const TableBody = React.forwardRef( | |
totalColumnsWidth: props.totalColumnsWidth, | ||
}} | ||
> | ||
{useVirtual ? ( | ||
{isInfiniteScrollEnabled ? ( | ||
<div>Infinite Scroll</div> | ||
) : useVirtual ? ( | ||
Comment on lines
+193
to
+195
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Placeholder needs implementation. The current implementation only shows a placeholder div. This needs to be replaced with actual infinite scroll functionality. Would you like me to help create a proper infinite scroll implementation using react-window's FixedSizeList with onScroll handling? |
||
<TableVirtualBodyComponent | ||
isInfiniteScrollEnabled={false} | ||
ref={ref} | ||
rows={rows} | ||
width={width} | ||
{...restOfProps} | ||
/> | ||
) : ( | ||
<TableBodyComponent rows={rows} {...restOfProps} /> | ||
<TableBodyComponent | ||
isInfiniteScrollEnabled={false} | ||
rows={rows} | ||
{...restOfProps} | ||
/> | ||
)} | ||
</BodyContext.Provider> | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1271,6 +1271,7 @@ class TableWidgetV2 extends BaseWidget<TableWidgetProps, WidgetState> { | |
height={componentHeight} | ||
isAddRowInProgress={this.props.isAddRowInProgress} | ||
isEditableCellsValid={this.props.isEditableCellsValid} | ||
isInfiniteScrollEnabled={this.props.infiniteScrollEnabled} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainVerify interaction with pagination controls. The infinite scroll feature might affect the visibility and behavior of pagination controls. Ensure that pagination controls are hidden when infinite scroll is enabled. 🏁 Script executed: #!/bin/bash
# Description: Check if pagination controls are properly handled with infinite scroll.
# Search for pagination visibility logic
rg -A 5 "isVisiblePagination" Length of output: 105089 Action Required: Hide Pagination Controls When Infinite Scroll Is Enabled The DSL fixtures show that the pagination flag ("isVisiblePagination") is always set to true. There is no apparent logic in the widget that conditionally hides pagination when the infinite scroll feature (mapped via the prop "infiniteScrollEnabled") is enabled. You should ensure that the widget's runtime behavior overrides the DSL setting (or updates it accordingly) so that pagination controls are hidden when infinite scroll is active.
|
||
isLoading={ | ||
customIsLoading | ||
? customIsLoadingValue || this.props.isLoading | ||
|
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.
As we have added the feature flag, shouldn't we make use of that here instead of making it
false
always ?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.
Static table is never going to use infinite scroll. So basically the idea behind infinite scroll is that it will always use virtual table.
Why do we have to pass this when static table is not using this variable? So this is just baggage that we have from earlier structuring of code. I am planning to handle this in my next PR where I will try to do a refactor if possible.
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.
If this prop is a new prop then we can mark this as the optional prop which would be undefined by default which will solve the purpose instead of passing false to this prop explicitly.
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.
This is what I am forced to do right now but I don't like it to be honest. Ideally I should not have to write any piece of code that I don't need.
If instead of hard coding it to false, if I give it a variable that means that the JS compiler has to evaluate that value before passing it down here. Which in this case might be a moot point but still in principle I should not have to write what I don't need.
What I am proposing is eliminating this unnecessary code in a refactor PR.
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.
We met over a call and agreed to make this an optional argument and deal with this whole component structure in a separate PR.