-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fix: Retain Current Page in UUID Table During Lazy Loading #142
Conversation
The loggings are an artifact from a different branch, not sure why it stayed; can remove if needed. |
80d3e3f
to
dc80bc1
Compare
Removed unnecessary logging |
@JGreenlee Please Review |
page_current=0, # page number that user is on | ||
page_current=page_current, # set to current page |
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.
Note to self: this is basically the fix. Instead of this always being 0, we keep track of page_current
and pass it in here
dcc.Tabs( | ||
id="tabs-datatable", | ||
value='tab-uuids-datatable', | ||
children=[ | ||
dcc.Tab(label='UUIDs', value='tab-uuids-datatable'), | ||
dcc.Tab(label='Trips', value='tab-trips-datatable'), | ||
dcc.Tab(label='Demographics', value='tab-demographics-datatable'), | ||
dcc.Tab(label='Trajectories', value='tab-trajectories-datatable'), | ||
] | ||
), |
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.
formatting-only change, but acceptable
def render_content( | ||
tab, store_uuids, store_excluded_uuids, store_trips, store_demographics, store_trajectories, | ||
start_date, end_date, timezone, n_intervals, key_list, current_page, | ||
loaded_uuids_store, all_data_loaded | ||
): |
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.
I see; current_page
added here so it can be used below
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.
Looks like a fairly straightforward fix, along with some other logging and comment cleanups
Co-authored-by: Jack Greenlee <[email protected]>
Co-authored-by: Jack Greenlee <[email protected]>
Co-authored-by: Jack Greenlee <[email protected]>
html.Div(id='tabs-content'), | ||
dcc.Store(id='selected-tab', data='tab-uuids-datatable'), # Store to hold selected tab | ||
dcc.Interval(id='interval-load-more', interval=20000, n_intervals=0), # default loading at 10s, can be lowered or hightened based on perf (usual process local is 3s) | ||
dcc.Interval(id='interval-load-more', interval=24000, n_intervals=0), # Interval for loading more data |
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.
Interval increased; ok for now until we implement a better solution that is not as fragile and does not depend on an arbitrary "magic number"
This pull request fixes issue #129, where the UUID table did not retain the user's current page during lazy loading updates. With this fix, the page now stays on the user's current page even as new data is loaded.
Problem
Previously, when lazy loading was in progress, navigating through the UUID table would reset the user back to the first page upon each data update. This disrupted the user experience, especially when trying to review data in real-time before the entire dataset was loaded.
Solution
Impact
Testing
8mb.video-VqM-0kSE84XU.mp4
Closes: Fixes #129