google / neuroglancer

WebGL-based viewer for volumetric data
Apache License 2.0
1.02k stars 283 forks source link

Changing layer type is easily destructive #570

Open ceesem opened 3 months ago

ceesem commented 3 months ago

It is possible to change a layer type in the UI after it is already defined and in use. Since the layer type is immediately next to the various tool tabs, it is particularly easy to hit in tools like a graphene segmentation layer, where one often needs to move between different tabs to do work. If you accidentally change the layer type on such a misclick, all of the current settings are reset, which can destroy work. For example, accidentally changing the layer type of a segmentation layer removes all selected IDs and resets the various render settings like opacity.

In general, operation that destroy user work should probably be clearly deliberate and hard to trigger accidentally. I can imagine two solutions for this case, which are non-exclusive: 1) Have a confirmation dialogue for rare-but-destructive changes like changing the type for a non-fresh layer. 2) Implement a state-level "Undo," as was done in the older Seung-lab neuroglancer branch.

jbms commented 3 months ago

I think state-level undo is the best solution.