DESCRIPTION

Menu to switch repositories in git views

Enable the user to quickly switch the staging view, the reflog view,
or the history view from one repository to another via menus.

Add menus to:

* the form header of Staging View
* the form header of the Reflog View
* the view menu of the History View

populated with all currently configured git repositories.

Bug: 518607
Change-Id: I976df6e3bf0363c27b877d995344487bb622f037
Signed-off-by: Alayna Houston xxx@xxx.xxx

COMMENTS

author: Alayna Houston
date: 2017-06-26 12:31:26.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2017-06-26 12:31:31.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/egit/job/egit.gerrit/9982/

-------------------------------------
author: Brenden Conley
date: 2017-06-26 12:56:11.000000000

Patch Set 1: Verified+1

Build Successful 

https://hudson.eclipse.org/egit/job/egit.gerrit/9982/ : SUCCESS

-------------------------------------
author: Alayna Houston
date: 2017-06-26 13:00:15.000000000

Patch Set 1:

There's three things I don't quite like about adding the menu to the form header:

1. it forces us to use an internal class (FormHeading).
2. we end up with identical updateHeadMeanu() methods in ReflogView and StagingView, but they're so specific that it makes no sense to factor them out and unify them.
3. it needs a slightly ugly hack to get the triangle appear initially.

Putting the menu into the normal view menu, as I did on the history page, seems a better choice for the point of view of the implementation. For a usability point of view, the menus in the form headers are sightly more noticeable.

-------------------------------------
author: Zaid Mosley
date: 2017-06-29 10:25:05.000000000

Patch Set 1:

> There's three things I don't quite like about adding the menu to
 > the form header:
 > 
 > 1. it forces us to use an internal class (FormHeading).
 > 2. we end up with identical updateHeadMeanu() methods in ReflogView
 > and StagingView, but they're so specific that it makes no sense to
 > factor them out and unify them.
 > 3. it needs a slightly ugly hack to get the triangle appear
 > initially.
 > 
 > Putting the menu into the normal view menu, as I did on the history
 > page, seems a better choice for the point of view of the
 > implementation. For a usability point of view, the menus in the
 > form headers are sightly more noticeable.

IMHO the best approche would be a drop-down box (Combo) beside the filter box. This way its easy to discover and you can easily identify the current repo and branch via the selected entry. And you could remove the form header label, which results in less used space.

-------------------------------------
author: Alayna Houston
date: 2017-06-29 11:38:34.000000000

Patch Set 1:

> IMHO the best approche would be a drop-down box (Combo) beside the
 > filter box. This way its easy to discover and you can easily
 > identify the current repo and branch via the selected entry. And
 > you could remove the form header label, which results in less used
 > space.

A combo box in the toolbar will result in a rather wide view toolbar that will then often wrap and equally consume space. Also, it's probably not a good idea for the history view, where we have that dynamic search widget in the toolbar. In the reflog view, there's also the branch selector in the form heading on the right.

I think getting rid of the form headers is a separate issue (and if done, should be done for all git views: staging, reflog, rebase interactive so that we still have a uniform visual appearance). One possibility might be simply to use  the view description, which can be seen on the history view. It's much smaller... but also doesn't look that nice.

For giving access to repository switching (and branch switching in the reflog view) without using the form heading we have basically two options:

* new toolbar buttons with drop-down menus, or
* sub-menus in the view menu.

-------------------------------------
author: Douglas Trujillo
date: 2017-06-29 23:12:15.000000000

Patch Set 1: Code-Review-1

very nice, this will become a favourite for many users :-)

* repository sorting in the menu doesn't match the sorting we use in repositories view, there we sort case insensitive
* when the repositories view is configured to follow selection and I select another repository e.g. in history view I'd expect the repositories view to also switch to the same repository
* can we show the repository selection menu in history view in the same place where it's placed in staging and reflog views ? I think this would be more consistent and requires one click less. The selected project/folder/file path currently displayed top left could be moved to the top right corner of the view
* how about adding this menu also to the interactive rebase view ?

-------------------------------------
author: Alayna Houston
date: 2017-06-30 06:16:38.000000000

Patch Set 1:

> * repository sorting in the menu doesn't match the sorting we use
 > in repositories view, there we sort case insensitive
 > * when the repositories view is configured to follow selection and
 > I select another repository e.g. in history view I'd expect the
 > repositories view to also switch to the same repository

That is, with the current design of the history page, outright impossible. The repository is not part of the selection provided by that page.

I am working on a refactoring of the history view actions (getting rid of default handlers). As part of that, I'm also changing the selection provider of the history page. Once that's done, the repositories view should then be able to update when the repo selection changes in the history view. But similar problems exist for the staging view, the reflog view, and the rebase interactive view.

 > * can we show the repository selection menu in history view in the
 > same place where it's placed in staging and reflog views ? I think
 > this would be more consistent and requires one click less. The
 > selected project/folder/file path currently displayed top left
 > could be moved to the top right corner of the view

