JBirdVegas / external_jbirdvegas_mGerrit

mGerrit is a Gerrit instance viewer
19 stars 8 forks source link

Ability to comment the source code #46

Open fracz opened 8 years ago

fracz commented 8 years ago

I have wrote it in a comment at Google Play but this seems to be more suitable place. It would be great if we could comment source code (I mean adding comments to lines of code). Now, the only possiblity (I'm aware of) is to add an overall comment for the change.

p4r4n01d commented 8 years ago

Yes, this is a great idea and is definitely something on the list for the future direction of authenticated actions.

However, since this is a large change and I am not sure of the UI/UX involved on how best to achieve this, it currently has a low priority. There are a number of other authenticated actions planned sooner than this which there is currently no workaround possible in mGerrit (not including going to the web interface).

Some notes:

I hope this doesn't come across as I am shooting your idea down - this feature would be amazing and is definitely the direction I want to see mGerrit heading towards - it just needs plenty more thought and help on it. Any thoughts on this @JBirdVegas?

fracz commented 8 years ago

Well, I have some experience with this as I was interested in mobile code reviews some time. I have created a general-purpose applicaiton for mobile code reviews which then was used to launch a case study to check if code reviews on mobile devices make sense. In fact, the data I have collected has shown that mobile code reviews are as afficient as code reviews on large PC screens (you can find experiment details, collected data and conclusions in my paper: Can the source code be reviewed on a smartphone?). The application does not use Gerrit in any way. It is designed to open source code from SD card. But it has some great features like recording voice comments for example.

Moreover, as I'm currently working at a university, I had students that made an application that uses Gerrit API and provides similar functionality as mGerrit. Unfortunately, it was never released in Google Play and the project was shut down immediately after they have finished their thesis. It had some stability issues and stopped working with Gerrit 2.11 and above.

As for the UX involved in both applications, they:

I can provide some screenshots if you wish.

JBirdVegas commented 8 years ago

I'd love to see some screenshots. I really like the idea. The diff UI could probably use some love from a UX designer. Problem become worse when considering how comments on source should be shown. For example if you allow commenting then you must also allow threads of comments at source locations, Blah.java line 43 has 4 comments.

I'll have to double check but right now I think we are ignoring the inline comments when getting the source. The only comments we are displaying are the comments on the review not on the diff. Great idea.

p4r4n01d commented 8 years ago

To clarify, we are not fetching the inline comments at all and there would need to be some database modifications to properly do so. The only comments we are displaying are the comments on the change as a whole rather than those on a diff. Note that comments from all the patchsets (revisions) are displayed, while we only display the diff from the current patchset.

@fracz Your paper looks very interesting. I have started to read through it and I hope you don't mind if I share (link) it with others at work.

fracz commented 8 years ago

As for the first app I have described (no Gerrit-integration) - it was able to display the current version of the file only.

And the features are as follows:

  1. Predefined comments (one-click to add comment), group Style
  2. Predefined comments, group Bug
  3. Predefined comments, group Unclear
  4. Type in a text comment
  5. Record voice comment
  6. Mark of the line that has comments
  7. Currently selected line (the line that new comments will be added to)

The predefined comments are commonly used comments like Unformatted code or Unused variable. They can be configured by reviewer so he can add remarks he use most often and then just click the button and select one of the suggestions that appear during the review. People liked it very much (around 50% of comments gathered during the experiment were predefined).

On the long-press line, te screen was divided horizontally so the source code was on the top and the comments added to the line were on the bottom.

As you can see, the application breaks the lines of source code. This was generally disliked, however it enabled to review the code even on very small resolutions (i.e. 320px wide). The mostly demanded features requested by the participants of experiment with this app were:

I should provide the screenshots of the second app shortly.