Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 377012

Summary: compare - is navigating by char level diff valuable user function?
Product: [ECD] Orion Reporter: Susan McCourt <susan>
Component: ClientAssignee: libing wang <libingw>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: libingw
Version: 0.5   
Target Milestone: 0.5 M2   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
screenshot of confusing diffs none

Description Susan McCourt CLA 2012-04-17 13:32:58 EDT
I'm finally getting a chance to try out the char level diff.
The functionality is really good, but I think we need to step back and think about how we expose this functionality.

The toolbar has "navigate by block" and "navigate by diff."
I think this is too implementation oriented.  I have trouble figuring out what each one means.

I think that navigating by block is what most users will do.  (Do we have an example of a diff tool that navigates at both levels?)  

I tried navigating by diff in real set of code changes and I couldn't find any instance where I got additional insight by doing so.  

I suggest that we just have "next diff, prev diff" in the toolbar and it navigates by block.  If we think users would want to navigate inside a diff, we could always have a keybinding for this command.  I don't think it needs to be front and center in the user's face because it forces them to try both and figure out which one they want, what the difference is, etc.

To me, the next diff/prev diff is kind of like the other advanced editor navigation commands which we don't put in the toolbar.

(We have issues for making these kinds of actions discoverable and executable on a tablet but we can solve that generally).
Comment 1 Susan McCourt CLA 2012-04-17 13:43:50 EDT
Generalizing title of bug.
For code changes I just made, I'm not getting much value navigating the char level diff.  It seems to just make noise.

So I'm wondering if we should expose this at all, or at least understand what the code pattern is that makes this useful.  

Here's a screenshot of some code where the block level diff shows exactly the right thing, but as soon as I nav into char level diff, I get a lot of noise that doesn't seem to help me understand the changes....
Comment 2 Susan McCourt CLA 2012-04-17 13:44:58 EDT
Created attachment 214136 [details]
screenshot of confusing diffs

Here, the block level showed me exactly what I did (removed some if's, etc.) but the char level is highlighting lots of inner changes that aren't really helping me.
Comment 3 libing wang CLA 2012-04-17 15:06:47 EDT
Chatted with Susan on ST, here is the summary.

1. Diff coloring: we still have 4 shades of color(green and red) for block, current block, word, current word. For conflicting blocks, we use yellow for both deleted and added.
TODO : Tune the colors colors in css a little for a less contrasts.

2.Navigation on word(prev/next).
TODO: I will remove the two commands from the tool bar. In the future we may want key bindings. For now you can still click on any word and it will highlight the current pair of the word change.

3.Generate link command.
TODO: I will leave it there for now.

4.Deleted and added word annotation. If there is something deleted from the right side there will be little caret-like green bar showing where it is deleted, on the right side . On the other hand, if there is something added on the left side there will be a red bar showing where it is added, on the right side. It is not intuitive.
TODO: I will change both red and green bar to a thinner black one.
Comment 4 libing wang CLA 2012-04-17 15:21:43 EDT
(In reply to comment #2)
> Created attachment 214136 [details]
> screenshot of confusing diffs
> 
> Here, the block level showed me exactly what I did (removed some if's, etc.)
> but the char level is highlighting lots of inner changes that aren't really
> helping me.

Let me suppose that the little thick green bar is changed to a thinner black one, which gives you a clear gesture that something is added before "loc".
I think this exactly tells you what your change details are. In my opinion it helps when there are multiple changes inside a block. If you are changing 20 lines in a row, there is no way that unified diff can tell you any details.

I believe there are two places confused you:
1. The little green bar is not positioned good enough just BEFORE "loc", and you are thinking you added a space there. We can resolve this by comment 3 bullet 4.

2. The word level diff is highlighting white space. We have to do this in order to use annotation model.

3.Contrast of the color. It makes you feel the block is too busy.
I was thinking about only showing word diff for the CURRENT block, not every block. But I changed my mind when I used compare widget in commit page: I had navigate blocks constantly to view all changes in details. use always want to see them at a glance.
I think tuning the colors may improve the distraction.