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

Confusing UX when in an existing project #37

Open karlhorky opened 3 years ago

karlhorky commented 3 years ago

If a user creates a new swing in an existing project, it is a bit visually confusing as to what is going on:

  1. The Explorer panel for the existing project is still open on the left
  2. If the user created the swing in a different folder, there is no reference to the current swing file (eg. index.jsx) in the Explorer panel

Maybe it would make sense to open a new window with the location of the created swing?

Some other strange-feeling behaviors:

  1. You can close the Swing file without the preview tab closing. There could be a UI state where you have the old preview tab still around, but unrelated files in the existing project open.
  2. If you close the preview tab, it closes all other files (also unrelated ones)
  3. If you start a new Swing in an existing project with some files open, it will try to close those files (and lead to confusing, seemingly unrelated warnings such as Are you sure that you want to close <unrelated buffer tab X>?

Maybe these would also be addressed by opening swings in their own windows.

lostintangent commented 3 years ago

Thanks for the feedback! My main motivation for this current behavior is that I wanted a way to create temporary swings to try an idea, but without switching contexts. So for example, if I'm working on a web app codebase and I want to quickly try something with the React API, I could do that, without opening a new window.

That said, I agree that the current experience is optimized for that kind of "scratch pad" workflow. Out of curiosity: for your use case, would you be interested in creating the swings within the currently opened workspace?

I'll also give some thought to how to easily allow opening the swing is a new window as well. Stay tuned!

karlhorky commented 3 years ago

for your use case, would you be interested in creating the swings within the currently opened workspace?

Hm... in most cases probably not, but I suppose there may be some use cases that I haven't considered yet...

if I'm working on a web app codebase and I want to quickly try something with the React API, I could do that, without opening a new window

Interestingly enough, this is also my context a lot of the time, but my preference would be different in that I want to be able to clearly differentiate between what is a swing and what is the existing project (different windows would do this for me easily).

I'll also give some thought to how to easily allow opening the swing is a new window as well. Stay tuned!

Nice, thanks!