Large File Scrolling Design #95
scholarsmate
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Overall Design
To handle large files, perhaps we have viewports capacity at say 1MB (this should be a tunable variable) and when the user scrolls to the bottom of the viewport and there are bytes remaining in the file, then we shift the viewport so that it starts at say it's current start offset, plus 512K (half of the viewport capacity), so it drops 512K from the start and adds another 512K and can read up to that amount. Conversely, if the user scrolls to the top of the viewport and there is data before it, then we set the start offset to
MAX(0, current_start_offset - 512K)
. There will be some math involved to scroll the viewport to the expected position and the scroll bars will behave strangely when this happens (typically they will bounce to the middle), but I think it will be acceptable.The illustration above shows the viewport behavior over time as the user scrolls down to the bottom of the file, then scrolls back up to the top.
Edge Cases
Beta Was this translation helpful? Give feedback.
All reactions