Hide console option in view menu #545
Reference in New Issue
Block a user
Delete Branch "feat-hide-console"
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?
This was simplest way I could find and is fine for me. Menu item is enough, no ned for a button on console pane.
Thanks @hrgdavor,
I should be able to take a look after Thursday.
I'll implement the toggle in the side bar when I get a moment.
I've updated the description in #540 to give better instructions and added the hacktoberfest label to it incase someone wants to have a crack. Do you want to have another go @hrgdavor? I can assign you or we can wait to see if someone picks it up?
I will give it a go.
however, this variant with setLayout is bit awkward, but will work I guess.
@franknoirot I made it with a simple checkbox, is a new toggle component ready ?
@Irev-Dev pls review
Oh dang @hrgdavor I missed your comment earlier saying deal, yeah I can make a quick toggle component!
There is also a Switch component used in customizer, but that seems like sth builtin to swap 2 different sets of html, and not an actual toggle component.
@hrgdavor,
What is awkward? Are you talking about developing it is awkward? or are talking about for the user?
I never really understood this comment, do you think being able to hide the console will be useful for other users as well?
Thanks for having another go, the implementation is still a bit rough and results in the user's previous setup being disregarded so I've made my own update to not waste any more of your time (see
0fda7eb). More details here:https://user-images.githubusercontent.com/29681384/136781701-bb81599c-d680-429b-9d87-5d4ea064adbc.mov
Are you happy to commit directly to this branch to add the toggle @franknoirot?
Mutating state like this will cause problems down the road. By never mutating state, means we can reliably use weak/shallow equality. So mutations are not allowed.
yes it was awkward to implement. I am not used to so many rules what not to do. I did not have a clear picture how to implement it, let's say properly.
Hopefuly I can be more useful in the future, I am better at copying existing code, as I am not motivated to learn all of the libraries/frameworks here :)
I hear ya @hrgdavor these panels are tricky. @Irev-Dev I've added in a toggle that works like so:
https://user-images.githubusercontent.com/23481541/136882183-ae058c6d-776d-4445-8263-e748befa0c33.mp4
@@ -0,0 +15,4 @@top: '50%',transform: checked? 'translate(-100%, -50%)': 'translate(0%, -50%)',Sorry I think I put you onto this pattern, theres just one nuance in that it needs to be done within a template string so that the result is aways a string, i.e. assigning a boolean to
classNameputs a whole bunch of noise in the console since it needs to be a string.Looks good, @hrgdavor and @franknoirot for getting this over the line 🎉
Team effort!

Live now.