mulesoft / api-designer

A web editor for creating and sharing RAML API specifications
Other
1.07k stars 269 forks source link

Resources View not always showing up #299

Open bewilliams opened 9 years ago

bewilliams commented 9 years ago

I noticed that the Resources view (the dynamic and interactive api explorer on the right) does not always show up. It seems to be linked with creating a new file. The file I created to start with has it, but creating a new file does not bring that view up.

Is there a way to make it show?

dmartinezg commented 9 years ago

The console view is only available when the file in the left is a .raml file (it has a .raml extension, it has a #% RAML header at the top, or it is running on top of a file system abstraction that marks the file as a RAML parseable file)

The reasons for this are many, but it mostly has to do with the fact that if you are editing a non-raml file, what would the console show for it? would you expect the designer to show the content of another file in the console? and if so which one? if there was more than one .raml file in the file system, which one would designer pick to show?

All of these questions could be answered by having RAML specifications be hosted within an API project.

usarid commented 9 years ago

Perhaps this could be handled more intuitively even now, eg by automatically collapsing the console vs not showing it at all, and if the user wonders why and expands it, it could show a help text along the lines of "no RAML file is selected" and a smaller-font lengthier explanation about what constitutes a RAML file (though I understand plugins can override that default definition of a RAML file)

sichvoge commented 9 years ago

This is tightly related to issue #205. There are ideas that it would be helpful to keep the api console open when you edit a json file or markdown so that you immediately see the content. That would make editing easier as you get the same UX as with editing a RAML. Hope it is clear what I mean by that.

To have that, we need to keep the state of the console as every time you save a file - it goes back to the main list of resources.

I see that as an improvement of the current UX, but open for discussions @usarid @dmartinezg @blakeembrey

blakeembrey commented 9 years ago

There'll need to be some changes with the console so it doesn't constantly reset and instead reflects updates correctly, but having button to open the console (e.g. pinning it as a second pane) would be a massive improvement. We need the concept of opening/closing to exist because you can have multiple root RAML files. Another idea is to look up the root based on includes, but that suffers the same problem - the file could be included from multiple root file trees.

From this, I suggest having some sort of open/pin that can be closed and replaced with another view. Basically a second pane. This would allow future improvements such as interactive JSON schemas editors, etc to be opened in the second pane of JSON files (but only if you click it to happen).

sichvoge commented 9 years ago

Question is how much effort something like that takes? And what that change influence?