KittyCAD / modeling-app

The KittyCAD modeling app.
https://kittycad.io/modeling-app/download
MIT License
421 stars 35 forks source link

Feature request: ability to toggle constants visibility with a click #1510

Open franknoirot opened 8 months ago

franknoirot commented 8 months ago

In tools like Figma and Onshape, entities can be toggled as visible/hidden with a click on an eye icon. In Figma, the open eye icon only appears on hover of a visible item in the entity (they call them "layers") sidebar, while a hidden item always has the closed eye icon, in addition to being faded in the sidebar to show a deactivated state

Screenshot 2024-02-23 at 3 13 18 PM

While we want to support an entity tree viewer in future when users don't have to touch the code so much, for now the Text Editor is our main entity control interface. Currently users can select a block of code and hit Mod + / to comment it out, but that is not a feature known to non-technical users who don't work in code editors all day.

As a possible halfway point, we could show an eye icon next to any constant declarations in the code which, when clicked, toggles whether the entire expression is commented out or not.

Irev-Dev commented 8 months ago

What if there's other code that references the variable they're commenting out?

If we just let them comment it out it will break the code, that behaviour is fine if they are commenting it out themselves, they are taking charge of the code, but feels a bit weird if it's click a button to break your code kinda deal.

Maybe we warn them or something? not sure I love that though.

franknoirot commented 8 months ago

That's a good point, I'll have to revisit this because that is very non-trivial

jessfraz commented 8 months ago

we might just want to make "show" a real function here then