CodeEditApp / CodeEdit

CodeEdit App for macOS – Elevate your code editing experience. Open source, free forever.
https://codeedit.app
MIT License
20.99k stars 1.01k forks source link

✨ Terminal Utility: Tabs & Split View #379

Open Angelk90 opened 2 years ago

Angelk90 commented 2 years ago

Describe the solution you'd like

Being able to have more than one shell in a project would be great.

image

Please note the following behaviors:

Describe alternatives you've considered

Here are some examples of how it handles Webstorm:

Schermata 2022-04-02 alle 09 40 31 Schermata 2022-04-02 alle 09 41 17 Schermata 2022-04-02 alle 09 42 11

https://user-images.githubusercontent.com/806104/161374050-7e8cc0b5-e731-49a3-a7de-6fd41328adea.mp4

Additional context

Schermata 2022-04-02 alle 09 37 02

Depends on

Angelk90 commented 2 years ago

@austincondiff : What program is that in the video?

Opening would be better like this:

https://user-images.githubusercontent.com/20476002/161380192-008982d6-21b6-4ff2-8dfd-be3218f894b3.mov

austincondiff commented 2 years ago

@Angelk90 I agree that it should open as a drawer like in your video. That video is from VSCode, and demonstrates how it handles terminal tabs and split terminal views. The question we need to answer for this is how are we going to do multiple terminals in this drawer? Will we use tabs? How will we handle split terminals? Will terminals be the only thing that exists in this drawer or will there be other kinds of things like output, issues, debug, console, etc.?

austincondiff commented 2 years ago

This is the design that we will use for multiple terminals. We need this tab system in place in the status bar and the git controls moved up to the toolbar first, then in the terminal tab build the multiple terminal tabs UI, this is how this would look.

01-macOS-code-edit-alternate-ui-drawer-tabs-terminal

Please note the following behaviors:

(updated in issue description)

amit-srt commented 2 years ago

I would like to work on this issue. Can you please assign this to me

ahmdyasser commented 1 year ago

I'd like to work on this, can you please assign it to me? @austincondiff

austincondiff commented 1 year ago

@ahmdyasser Assigned. Let me know if you have any questions.

austincondiff commented 1 year ago

@ahmdyasser I just wanted to check if you were still working on this or if you needed any help with anything?

ahmdyasser commented 1 year ago

HI @austincondiff, I got a bit busy, you can re-assign it if anyone is up to it.

bombardier200 commented 1 year ago

@austincondiff assign me this please!

matthijseikelenboom commented 1 year ago

@bombardier200 You have been assigned, might want to clone @ahmdyasser 's branch so you have some boilerplate.

gokul1099 commented 1 year ago

Can you assign me this issue. I will work on this @austincondiff

bombardier200 commented 1 year ago

@gokul1099 done, if you have questions feel free to ping me,

gokul1099 commented 1 year ago

@bombardier200 I am working on the Drag to group functionality. Currently I implemented onDrag and onDrop on the terminal list view and wrote the DropDelagate. Dragging is working, while dropping I can access the terminal being dragged. But I could not access the terminal or group on which dragged terminal is dropped. Do you have any idea on how to get that? here is my link to file where I have added the DropDelegate https://github.com/gokul1099/CodeEdit/blob/terminal-tabs-split-view/CodeEdit/Features/DebugArea/Views/DebugAreaTerminalView.swift

bombardier200 commented 1 year ago

@gokul1099 can you include a video? It will help me see what exactly you are talking about

gokul1099 commented 1 year ago

https://github.com/CodeEditApp/CodeEdit/assets/42144106/d1125933-7c33-4394-a2f6-e4e913be7fd2

In the above video, while dragging I could access the terminal being dragged (third terminal). I want to access the second terminal also(as the dragged terminal is dropped on this), So that I can group both of them.

Lancelotbronner commented 9 months ago

Hi @austincondiff, I'd like to tackle this!

Here are a few assumptions I'm going with, based on what I've read here so far or what I think. Please correct me if any of them are wrong.

Here's an alternative, which is what I was expecting until I saw your design which contradicted with it:

Lancelotbronner commented 9 months ago

Since names are getting quite long in this area, I have a little rename suggestion. It would also make sense with the way the folders are laid out.

Here's what I mean:

That way things which relate to the utility area as a whole are prefixed with UtilityArea while individual utilities have shorter names.

I'm suggesting this because I'm getting names like

austincondiff commented 9 months ago

I am in favor of those name changes. We still need to figure out a good way to represent the groups. Since the creation of this issue, our utility area has changed quite a bit. If you are able to join our weekly meetup at 3 PM UTC on Discord (15 minutes after the time of posting) we can discuss this as a group.

austincondiff commented 9 months ago

Okay so I think this is how we should represent groups (I've also updated the issue description with this)...

image

As you can see, when a tab is split, both are under a group. By default the name of the group reflects how many terminals are in the split. The user can later however rename the group to whatever they want.

Lancelotbronner commented 9 months ago

Ah sorry I hadn't seen your message earlier I would've liked to be at that meeting!

Great for the naming changes, I'll make a separate PR for that later.

The rest seems good, I got terminals side-by-side and grouping with a few small issues left.

I should be able to finish this tomorrow!

Lancelotbronner commented 9 months ago

Forgot about Christmas and somehow this counts the contents of the disclosure group as separate indices in the onMove function. This may take longer than expected.

List(selection: $model.selectedTerminals) {
  ForEach(model.terminalGroups) { group
    UtilityAreaTerminalTab(group)
  }
}

// UtilityAreaTerminalTab
if group.children.count == 1 {
    /* Terminal cell */
        .id(group.children[0])
} else {
    DisclosureGroup {
        ForEach(group.children) { terminal in
            /* Terminal cell */ 
        }
    } label: {
        /* Terminal group title cell */
    }
}