Bug 358232 - Provide toolbar for enriched Team > Show Annotation hover
Summary: Provide toolbar for enriched Team > Show Annotation hover
Status: ASSIGNED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 1.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Thomas Wolf CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-20 08:39 EDT by Dani Megert CLA
Modified: 2021-08-16 05:00 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2011-09-20 08:39:08 EDT
The CVS annotation hover can now be enriched by moving the mouse into it. It
would be cool to add a toolbar with some actions/buttons, e.g. 'Compare with
Previous', 'Show in History', 'Next' and 'Previous'. For inspiration look at the JDT problem hover.
Comment 1 Markus Keller CLA 2011-09-20 09:50:27 EDT
This bug is for the Git hover (bug 229255 is the request for CVS).
Comment 2 Stephan Herrmann CLA 2012-02-04 06:38:00 EST
Yes, this would be so cool :)

(FWIW, I came here from bug 356313).
Comment 3 Markus Keller CLA 2012-02-16 13:23:34 EST
Please ping me if you have questions about the implementation.

It should be as simple as adding a new constructor to BlameInformationControl that passes on a new ToolBarManager(SWT.FLAT) to the super class. What's a bit hairy is that you have to pass the AbstractInformationControl to the tool bar actions, so that their run method can call infoControl.dispose() to close the hover. See e.g. JavadocHover.ShowInJavadocViewAction in o.e.jdt.ui.
Comment 4 Eclipse Genie CLA 2021-07-31 16:39:35 EDT
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/183574
Comment 5 Thomas Wolf CLA 2021-08-02 03:03:31 EDT
(In reply to Eclipse Genie from comment #4)
> New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/183574

Looks like this was only halfway implemented. The above change now completes that implementation and adds two actions to the toolbar to open the commit in the commit viewer, or to show it in the history view. That duplicates the functionality of the two links at the top.

"Compare with previous" is available in the links on the hunk header (hover over the line numbers); it could perhaps be made more prominent by also adding it to the toolbar.

It's unclear to me what "next"/"previous" should do:

1. navigate to the revision shown in the ruler above/below the currently
   selected one? I don't think the revision framework in JFace supports that.
2. show the diff from the next/previous commit that touched the line? (Might be
   difficult; basically requires running blame from the parent revision, and
   gives an inconsistent display: the ruler would still show the original blame,
   but the pop-up would display the diff from some other commit.) And what diff
   should be shown then: the one from the file to that older commit, or the one
   determined by blame (from the parent commit to that older commit)?
3. behave similar to "go to last (edit) location" and navigate to the last shown
   revision and its line? Would require a history of revision having been shown.
Comment 6 Eclipse Genie CLA 2021-08-15 15:28:47 EDT
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/184035
Comment 7 Matthias Sohn CLA 2021-08-16 03:51:42 EDT
(In reply to Thomas Wolf from comment #5)
> (In reply to Eclipse Genie from comment #4)
> > New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/183574
> 
> Looks like this was only halfway implemented. The above change now completes
> that implementation and adds two actions to the toolbar to open the commit
> in the commit viewer, or to show it in the history view. That duplicates the
> functionality of the two links at the top.
> 
> "Compare with previous" is available in the links on the hunk header (hover
> over the line numbers); it could perhaps be made more prominent by also
> adding it to the toolbar.
> 
> It's unclear to me what "next"/"previous" should do:
> 
> 1. navigate to the revision shown in the ruler above/below the currently
>    selected one? I don't think the revision framework in JFace supports that.
> 2. show the diff from the next/previous commit that touched the line? (Might
> be
>    difficult; basically requires running blame from the parent revision, and
>    gives an inconsistent display: the ruler would still show the original
> blame,
>    but the pop-up would display the diff from some other commit.) And what
> diff
>    should be shown then: the one from the file to that older commit, or the
> one
>    determined by blame (from the parent commit to that older commit)?
> 3. behave similar to "go to last (edit) location" and navigate to the last
> shown
>    revision and its line? Would require a history of revision having been
> shown.

I think 2. would be most useful, something like time travel on the file. Would require to compute blame on the previous/next revision of the same file, update the file content to the previous/next revision of the file, update the blame info in the ruler and update the hunks blame diff shown in the pop-up accordingly
Comment 8 Thomas Wolf CLA 2021-08-16 03:55:29 EDT
(In reply to Matthias Sohn from comment #7)
> I think 2. would be most useful, something like time travel on the file.
> Would require to compute blame on the previous/next revision of the same
> file, update the file content to the previous/next revision of the file,
> update the blame info in the ruler and update the hunks blame diff shown in
> the pop-up accordingly

Very complicated. The functionality already exists via the link on the diff, but it opens a new editor. (It does scroll that new editor to the correct line.)
Comment 9 Matthias Sohn CLA 2021-08-16 04:27:08 EDT
(In reply to Thomas Wolf from comment #8)
> (In reply to Matthias Sohn from comment #7)
> > I think 2. would be most useful, something like time travel on the file.
> > Would require to compute blame on the previous/next revision of the same
> > file, update the file content to the previous/next revision of the file,
> > update the blame info in the ruler and update the hunks blame diff shown in
> > the pop-up accordingly
> 
> Very complicated. The functionality already exists via the link on the diff,
> but it opens a new editor. (It does scroll that new editor to the correct
> line.)

I agree this sounds complicated.

Add a toolbar entry "previous" to do the same what the link does ?
And another one "next" to travel in the opposite direction ?