-
Notifications
You must be signed in to change notification settings - Fork 12
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
Improved pagination design in file browser #1311
Conversation
This seems to be a good staging dandiset to try this out on https://deploy-preview-1311--gui-staging-dandiarchive-org.netlify.app/dandiset/201029/draft/files?location= |
it would be nice to know how many pages there are. |
@mvandenburgh, is it known on each render how many total files/pages there are? If yes, it should be straightforward to add an |
Yes, I can add that. Sorry, I thought I replied to @satra's comment but I guess I didn't submit it. |
4085bc1
to
ea0a41a
Compare
Maybe when the user inputs an invalid page, it could error but without making the failing call to the API (so just staying on the last valid page)? Currently, if they input something invalid, the page immediately shrinks, and it's more awkward to use. |
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.
Changes look good. I think there's a very subtle issue with saying "no items found at the specified path" for a non-existent folder (it should be a "harsher" error message to distinguish between a folder with no items and a folder that doesn't exist--even though the latter doesn't actually happen in DANDI) but for now I think this is fine.
I forgot to mention: I think Jake's comment is a good idea; you could implement that now or defer to later--I'll leave that between you and Jake. |
@AlmightyYakob Implemented this |
|
7626033
to
8f3e75c
Compare
🚀 PR was released in |
Fixes #725.
I implemented Jared's design from #725, and also added an error message when an invalid path is entered by the user.
Previously, a user would only run into this error if they manually edited the query params in the browser URL bar, so our very basic solution was to just kick the user back to the root directory of the dandiset if that happened. But now that there's an input to specify the page number, it's much easier for a user to enter something invalid. So, I've changed this behavior to display an error message instead of kicking them back to the root.
I still think the UX here could use some significant improvement, but for the purposes of this PR I think it's sufficient.