jung-kim / atom-ungit

Atom plugin for Ungit project
MIT License
75 stars 12 forks source link

Multi-Folder Support #26

Closed ibnesayeed closed 9 years ago

ibnesayeed commented 9 years ago

Now that Atom has support for multiple folders in a single window, Ungit should seamlessly switch the context when the project folder is switched. It might already be working, but I can't use Atom-Ungit these days because of the issue #24.

jung-kim commented 9 years ago

v0.5.0 is published and inadequately handles multi folder for now, it only opens very first folder.... :P

My initial thought on this is that we incrementally open ungit. i.e. First open will open very first folder's location and then 2nd open, provided that first view is not closed, it will open 2nd folder's location.

Along with keybinding. I think we can do numeric key binding where ctrl + option + u + 3 will open 3rd folder.

Do you have any other suggestions?

ibnesayeed commented 9 years ago

I would suggest having just one view of Ungit per Atom window and only show one folder in it, which is the active project irrespective of the index of the project directory. When user changes from one project to the other, have an event listener in place which silently updates the location in the Ungit view (if the view exists).

ibnesayeed commented 9 years ago

I will vote against the numeric bindings and would rather prefer keeping it simple.

jung-kim commented 9 years ago

I see, I think I'm going to throw buttons or drop down based on number of folders with folder names and switch view based on click

ibnesayeed commented 9 years ago

Why would you give a separate UI option to switch the context when current context can be set based on the project directory in focus?

jung-kim commented 9 years ago

I think we can try an event listener that will switch ungit repo on focus change, although I'm not a big fan of view change or full page load on the background that is not triggered by view itself.

But I guess I'm old school. I will try this later see if it is implementable this way. I did see several even listeners but don't remember if any of them were pertain to folder change or not.

Honestly, as I normally juggle 3+ different git repos at same time I opened each of them as a tab in chrome so I rarely us atom-ungit.... :P

ibnesayeed commented 9 years ago

I think we should go with the callback mechanism to detect the active context change. But instead of updating the context of the Ungit tab immediately, we can perforrn this task in a lazy manner only when the tab is in focus. For multi-folder support, I think we will have to bring the project path header back that we have hidden initially.

jung-kim commented 9 years ago

v0.5.2 now has multi folder support.

On ungit tab focus, it will navigate to the project of a last opened file.