forked from google/neuroglancer
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CC-122/126 Add option to hide/show code block #47
Open
aranega
wants to merge
16
commits into
master
Choose a base branch
from
feature/CC-122
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
aranega
changed the title
Add option to hide/show code block
CC-122/126 Add option to hide/show code block
Nov 8, 2024
Also looks great overall, thanks! |
CC-154 Add code block visibility control for annotation layer
CC-156 Add code visibility control for single mesh layer
CC-157 Improve state handling for code box hidden
Use a trackable boolean instead of a simple value in the layer, and use CheckBoxIcon instead of a hand-crafted one in each layer that implements the feature.
seankmartin
reviewed
Dec 5, 2024
seankmartin
approved these changes
Dec 5, 2024
aranega
commented
Dec 17, 2024
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.
Summary
This PR introduces a new control button in the layer configuration panel that allows users to toggle the visibility of the shader code editor if one is present (depending on the layer's type). This button shows or hides the code editor within the layer configuration panel, allowing users to focus on other parameters present in the layer configuration panel. Open to feedback and suggestions on the implementation and user interaction!
Current version (no code viewer button):
New Option (code viewer visible with button, and hidden):
Motivation
The ability to show or hide the code viewer was requested to help the user to not be intimidated by the shader code editor which is not manipulated often directly by user visualizing data only. Users often need the option to focus on the 3D view or data without the distraction of the shader code.
User Interaction
In Neuroglancer, the new toggle button is available in the layer configuration panel, placed on top of the shader code editor, next to the "show large editor view" and the "documentation" button. This button allows users to show or hide the code viewer as needed. The control is simple, enabling users to easily manage the visibility of the code viewer without requiring additional keybinds. Very open to suggestions on improving this functionality and placement in the UI.
Implementation
The primary change occurs within the tab rendering components for each impacted layers (currently, annotation layer, image layer, and single mesh layer). A button icon is dynamically updated based on the visibility state, ensuring users can easily toggle between viewing and hiding the code block. The state of the viewer is saved in the state related to each layer.
Example of the new functionality:
video-of-all-three-code-boxes.mp4