lostintangent / codeswing

VS Code extension for building web applications ("swings") using a interactive and editor-integrated coding environment
https://aka.ms/codeswing
MIT License
977 stars 45 forks source link

Improve the experience of adding new files to a swing #32

Open jasonwilliams opened 3 years ago

jasonwilliams commented 3 years ago

I was sketching something in JS so only needed the JS window ("JS Only"), but then wanted to add some html. At this point it seemed too late as there's no option to bring back to the HTML or CSS pane.

Is it possible to offer the option in case the user changes their mind half way through? For now i've closed the swing and re-opened a new one and pasted the JS back in

lostintangent commented 3 years ago

If you open up the "CodeSwing" view on the Explorer tab, you can click the plus button to add an "index.html" file. Currently though, the swing layout wouldn't automatically adjust to the new file, and so to workaround that, you could simply change the layout type to the exact same layout.

To make this flow simpler, I'm thinking about displaying a less of "candidate" files, when you add a new file to a swing. That way, you can simply select a file name, without needing to remember what it needs to be called (e.g. index.html, index.pug, etc.).

Additionally, I could watch for new files being added, and then automatically relay out the preview editor. I'll take a look at optimizing this flow this week 👍