Bug 423242 - Add ability to edit comment from compare editor popup
Summary: Add ability to edit comment from compare editor popup
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: 2.4   Edit
Assignee: Guy Perron CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed, plan
: 379222 410123 (view as bug list)
Depends on: 428038 440821 441710 442115 442629
Blocks:
  Show dependency tree
 
Reported: 2013-12-04 15:54 EST by Guy Perron CLA
Modified: 2014-12-30 15:54 EST (History)
6 users (show)

See Also:


Attachments
Snapshot of the current prototype (99.72 KB, image/png)
2013-12-19 14:42 EST, Guy Perron CLA
no flags Details
Snapshot of the desired transition (27.66 KB, image/png)
2013-12-19 14:43 EST, Guy Perron CLA
no flags Details
CurrentImplementationPopup (13.11 KB, image/png)
2014-01-28 16:44 EST, Guy Perron CLA
no flags Details
CurrentImplementationImputDialog (25.85 KB, image/png)
2014-01-28 16:46 EST, Guy Perron CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Guy Perron CLA 2013-12-04 15:54:37 EST
When navigating from a comment to another, enable hovering and popup the comment.

In addition, when user actually chooses to hover over popup area, open up an edit dialog on the comment.

This feature depends on bug 422673.
Comment 1 Steffen Pingel CLA 2013-12-19 08:52:06 EST
That sounds like a great idea. Guy, I believe you mentioned that you were planning to work on this on the last call and showed a first demo of this feature. I'll assign this to you for now but feel free to bounce back to inbox.
Comment 2 Guy Perron CLA 2013-12-19 14:42:07 EST
Created attachment 238500 [details]
Snapshot of the current prototype

This snapshot shows the prototype.
Comment 3 Guy Perron CLA 2013-12-19 14:43:36 EST
Created attachment 238502 [details]
Snapshot of the desired transition

This snapshot shows what the final windows would look like.
Comment 4 Guy Perron CLA 2013-12-19 14:52:46 EST
To give a better understanding I have added 2 attachements:
Prototype and Expected

In Prototype, we can see the actual display as shown in the current prototype.
The first dialog is an extension of PopupDialog with a mousetracker. The second one is an extension of FormDialog.
 The idea is to change it so that it looks and behaves like the second attachment called Expected which is taken from the Eclipsse Java editor.

If any of you has some idea and or snippets to emulate the class used for the Expected attachment, please share.

Thanks
Comment 5 Gunnar Wagenknecht CLA 2013-12-19 14:53:39 EST
I agree, it should look like the one in JDT. I can investigate if there is some code in JDT to borrow.
Comment 6 Sam Davis CLA 2014-01-07 19:53:23 EST
It's implemented by org.eclipse.jdt.internal.ui.text.java.hover.AbstractJavaEditorTextHover and sub-classes but I'm not sure if it can be used outside of a JavaEditor.
Comment 7 Gunnar Wagenknecht CLA 2014-01-08 03:32:33 EST
Well, it's EPL so we can definitely re-use the implementation in the Reviews Compare editor.
Comment 8 Sam Davis CLA 2014-01-10 14:06:00 EST
Good point.
Comment 9 Guy Perron CLA 2014-01-28 16:44:18 EST
Created attachment 239408 [details]
CurrentImplementationPopup

This the popup as it's implemented. It reuses the Class used by comment hover to keep consistent look.
Comment 10 Guy Perron CLA 2014-01-28 16:46:44 EST
Created attachment 239409 [details]
CurrentImplementationImputDialog

This is a snapshot of current input dialog. The edge is as such to allow the user to move it around at his preference. Its location is then persisted from one comment to another.
Comment 11 Guy Perron CLA 2014-01-28 16:47:42 EST
Anyone feel free to comment.
Comment 12 Sam Davis CLA 2014-03-11 20:13:52 EDT
Will this also allow comments to be deleted?

