Add console toggle to side-tray #540
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The IDE console isn't always needed, so it would be nice to be able to hide it.


We want to add a visibility toggle to the side tray
full designs here
The components that make up the options int he side tray are defined in
app/web/src/components/IdeSideBar/sidebarConfig.tsxin thesettingsConfigarray.Changing to toggle will need to dispatch an action to show or hide the console.
Here is an example that will hide the console
The thunkDispatch and state can be accessed using the
useIdeContext()(search foruseIdeContextto see examples in the repo).The actions update state, handled in
app/web/src/helpers/hooks/useIdeState.ts, pay attention tolayoutproperty on the state object as that's what controls the panels in the IDE. W're usingreact-mosaic-componentso their docs will likely be useful.Follow the instructions in CONTRIBUTING.md to get setup, and of course ask for help here or in the dev-help discord channel.
If you'd like to contribute the CadHub but this issue is taken or you'd prefer something else, have a look at #535 to see if there's something else you would like
@franknoirot, @hrgdavor,
How about we add a toggle into the side tray?
I would try, have not done a PR for some time :)
@hrgdavor @Irev-Dev how does this look? https://www.figma.com/file/VUh53RdncjZ7NuFYj0RGB9/CadHub?node-id=2091%3A4535
@hrgdavor if you'd like to work on this I feel like you can get it working with a normal checkbox and I can make a
Togglecomponent like this one to swap out later.Deal
Some context:
We're using a library for the IDE panels
react-mosaic-component, it's used inapp/web/src/components/IdeContainer/IdeContainer.tsxand the layout is controlled by thelayoutproperty in the app state inapp/web/src/helpers/hooks/useIdeState.ts.I don't think it will be much more than dispatching the event
"setLayout"with the new layout (i.e. with or without the console).And than dispatching
"resetLayout"to put it back.I might be wrong though.
I've overhauled the description to be much more detailed.
Resolved by #545