-
Notifications
You must be signed in to change notification settings - Fork 5
Implement virtual scroll for large dataframes #369
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
Conversation
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.
Pull request overview
This WIP pull request implements virtual scrolling for the HighTable component to handle large datasets efficiently. The implementation introduces coordinate transformation between physical canvas height and virtual canvas height, along with custom scroll handling logic. The PR is currently broken due to an update loop issue as noted in the title.
Key changes:
- Implements virtual scroll provider with coordinate transformation between canvas and virtual canvas spaces
- Adds IntersectionObserver-based focus management for cells in virtual scroll mode
- Updates scroll behavior to support options parameter for smooth/instant scrolling
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| src/providers/ScrollModeVirtualProvider.tsx | Main implementation of virtual scrolling logic with state management, coordinate transformations, and scroll-to-row functionality |
| src/providers/ScrollModeProvider.tsx | Passes required props (numRows, headerHeight) to ScrollModeVirtualProvider |
| src/hooks/useCellFocus.ts | Adds IntersectionObserver-based focus logic for virtual scroll mode with horizontal scroll handling |
| src/contexts/ScrollModeContext.ts | Extends context interface with shouldScrollHorizontally flag and behavior options for scrollToTop |
| src/components/HighTable/Scroller.tsx | Updates scrollTo implementation to accept behavior options (instant/smooth) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 10 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Finally, I have a valid PR for virtual scrolling of huge dataframes. Would you like to have a look @platypii? |
|
The bottom border is not visible when scrolling past the end of the table (it only happens in "virtual scroll mode") Screencast.From.2026-01-07.14-44-18.mp4 |
|
Still getting weird behavior: if I scroll down even one "notch" on my scroll wheel, I jump to row 4000+. Worse: when I try to scroll back up, there's no way to get back to row 1 simplescreenrecorder-2026-01-07_12.06.49.mp4 |
|
Hmmm, I don't know how to change this while letting the browser natively handle the scroll. The current logic is:
I understand the UX is maybe not what we expected, but I don't think we would be able to do more with the current concepts/logic. Alternatives:
For 3., an option might be to use the scrollbar for local scrolling, eg from row 0 to row 8.000.000, then:
|
f7e95fe to
f3baeb6
Compare
aad7611 to
bce4625
Compare
e067934 to
8abfa1c
Compare
bba7f2a to
9dded17
Compare
platypii
left a comment
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.
NICE!! This is feeling much better! 👏
I noticed one weird behavior: if you scroll all the way to the bottom of the "Large Data" storybook you get "stuck" and need to scroll up a bunch to make it "unstick" from the bottom.
|
Indeed, I'll fix it tomorrow, and add some tests (I isolated most of the code that contains logic to independent functions) |
hmmm, finally, I cannot reproduce. Can you share more details, or a video? I tried on Firefox and Chrome |
It only happens on my macbook when scrolling up from the bottom. It's still happening but felt worse yesterday for some reason. I don't think its a blocker necessarily. Video (all i'm doing is scrolling up slowly): bottom.of.scroll.mov |
|
Ok thanks, I'll try to reproduce and find why it happens |
bleakley
left a comment
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.
The code looks great, and I build hyperparam with this and tried looking at some datasets with 1m rows, generating new columns, etc, and everything looks good 👍
|
OK. I'll merge, and open an issue for the scroll issue for the last rows, as I cannot reproduce. |
|
I published v0.25.3 |
|
I opened #389 for the stuck scroll |
It may not be semver, but this is such a major upgrade i would have called it 0.26.0 :-) |
|
Yes, I would have changed the second number if the first one was not zero. Until 1.0.0, I was thinking that changes that don't break anything must go to the third number. Anyway, if you prefer the second number for communication matters, I can release 0.26.0 too. |


It replaces #347 (the remaining parts). The current commit will be recreated later, but I wanted to save my work.
remaining:
Later?
Screencast.From.2026-01-03.01-35-13.mp4