KittyCAD / modeling-app

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

Variables panel doesn't display KCL functions properly #2383

Closed adamchalmers closed 5 months ago

adamchalmers commented 5 months ago

In my program, the variable "cube" is defined as a function. But the 'variables' panel says that 'cube' is undefined.

cube is not undefined

The variable panel should say cube is a "KCL function" instead of saying it's undefined.

Irev-Dev commented 5 months ago

I'm not sure when this broke, at one point the .value of a function on the returned program memory was just returned as the string function, that changed at some point and obviously this panel didn't get updated. The good news is there was a test for it (just verifying that it was undefined 😑 ) so it shouldn't break again.

Hope your okay with this formatting?

image

It's a bit arbitrary, but if you look at the diff in #2392, it would be easy to tweak.

One thing that's not great about the change I made is for some reason the types for function are not there, so I had to do a fair bit of as any.