Skip to content
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
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

aranega
Copy link
Member

@aranega aranega commented Nov 8, 2024

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):

screenwithout

New Option (code viewer visible with button, and hidden):

close
open

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

@aranega aranega changed the title Add option to hide/show code block CC-122/126 Add option to hide/show code block Nov 8, 2024
@aranega aranega requested a review from seankmartin November 8, 2024 12:14
@seankmartin
Copy link

Also looks great overall, thanks!

@aranega aranega marked this pull request as ready for review November 21, 2024 12:18
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.
src/layer/index.ts Outdated Show resolved Hide resolved
src/layer/annotation/index.ts Outdated Show resolved Hide resolved
@aranega aranega requested a review from seankmartin December 5, 2024 12:41
src/layer/index.ts Outdated Show resolved Hide resolved
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.

2 participants