webknossos
webknossos copied to clipboard
Fix clip histogram button if ideal mag does not exist
URL of deployed dev instance (used for testing):
- https://___.webknossos.xyz
Steps to test:
- test the clip histogram button with a dataset where one layer only has mag 1 and another layer has higher mags
- zoom out very far (e.g., mag 8) and use the clip-histogram for the layer which only has mag 1
- --> a toast should explain that the action didn't succeed and to zoom in
- zoom in further (e.g., mag 4) --> the button should work (for me, it loaded 80 MB of data which is quite a lot but alright for this edge case in my opinion)
Issues:
- fixes #6432
(Please delete unneeded items, merge only when none are left open)
- [x] Updated (unreleased) changelog
- [ ] Updated (unreleased) migration guide if applicable
- [ ] Updated documentation if applicable
- [ ] Adapted wk-connect if datastore API changes
- [ ] Adapted wk-libs python client if relevant API parts change
- [ ] Needs datastore update after deployment
- [X] Ready for review
@fm3 I couldn't really reproduce the exact error scenario you experienced in your issue (do you happen to have an error message?). Initially, I thought that a non existent mag was used, but the code did actually deal with that correctly. However, I noticed that there was no guard against loading very large volumes of data (e.g., only mag 1 exists, but you click on the layer in mag 32). Therefore, I adapted the code to gracefully handle this situation. I hope this helps!
I couldn't really reproduce the exact error scenario you experienced
For the record, as discussed in slack, my issue was not tested on the latest master and would with the newer code have instead triggered exactly what this issue solves 👍
@fm3 maybe you can have a look at the diff :)