bonsai-rx / bonsai

The compiler, IDE, and standard library for the Bonsai visual programming language for reactive systems
https://bonsai-rx.org
MIT License
131 stars 29 forks source link

Consider setting the Show Visualizer context menu selection to None on visualizer window close #1841

Open ncguilbeault opened 3 weeks ago

ncguilbeault commented 3 weeks ago

When a user closes a visualizer window by clicking the X in the top right corner, the Show Visualizer option in the context menu doesn't change. My initial thought was that the context menu should update to Show Visualizer > None, but then I found that the visualizer settings persist because the Visible flag in the layout file gets set to false, while setting the Visualizer explicitly to None erases these settings entirely.

Related to #1823 and perhaps does not need its own issue, but at least for me I find it confusing to exit out of the visualizer window and still see that the visualizer is selected. Double clicking on the node or changing selection can make it visible again, but maybe a simple fix would just be to always set Visible -> true on selection in context menu.

glopesdev commented 3 weeks ago

@ncguilbeault The reason why we do this is so you can close a visualizer and then bring it back with the same visualizer settings. I agree it is confusing that it still shows it is selected, but this is a behavior we want to keep since otherwise you would have to change things like axis ranges, history length, etc. every time you close and reopen a visualizer.

Maybe we need an extra status indicator to show whether it is selected and visible, versus only selected, would that work?

ncguilbeault commented 3 weeks ago

@glopesdev The extra status indicator would definitely be helpful. I still think it would still be nice to have the ability to reopen the visualizer directly from the menu options even if the selection doesn't change. I tried to make a PR to fix this