-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
[wip] web/timeline: use tanstack virtual to virtualise timeline #581
base: main
Are you sure you want to change the base?
Conversation
web/src/ui/timeline/TimelineView.tsx
Outdated
} | ||
}, [ | ||
room.hasMoreHistory, loadHistory, | ||
virtualizer.getVirtualItems(), |
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 effect is now ran on every render because loadHistory
changes every time (useCallback
s are not there just for fun). Eslint is also complaining about missing dependencies
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 seems to be run on every render anyway due to virtualizer.getVirtualItems()
. Not sure what to do about this, as it's the suggested way to achieve this effect in https://tanstack.com/virtual/latest/docs/framework/react/examples/infinite-scroll, and from what I can see, the actual result of firstItem
doesn't change.
5decae0
to
7616a55
Compare
7616a55
to
1e339d1
Compare
Seems to work pretty well so far
todo:
shouldAdjustScrollPositionOnItemSizeChange
to fix some scroll jumpslower priority:
timeline
(shifting indexes / pretending to array)