Skip to content
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

Avoid sudden dataset reordering in dashboard #4640

Merged
merged 7 commits into from
Jun 8, 2020

Conversation

philippotto
Copy link
Member

@philippotto philippotto commented Jun 2, 2020

This PR fixes #4461 in a rudimentary way. I thought quite a while about this and I think this solution is fine. In the most common use case, the user will open the dashboard and it will simply work (be fast and won't show any sudden changes). If the user wants to open a new dataset (which was just added), they will likely click the "refresh" button, anyway, and then the new dataset will appear. There is the chance that a "soft reload" (instead of having the back-end rescan all directories) would also do the trick, but integrating this into the UI is likely quite confusing. I briefly thought about updating the dataset list with the updated cache content when the mouse is at a good position (e.g., when it hovers over the fresh button), but in the end this is probably too weird.

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

Steps to test:

  • it's a bit hard to test which is why I monkey-patched the getDatasets api to drop (or not drop) some elements between page refreshs
  • during that, I could verify that a change in the dataset list "arrived" on the second page refresh (since a page load will always show the cache contents which get updated when loading the dataset)

Issues:


@philippotto philippotto requested a review from daniel-wer June 2, 2020 10:07
@philippotto philippotto changed the title [WIP] Avoid sudden dataset reordering in dashboard Avoid sudden dataset reordering in dashboard Jun 2, 2020
@philippotto philippotto self-assigned this Jun 2, 2020
Copy link
Member

@daniel-wer daniel-wer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, this works well! I was able to test it fairly easily, as opening another than the first dataset moves it to the very top of the dataset list (due to the LRU sorting), which now only happens after a reload as intended. :)

I still like the possible solution from the issue

Show an explicit update indicator: We could tell the user that an async update is in progress and once it is finished, the indicator could turn into a button saying "Show 5 new datasets available". Similar to this picture: https://i.stack.imgur.com/cWkTc.png

(The image is a nice find btw, alram 😁)

So maybe we can keep a variation of this issue open as a possible future improvement :)

@philippotto
Copy link
Member Author

I still like the possible solution from the issue

Show an explicit update indicator: We could tell the user that an async update is in progress and once it is finished, the indicator could turn into a button saying "Show 5 new datasets available". Similar to this picture: https://i.stack.imgur.com/cWkTc.png

(The image is a nice find btw, alram )

So maybe we can keep a variation of this issue open as a possible future improvement :)

Yeah, I agree! The problem which I have with this, though, is that it's difficult to communicate to the user that there's still a chance to do a "hard" refresh. So, if the indicator says "Show 2 new datasets" and then these datasets don't contain the expected dataset, the user might think that there is no use in clicking "refresh datasets" (because he just got an update one second ago). Instead, they might try to debug the directory on disk or something like that.
This problem is likely solvable, but I couldn't come up with an elegant solution, yet. Maybe a "Try harder" button for finding new datasets 😆 But honestly, we probably have to make the different "refresh" strategies obvious in the UI.

I'll cross-post this in the original issue leave that open, too.

@bulldozer-boy bulldozer-boy bot merged commit 01ea8a3 into master Jun 8, 2020
@bulldozer-boy bulldozer-boy bot deleted the avoid-ds-reordering branch June 8, 2020 14:38
@fm3 fm3 mentioned this pull request Jul 12, 2020
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dataset list reorders when refresh request completes, leads to misclicks
2 participants