Skip to content
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

Implement table record virtualizer back #2839

Merged
merged 2 commits into from
Dec 6, 2023
Merged

Implement table record virtualizer back #2839

merged 2 commits into from
Dec 6, 2023

Conversation

gitstart-twenty
Copy link
Contributor

Fixes #2728

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Thiago Nascimbeni <tnascimbeni@gmail.com>
@@ -114,6 +116,7 @@ export const TableCellContainer = ({
<StyledCellBaseContainer
onMouseEnter={handleContainerMouseEnter}
onMouseLeave={handleContainerMouseLeave}
style={{ width }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @charlesBochet,

The virtualizer's requirement for absolute positioning is affecting the table body layout. As a result, the natural dimensions are compromised, and this impacts the cell widths. To address this, I've manually adjusted the widths to match those of the table header cells.

@gitstart-twenty gitstart-twenty marked this pull request as draft December 4, 2023 17:58
Copy link
Member

@charlesBochet charlesBochet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gitstart-twenty I've left comment and proposed another strategy

@@ -16,6 +16,7 @@
"@hookform/resolvers": "^3.1.1",
"@sniptt/guards": "^0.2.0",
"@tabler/icons-react": "^2.30.0",
"@tanstack/react-virtual": "^3.0.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gitstart-twenty let's not re-add tanstack, I don't think it's useful actually, it's overkill and the API of this library is not great.

I think we need something simpler.
Could you create a component Virtualizer in ui/utilities/virtualizer taking the following code: https://github.com/NightCafeStudio/react-render-if-visible/blob/main/src/render-if-visible.tsx (it seems to be what we need but not maintained anymore)

Then use it in RecordTableBody to wrap a row. Should be simpler and achieving the same result.
I don't think we need to virtualize commands for now btw :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, on this

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Thiago Nascimbeni <tnascimbeni@gmail.com>
Copy link
Member

@charlesBochet charlesBochet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Let's merge it and iterate from there :)

@charlesBochet charlesBochet merged commit b09100e into main Dec 6, 2023
10 of 14 checks passed
@charlesBochet charlesBochet deleted the TWNTY-2728 branch December 6, 2023 13:20
@charlesBochet charlesBochet mentioned this pull request Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement table record virtualizer back
2 participants