Skip to content

Conversation

@fcollman
Copy link
Contributor

@fcollman fcollman commented Sep 1, 2025

image There were some options for layer panels that were not part of the state, and no way for UI users to set those options. I have added a showLayerPanel visibility toggle to the layer list side panel, so that people can turn off the visibility of the layer list.

This is particularly useful for those people who are trying to make simplified neuroglancer visualizations, and/or users who are working with large numbers of layers.

@jbms
Copy link
Collaborator

jbms commented Sep 4, 2025

I left these settings out of the viewer state, and only allowed them to be configured from Python or via JavaScript directly, because I thought it may be confusing for users to end up in a viewer state without the expected Neuroglancer UI.

However, it may be reasonable to expose these as part of the Neuroglancer state.

There is the issue, though, of making these interoperate correctly with the existing Python or JavaScript configuration options. Just adding these directly to the viewer state means that resetting the viewer state will also reset these UI configuration options, which previously was not the case.

Instead I think we want the effective option to be "enabled in UI configuration state AND enabled in viewer state" --- meaning that if a particular UI control is disabled from the existing ViewerConfigState in Python, then it cannot be enabled from the viewer state.

@jbms
Copy link
Collaborator

jbms commented Sep 4, 2025

Separately there is the question of which options to expose in the UI, as you have done here with the showLayerPanel option, and which to just expose in the JSON state.

@fcollman
Copy link
Contributor Author

fcollman commented Sep 4, 2025

makes sense. I think having the layer side panel makes it possible to get to the layer controls, I did consider putting some kind of eyeball button next to all the layers to just hide all the elements of the list, but since there was already this mechanism I thought this would be a better direction.

I will try to make the layerPanel visible option a seperate option that is tracked in the state.. and if the existing UI configuration option is disabled I'll also turn this option off (so that the user cannot make the layerPanel visible).

I do think that having it available in the UI is useful, particularly given that you have the layerPanel side panel now which can modally accessed and hidden.

@fcollman
Copy link
Contributor Author

fcollman commented Sep 4, 2025

but to be clear, i really only expect a small subset of people to use this option when they are using a generic deployment to do a task that has a lot of layers, or layers whose name bars get very long because they have segment properties with long strings.

@fcollman
Copy link
Contributor Author

fcollman commented Sep 9, 2025

I'm confused as to why the screenshot tests failed, when all i did was add a button to the LayerPanelList and I don't think that's visible in any of these tests.

@seankmartin
Copy link
Contributor

thanks @fcollman and @jbms! I had thought about this before but wasn't sure how best to combine the JSON state and the viewer config, I think this is a very nice merge of the two. Not sure why the tests are failing, I merged master and tried locally and they were fine. Maybe worth trying a merge of master into this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants