-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
virtualized list with react window & throttled the request to prevent 429 errors // add list counts to list view #255
virtualized list with react window & throttled the request to prevent 429 errors // add list counts to list view #255
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
I will look into why the results have changed. |
This is fixed now @tb38r |
@tb38r We need to find a consistent spot for the list count number. Also, there is a view within the view. |
count now returns 150 on my end but your screenshots are closer to what's expected so I'll continue on the assumption that it might be a local issue. will work on fixing the view within a view issue as well as applying some consistency amongst different the screen sizes. |
Once we get the visuals sorted out we can verify the count logic. Staging is significantly behind prod so if you're comparing counts from in the bsky app, they will definitely be off. I'm a little concerned about how many even numbered list counts there are (100, 50, 150, etc.) but I think people are also using tools to create lists so that kind of makes sense. |
Off to a good start, but there's a few issues to fix. One is the double nested scroll areas which you're already aware of. Another is the fact that this has removed the behavior of loading additional pages of data once you scroll near to the bottom of the existing data. |
Build failed
|
Hey @thieflord06, apologies for going ghost, been tied up with various things as well as getting this issue done. In trying to implement the windowing feature, the initial attempt via react-window added an additional scrollbar as previously highlighted where it'd be preferred to manage the browsing behaviour directly via the window. After a bit of research, found a comment from the package's creator noting it wouldn't be possible to do so with that specific package, was working perfectly otherwise - with the loading additional pages behaviour as well. Found this --> https://tanstack.com/virtual/latest/docs/framework/react/examples/window which seemed perfect for the job. Spent some time trying to implement it but I'm possibly missing something minor to get it working perfectly note the whitespace below, where the new data should be on scroll const rowVirtualizer = useWindowVirtualizer({ The result of --> rowVirtualizer.getVirtualItems().length represents the number of the items being rendered initially, working on figuring out why the rest of the data isn't showing, as I say, hoping finding solution involves a minor oversight on my end. |
branched off from list-counts, pushed updated work for review (branch 'window-throttling') |
Your build issues are probably being caused by some strange changes I'm seeing in the |
noted! |
Withheld working on the virtualisation element to get a viable working product out. Throttled getListSize to prevent server overload. Updated with css changes from #264. List count appears to the right of of the list name. resolves #255. 
@tb38r You'll have to make a new PR for this if you want to keep working on it. |
@noahm , addressed the virtualisation suggestion by implementing React Windows, only a subset of the lists are rendered at a time now. Additionally, used lodash's throttling functionality to minimise the frequency of the requests as it'd overload the servers.
Both appear fine, however, an issue remains in that the value returned useListSize is always '1'. That wasn't always the case as I'd initially tested the endpoint provided by @thieflord06 on Postman and would get varied results depending on the url provided however whether via Postman, or the app itself, it now always returns 1. Unsure why that may be, any suggestions?