410123: allow to remove an added comment
https://bugs.eclipse.org/bugs/show_bug.cgi?id=410123
Comment 13 Guy Perron CLA 2014-04-11 15:39:04 EDT
The code has been pushed to gerrit :

https://git.eclipse.org/r/#/c/23534/7

Please review it. There is a build failure but it's unit test related and doesn't prevent the review to start. I am looking into the failure cause.

To answer comment 12, yes it allows to delete a comment.

Thanks
Comment 14 Guy Perron CLA 2014-04-11 15:44:12 EDT
To further clarify, the deletion is possible so long that it's a DRAFT.
Comment 15 Sam Davis CLA 2014-04-11 18:22:28 EDT
*** Bug 410123 has been marked as a duplicate of this bug. ***
Comment 16 Guy Perron CLA 2014-04-23 09:09:18 EDT
Hi folks, 
I haven't had any feedback regarding the push to gerrit:
https://git.eclipse.org/r/#/c/23534/
Patch 10 represents the latest of what was demoed Wednesday April 9th.

As discussed, we plan to introduce this into Mylyn 3.12. There are 25 files to review, you should get started asap so it can be merged in time for the cutoff date.

Thanks.
Comment 17 Sam Davis CLA 2014-07-04 01:56:27 EDT
I have a question about comment replies. When there are multiple comments on a line, does it make any difference which one is selected when replying?

Here are some issues I found.

The comment navigation doesn't work properly when there are comments on both sides when using compare with (try it with comments on left line 2, right line 6, left line 8). However I think this works better than it does on master.

When opening an image file and clicking the next/prev comment buttons, an exception is logged:

java.lang.NullPointerException
at org.eclipse.mylyn.internal.reviews.ui.compare.ReviewCompareAnnotationSupport.gotoAnnotation(ReviewCompareAnnotationSupport.java:192)
at org.eclipse.mylyn.internal.reviews.ui.compare.ReviewItemCompareEditorInput$2.run(ReviewItemCompareEditorInput.java:115)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:452)

Also, when trying to post a comment as anonymous, I get an error dialog with an NPE:

java.lang.NullPointerException
	at org.eclipse.mylyn.internal.reviews.ui.dialogs.CommentInputDialog$1.run(CommentInputDialog.java:274)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
	
When closing the compare editor, the open comment hover should also be closed.

Sometimes the comment hover appears on a different screen than the Eclipse window when the window is maximized on Windows.
Comment 18 Guy Perron CLA 2014-07-04 16:10:27 EDT
The NPE for when hitting next/prev on a binary file has been fixed with the patch set 35.

As per the NPE when adding a comment as anonymous, I don't reproduce this. Also note that this is a functionality that was there in the first place.
Comment 19 Sam Davis CLA 2014-07-04 16:31:11 EDT
(In reply to comment #18)
> As per the NPE when adding a comment as anonymous, I don't reproduce this. Also
> note that this is a functionality that was there in the first place.

CommentInputDialog, where the NPE happens, is added with this review. There is even a compilation warning about it (I think the value of isSave or isDiscard could change by the time the job runs).
Comment 20 Sam Davis CLA 2014-07-30 17:50:45 EDT
I have merged the review. As previously mentioned, this needs further code review. I'll create a subtask to ensure we don't forget to do it.
Comment 21 Sam Davis CLA 2014-08-18 20:21:59 EDT
Code review done.
Comment 22 Sam Davis CLA 2014-08-18 20:42:35 EDT
This is blocked by 441710: add tests for editing and deleting a comment
https://bugs.eclipse.org/bugs/show_bug.cgi?id=441710
Comment 23 Sam Davis CLA 2014-09-09 16:38:05 EDT
All subtasks have been closed. Thanks very much for the contribution!
Comment 24 Miles Parker CLA 2014-12-30 15:54:26 EST
*** Bug 379222 has been marked as a duplicate of this bug. ***