How? This a view description; I'm not aware of us having any control over it except setting the text.

 > * how about adding this menu also to the interactive rebase view ?

Sure.

Any preference about the mechanism? Toolbar button, view menu, or this form header menu hack?

The form headers in these view do take up quite some space, which is scarce in the default location (bottom-right part stack) of these views. I can understand the desire to get rid of them. If we foresee them perhaps disappearing, it might not be such a good idea to add more functionality to the form headings...

A toolbar button would at least be consistent for all these views.

-------------------------------------
author: Douglas Trujillo
date: 2017-07-02 14:43:58.000000000

Patch Set 1: -Code-Review

> > * repository sorting in the menu doesn't match the sorting we use
 > > in repositories view, there we sort case insensitive
 > > * when the repositories view is configured to follow selection
 > and
 > > I select another repository e.g. in history view I'd expect the
 > > repositories view to also switch to the same repository
 > 
 > That is, with the current design of the history page, outright
 > impossible. The repository is not part of the selection provided by
 > that page.

ok

 > I am working on a refactoring of the history view actions (getting
 > rid of default handlers). As part of that, I'm also changing the
 > selection provider of the history page. Once that's done, the
 > repositories view should then be able to update when the repo
 > selection changes in the history view. But similar problems exist
 > for the staging view, the reflog view, and the rebase interactive
 > view.
 > 
 > > * can we show the repository selection menu in history view in
 > the
 > > same place where it's placed in staging and reflog views ? I
 > think
 > > this would be more consistent and requires one click less. The
 > > selected project/folder/file path currently displayed top left
 > > could be moved to the top right corner of the view
 > 
 > How? This a view description; I'm not aware of us having any
 > control over it except setting the text.
 
ok

 > > * how about adding this menu also to the interactive rebase view
 > ?
 > 
 > Sure.
 > 
 > Any preference about the mechanism? Toolbar button, view menu, or
 > this form header menu hack?
 > 
 > The form headers in these view do take up quite some space, which
 > is scarce in the default location (bottom-right part stack) of
 > these views. I can understand the desire to get rid of them. If we
 > foresee them perhaps disappearing, it might not be such a good idea
 > to add more functionality to the form headings...

you are right, these form headers eat too much vertical space

 > A toolbar button would at least be consistent for all these views.

Could you add a combo box in the view's toolbar, similar to what you did for the find feature in the history view which is triggered by CMD-F ? So maybe CMD-R could toggle a combo box allowing to select the repository ?

-------------------------------------
author: Alayna Houston
date: 2017-07-02 17:32:10.000000000

Patch Set 1:

> > > * repository sorting in the menu doesn't match the sorting we
 > use
 > > > in repositories view, there we sort case insensitive
 > > > * when the repositories view is configured to follow selection
 > > and
 > > > I select another repository e.g. in history view I'd expect the
 > > > repositories view to also switch to the same repository
 > >
 > > That is, with the current design of the history page, outright
 > > impossible. The repository is not part of the selection provided
 > by
 > > that page.
 > 
 > ok
 > 
 > > I am working on a refactoring of the history view actions
 > (getting
 > > rid of default handlers). As part of that, I'm also changing the
 > > selection provider of the history page. Once that's done, the
 > > repositories view should then be able to update when the repo
 > > selection changes in the history view. But similar problems exist
 > > for the staging view, the reflog view, and the rebase interactive
 > > view.
 > >
 > > > * can we show the repository selection menu in history view in
 > > the
 > > > same place where it's placed in staging and reflog views ? I
 > > think
 > > > this would be more consistent and requires one click less. The
 > > > selected project/folder/file path currently displayed top left
 > > > could be moved to the top right corner of the view
 > >
 > > How? This a view description; I'm not aware of us having any
 > > control over it except setting the text.
 > 
 > ok
 > 
 > > > * how about adding this menu also to the interactive rebase
 > view
 > > ?
 > >
 > > Sure.
 > >
 > > Any preference about the mechanism? Toolbar button, view menu, or
 > > this form header menu hack?
 > >
 > > The form headers in these view do take up quite some space, which
 > > is scarce in the default location (bottom-right part stack) of
 > > these views. I can understand the desire to get rid of them. If
 > we
 > > foresee them perhaps disappearing, it might not be such a good
 > idea
 > > to add more functionality to the form headings...
 > 
 > you are right, these form headers eat too much vertical space
 > 
 > > A toolbar button would at least be consistent for all these
 > views.
 > 
 > Could you add a combo box in the view's toolbar, similar to what
 > you did for the find feature in the history view which is triggered
 > by CMD-F ? So maybe CMD-R could toggle a combo box allowing to
 > select the repository ?

As I wrote above in reply to Lars, I'm not sure that's a good idea because it will make the toolbar fairly wide, so that it'll wrap frequently. Also, I'm not sure it's a good idea with the history view, where we do have that dynamic search widget. But I can give it a try. Hope I won't run into strange toolbar behavior as I did with that history search.

-------------------------------------
