feat: add tab accordions to allow grouping controls within tabs#992
Open
seankmartin wants to merge 38 commits into
Open
feat: add tab accordions to allow grouping controls within tabs#992seankmartin wants to merge 38 commits into
seankmartin wants to merge 38 commits into
Conversation
Base styling of accordions for neuroglancer
Accordion improvements
Contributor
|
I think this definitely has value, especially when creating a complex user shader with multiple ui controls. I'll ask the designers in the AIBS apps team to take a look My thoughts are: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces accordion functionality to organise UI tabs into collapsible sections. The main change is an
AccordionTabwidget that extends the baseTabclass and allows content to be grouped into expandable/collapsible sections with persistent state. The state is stored per layer, so individual layers can expand/collapse these sections independently of each other. This is currently in place for therenderingtab of images and segmentations, and the annotation tab.Example

One important factor if neuroglancer adopts this PR is what the default behaviour should be. There are two main build flags which can control the accordions, unsure what the preferred default is. Overall these are designed to allow opting in or out of using accordions, and controlling their state. These are:
NEUROGLANCER_USE_ACCORDIONS: default true. If True, visually shows accordions in the UI. Setting this to False should keep neuroglancer almost visually identically to if this PR was not in place. So essentially opting out of using accordions.NEUROGLANCER_ACCORDION_DEFAULT_EXPANDED: default false. If True, accordions all have a default state of being expanded. If False, each Accordion Tab holds setup options for all the accordion sections within the tab, and these options specify the default state of the section. For example, the current segmentation accordion setup options are:So the only section here which would be expanded by default if
NEUROGLANCER_ACCORDION_DEFAULT_EXPANDEDis false is the appearance section, because ofdefaultExpandedbeing true.isDefaultKeyis a separate concept - in case an element is added to the accordion without specifying the section it should be in, then that element will go into the section marked as the default key.For now I've left these flags as what we are using, but neuroglancer may want to change
NEUROGLANCER_ACCORDION_DEFAULT_EXPANDEDto true.