DESCRIPTION

Contextual actions in tooltips in staging view

If there are selected elements in the staged/unstaged viewers,
provide quick access to the "Add to index"/"Remove from index"
actions via a toolbar shown in a tooltip when the mouse pointer
hovers over a selected element.

Also add those actions to the toolbars of the viewers, properly
enabled/disabled depending on whether there is a selection in
the viewer.

Change the unstage icon: "stage" is a green plus sign, but "unstage"
was an inverted "reset" icon. A red minus sign seems to be more
appropriate and less confusing.

Finally, add tooltips to the section headers of the staged and
unstaged viewers with explanations that should make it easier
for people new to git to get what this whole view is about.
(The notion of being able to compose a commit in the git way is
a novelty for many people new to git.)

Bug: 516969
Change-Id: I53f7d460aee079db25b78afd5a818bc7075547ce
Signed-off-by: Alayna Houston xxx@xxx.xxx

COMMENTS

author: Alayna Houston
date: 2017-06-04 13:27:41.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2017-06-04 14:13:07.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2017-06-04 14:35:45.000000000

Patch Set 1: Verified+1

Build Successful 

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

-------------------------------------
author: Douglas Trujillo
date: 2017-06-11 22:50:21.000000000

Patch Set 1:

(3 comments)

Line:12, /COMMIT_MSG -> could we do this also for non-selected elements ? Having to click on an element before being able to click a hover toolbar button requires too many clicks. Explicit selection seems ok for multi-selection but it feels inconsistent to me that I don't get the hover toolbar over non-selected elements

Line:13, /COMMIT_MSG -> In order to see the action name for an action in the hover toolbar I first have to hover over a selected staging entry and then hover over the action displayed, then I get a tooltip with the action name layered on top of the action button. Could we instead show the action name of actions in the hover toolbar just next to the action icon instead of having a tooltip on the toolbar action. Effectively this would yield a filtered context menu which is opened by hovering over an entry instead of right-clicking a selected entry.

Line:18, /COMMIT_MSG -> maybe we should also rename the actions from "Add to index" to "Stage" and from "Remove from index" to "Unstage" ?

-------------------------------------
author: Alayna Houston
date: 2017-06-12 08:16:06.000000000

Patch Set 1:

(3 comments)

Line:12, /COMMIT_MSG -> Showing the tooltip when there is no selection at all makes no sense since the action would then have no objects to work on.

When there is a selection, showing it on elements not selected gives IMO a confusing UI: what does that mean then? It could also mean "stage the element on which the hover appeared, irrespective of whether or not it's selected". Also, if a selection exists but is invisible (user has lots of unstaged files, selects a few at the top, then scrolls down), I find it confusing to have the hover appear and then operate on invisible elements.

Without the tooltips, you have three clicks: one to select an item, a right click to bring up the context menu, and then a click on a menu entry. With the tooltips, you have two. I don't think we'd want to go down to one.

Line:13, /COMMIT_MSG -> I'll have to experiment, but I'm not sure this can be done well. Of course we could show the action name, but I don't really want to re-build context menus using SWT. Especially since normal context menus are platform-specific, so the look-and-feel will end up different.

Perhaps I can re-use a menu and make it appear automatically, but I'm not sure I can make it disappear automatically...

As I said, I'll have to try.

Line:18, /COMMIT_MSG -> See bug 481360. I don't know what's easier to understand for users. As the renaming of "Show Annotations" to "Show Revision Information" has shown, changing the name of a menu action may confuse some users...

-------------------------------------
author: Alayna Houston
date: 2017-06-12 10:43:13.000000000

Patch Set 1:

(1 comment)

Line:13, /COMMIT_MSG -> As expected, I can use a Menu and make it appear correctly, but then the platform menu takes over mouse handling, and I cannot close the menu properly when the mouse moves away. Don't even get MouseExit events on the menu.

If we make this popup too menu-like, one could also wonder why it should be a filtered menu at all. Could then just as well show the normal context menu.

But without a reliable way to make that menu disappear on mouse moves using a Menu is not an option anyway.

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