-
Notifications
You must be signed in to change notification settings - Fork 73
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 infinite scroll in dashboard #501
Conversation
Welcome to connect! Make sure to:
deployed preview: https://501.connect-d5y.pages.dev |
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 work!
- The
routes_segments
endpoint accepts alimit
parameter. Something like this should work: setstart
to the end of loaded routes,end
tostart + 5 years
, andlimit
to 10. - I think we want to get rid of the time filter on top, and make specifying the time range a more niche thing (small button next to "take snapshot?"). It's very rare that you'll want to specify a range.
- Got a video of this?
thanks for the review, will update per comment. I've attached a short video in description, what information do you need more? I'll make a new one |
I'm not sure if that would work. route_segments doesn't have this I see listRoutes has it but it doesn't return what i need |
I replaced the time select dropdown with a button you suggested: 2024-06-07_23-21-27.mp4 |
Ah that's incomplete. I was looking at the backend server code. If you add |
The api module is a npm package. We would need to update it first though |
I've updated the implementation for infinite scrolling, it would use 2024-06-08_18-38-38.mp4I only use The manual time select still works 2024-06-08_18-39-37.mp4 |
I think 5 is a good increment. As a side effect, this should be a nice speedup for users who drive a lot! Deployed preview doesn't work, but it still looks a bit buggy in your video. Let me know when it's ready for a proper review. |
I think it's good to review, preview is good to test 2024-06-08_20-47-25.mp4 |
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.
mind taking another look? |
I fixed another bug related to time select component but I'm having a hard time to reproduce the bug in your screenshot. I tested the latest preview with different browsers too: chrome 2024-06-09_22-25-10.mp4safari 2024-06-09_22-27-12.mp4All look good, both for just scrolling and using time select. Could it be a blip on your machine? Are you able to consistently reproduce the bug, and if so, could you give more details about your machine and browser? |
I would add a little more padding on the bottom of "There are no more routes found in selected time range." |
@adeebshihadeh sorry for the ping, what's the next step here? |
Not sure if you fixed it, but I couldn't repro the bug when I went to screen record it. Can you rebase on the latest master? |
Instantly hit it again on Chrome on my Ubuntu machine. Here's a screen recording: infinite_scroll_bug.mp4 |
Finally figured out the issue: there is a race condition that the next page fetch would void the previous fetching in flight, like events and locations. I changed the code that we store any fetched event/location, and update state would always try to update all these stored event/location. Could you give it another try? |
Fix #493
2024-06-07_12-39-09.mp4
The console shows we keep fetching data until found; and it will fetch new data when user scrolls to the bottom.
There are some question remainng to be answered: