KittyCAD / modeling-app

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

UX around editing the code while in sketch mode. #1623

Open Irev-Dev opened 4 months ago

Irev-Dev commented 4 months ago

When your in sketch mode, we do partial executions of just the pipe that makes up the sketch, so it doesn't make sense to let users to edit everything, we might want to introduce the editable sections that we had in the litterbox codeMirror instance.

franknoirot commented 4 months ago

I've created a flow for how this could work in our Sketch Mode Figma page

The important step in the flow is here: Sketch Flow 01 Step 4

It shows the code pane with an overlay that prevents editing outside of the current sketch, with a little confirm/cancel button group that mirrors the new confirm/cancel button group below the toolbar in the far right. Both of these button groups do the same thing, maintaining our goal of mirrored behavior between code and point-and-click editing. The principle here is that modeling "tools" as we define them–XState nested states, which can be equipped and unequipped—also have the right to isolate parts of the AST for editing.