KittyCAD / modeling-app

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

should be able to edit/extrude sketch with no variable declaration #3238

Open jessfraz opened 1 month ago

jessfraz commented 1 month ago

see video

https://github.com/user-attachments/assets/0814eb64-9a80-4efd-8c4c-522b16ce5d94

more info here https://kittycadworkspace.slack.com/archives/C04KFV6NKL0/p1722552201055069

jtran commented 1 month ago

The app is trying to go through this path:

source range selection -> pathToNode -> call AST node -> variable declaration AST node -> variable name -> variable value in ProgramMemory (should be ExtrudeGroup or SketchGroup) -> face or plane

Unfortunately, that's impossible unless the KCL has assigned the pipeline to a variable. If you add let x = to the first line, all problems go away. The assumption that there is a variable is deeply ingrained.

To fix this right, we need @Irev-Dev's changes from #3140 so that we can find the face or plane from an arbitrary UUID that the user has clicked.

In the meantime, I thought we could require KCL authors to always use a variable. A parse error would hopefully guide users to fixing their code.

Is it easy to make an auto-fix that can migrate users' code? That would be ideal.

But also, the variable requirement would go away once the artifact graph was completed.

jessfraz commented 1 month ago

id rather just disable the button on these? is that possible or we wait for kurts change because changing kcl is not going to work that will break everyone more

jessfraz commented 1 month ago

@Irev-Dev can you get in your PR by our monday?

jtran commented 1 month ago

It should be possible to disable the button until Kurt's change is in.

Irev-Dev commented 1 month ago

The change is in!

Irev-Dev commented 1 month ago

Temp fix to stop user from getting into a bad state is here: https://github.com/KittyCAD/modeling-app/pull/3292 Not closing this issue out yet though. Quick explanation

https://github.com/user-attachments/assets/01fdb43c-ddee-45e8-9d62-6cddd2b5b8ff