glorious-codes / glorious-demo

The easiest way to demonstrate your code in action.
https://gdemo.compilorama.com
MIT License
3.41k stars 107 forks source link

Allow Multiple Terminals #26

Open nahtnam opened 6 years ago

nahtnam commented 6 years ago

I am trying to create a demo where I start a server and then curl the API. It would be nice if I could open a new terminal session (it would look pretty cool if it shows up as a tab at the top) and switch back and forth while adding responses to each one independently

mostafaebrahimi commented 5 years ago

@rafaelcamargo Hi again. What's your idea to handle tab?

mostafaebrahimi commented 5 years ago

@rafaelcamargo I think you must add a tab component that need to handled by application. Because of backward compatibility you need to have default write() command() response() but you can
consider that every things happened in a tab.
So by calling write() or command() response() considered that client want to write to default tab and here you can add new function in application that call openTab(name) or openTab(id) that creates new tab and writing was happened in that tab.(you can handle switch tab by openTab(name) like openApplication()

nahtnam commented 5 years ago

I agree with @mostafaebrahimi. I think that API would be most consistent and convenient

rafaelcamargo commented 5 years ago

@mostafaebrahimi The way is fine. Tab must certainly be a new component to be orchestrated by an application.

Regarding the API, I think tab could be a new option for the method openApp:

gdemo.openApp('editor', { tab: 'tabName' }).end();

If no tab is specified, the default one is used.

However, how would you handle window title in the application? After creating the tab component, I could have more than just one open file in the editor for example. 🤔

What's your thoughts?

mostafaebrahimi commented 5 years ago

@rafaelcamargo I have an opinion about editor but not about terminal yet.We can impact editor like usual editors.if we have tabs so we add tabs row to desktop and we implement every tabs like that we have single editor-application in that tab. What's your idea?

mostafaebrahimi commented 5 years ago

@rafaelcamargo I think some changes we need here:

  1. create new method openTab that creates new tab(editor-applicaiton) or find application and open it
  2. create new Animation for handle tabs(like animtaion in openApplication that scale - here switch -)
mostafaebrahimi commented 5 years ago

@rafaelcamargo What's your thought?

rafaelcamargo commented 5 years ago

@mostafaebrahimi So, I am still figuring out how to solve that, but the approach discussed above seems to be really fair. Since this feature is a little complex, I'll focus on getting that done on this weekend and will resume my thoughts on this issue on the next week 👍

quinton-ashley commented 5 years ago

I am interested in this feature too! It would be great to have tabs in the editor for different files. Has progress been made on this?

rafaelcamargo commented 5 years ago

Hi @quinton-ashley!

No, this feature is not in development yet. Since I'll be working the next weeks on another glorious project to release it, I'd be very happy If you consider you're be able to offer this contribution ✌️