This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 99059 - Bad scrolling behavior in diff window
Summary: Bad scrolling behavior in diff window
Status: RESOLVED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Diff (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 5 votes (vote)
Assignee: Ondrej Vrabec
URL:
Keywords:
Depends on:
Blocks: 246241
  Show dependency tree
 
Reported: 2007-03-27 00:52 UTC by Jesse Glick
Modified: 2014-09-03 04:22 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot showing misaligned diff blocks (still all on screen; no off-screen problems in this diff) (182.44 KB, image/png)
2007-03-27 18:23 UTC, Jesse Glick
Details
Screenshot showing even more misaligned diff (201.36 KB, image/png)
2007-03-31 02:29 UTC, Jesse Glick
Details
Screenshot from dev build (241.70 KB, image/png)
2007-10-23 18:52 UTC, Jesse Glick
Details
Screenshot using current sources (25.98 KB, image/png)
2008-03-05 17:01 UTC, Jesse Glick
Details
fully working I&T preview window (18.02 KB, image/png)
2014-07-14 10:40 UTC, Ondrej Vrabec
Details
weird scrolling (161.29 KB, image/png)
2014-07-14 10:42 UTC, Ondrej Vrabec
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2007-03-27 00:52:48 UTC
While the new diff UI looks quite nice, the scrolling logic is broken. I use F12
to jump through changes. Usually the right pane (new source) is scrolled
acceptably, but the left pane is often not scrolled to a reasonable position.
Sometimes the old block is even scrolled offscreen completely! Furthermore, when
the old and new blocks are not aligned, it is difficult to see the lines
connecting them, because the angle is too steep, and (especially in a densely
changed region like the imports section) the lines often overlap with other
change lines.

Please play with this a bit. I would prefer for both the old and new blocks to
always be centered in their respective panes. This would let my eyes rest on the
center of screen rather than having to look up and down repeatedly, and it would
ensure that the blocks were reasonably well aligned.
Comment 1 Maros Sandor 2007-03-27 15:36:40 UTC
I agree that when using Next/Previous Difference actions the selected difference
should be completely visible on both sides and aligned (if possible). I'll try
to tune the scrolling engine and if that fails then hardcoding it to treat
Next/Previous actions and Scrollbar differently. I'd appreciate if you give an
example (file revisions) when this behavior clearly manifests.
Comment 2 Jesse Glick 2007-03-27 18:21:30 UTC
I guess I don't have any particular example in mind; seems to happen
consistently for all sorts of changes I make. Next time I am doing a diff I
could attach some screenshots if that would be helpful. Probably changes which
involve adding or deleting significant blocks of code would show it more, since
then the line numbers are out of synch between the old and new buffers.
Comment 3 Jesse Glick 2007-03-27 18:23:20 UTC
Created attachment 40050 [details]
Screenshot showing misaligned diff blocks (still all on screen; no off-screen problems in this diff)
Comment 4 Jesse Glick 2007-03-31 02:29:54 UTC
Created attachment 40230 [details]
Screenshot showing even more misaligned diff
Comment 5 Maros Sandor 2007-10-01 14:32:31 UTC
Should be better now.

/shared/data/ccvs/repository/diff/src/org/netbeans/modules/diff/builtin/visualizer/editable/EditableDiffView.java,v  <--
 EditableDiffView.java
new revision: 1.24; previous revision: 1.23
Comment 6 Jesse Glick 2007-10-23 18:52:45 UTC
Created attachment 51522 [details]
Screenshot from dev build
Comment 7 Jesse Glick 2007-10-23 18:55:06 UTC
Doesn't seem any better; see recent screenshot. In this case the scrollbar is at the bottom despite the fact that the
old text is not completely visible. The only way to see what code is being replaced is to put the cursor in the left
editor pane and move it down with arrow keys. In such a case the active diff block is reset to be one further up; after
pressing Ctrl-. the end of the old file is hidden again. Generally, I am having the same kind of problems I was having
before, so I'm not sure what was fixed.
Comment 8 Jesse Glick 2007-10-23 21:06:57 UTC
I should also mention that Ctrl-. very frequently skips over one or more diff blocks, so that I will often press Ctrl-.
while in one file and find myself 2/3 of the way down into another file. (Ctrl-, seems to reliably go backward one diff
block at a time.) Overall, very irritating - I am never sure that I have actually seen all of the changes I made.
Comment 9 Alexander Kouznetsov 2008-01-22 17:51:59 UTC
Completely agree with jglick, got the same sort of misbehavior.
Comment 10 Maros Sandor 2008-03-05 13:28:31 UTC
I have made additional improvements during recent months, please verify.
Comment 11 Jesse Glick 2008-03-05 17:01:29 UTC
Created attachment 57822 [details]
Screenshot using current sources
Comment 12 Jesse Glick 2008-03-05 17:04:06 UTC
Perhaps better than it was, but still fails to scroll to show the entire modified region in many common cases. Just try
inserting or deleting half-screen-sized blocks of text randomly and browse diffs; scrolling is definitely less than optimal.
Comment 13 Jesse Glick 2011-06-06 16:24:47 UTC
Still quite bad, often unusable.
Comment 14 Jesse Glick 2011-10-19 15:10:12 UTC
Still bordering on unusable. Refactoring preview for Inspect & Transform, even something that does not add or remove lines - e.g. remove final modifier from static methods - will typically scroll to show old code on left side but show a completely different section of the new file on the right side.
Comment 15 Jesse Glick 2012-03-22 14:21:43 UTC
Same scrolling/centering problems persist. Also noticed that Ctrl-PERIOD often skips over some diff hunks; have to use Ctrl-COMMA several times to "back up" and hope that this will make the skipped hunk visible (but usually requires manual correction with scrollbars).
Comment 16 Ondrej Vrabec 2014-07-14 10:40:20 UTC
Created attachment 148026 [details]
fully working I&T preview window

(In reply to Jesse Glick from comment #11)
> Created attachment 57822 [details]
> Screenshot using current sources
Is this really a problem? Where should it scroll, to the end of the file? I personally don't mind the current behavior, i simply scroll the left panel down to see the whole deleted hunk.

(In reply to Jesse Glick from comment #12)
> Perhaps better than it was, but still fails to scroll to show the entire
> modified region in many common cases. Just try
> inserting or deleting half-screen-sized blocks of text randomly and browse
> diffs; scrolling is definitely less than optimal.
Please can you attach an up-to-date screenshot and describe on that example?

(In reply to Jesse Glick from comment #14)
> Still bordering on unusable. Refactoring preview for Inspect & Transform,
> even something that does not add or remove lines - e.g. remove final
> modifier from static methods - will typically scroll to show old code on
> left side but show a completely different section of the new file on the
> right side.
Can you reproduce? Seems to work fine for me in dev builds, see the attached screenshot...

(In reply to Jesse Glick from comment #15)
> Also noticed that Ctrl-PERIOD
> often skips over some diff hunks; have to use Ctrl-COMMA several times to
> "back up" and hope that this will make the skipped hunk visible (but usually
> requires manual correction with scrollbars).
I do not experience this. Even if the hunks are really close to each other, next/prev always steps just to the closest neighbor, never skips any hunk.
Comment 17 Ondrej Vrabec 2014-07-14 10:42:17 UTC
Created attachment 148027 [details]
weird scrolling

however i noticed a weird scrolling (not sure if the one you're talking about) - see the sc1.png - three active diff hunks. The screenshot shows that the middle hunk actually scrolls the left view to a higher line than the third one - which is obviously wrong and confusing. I'll try to do something with this at least.
Comment 18 Ondrej Vrabec 2014-07-15 14:44:03 UTC
i did what i could, i sincerely hope i didn't make it worse.

fix: http://hg.netbeans.org/core-main/rev/d9cca502f2dc
Comment 19 Ondrej Vrabec 2014-07-15 14:44:08 UTC
fix: http://hg.netbeans.org/core-main/rev/8b80ae8056b8
Comment 20 Quality Engineering 2014-07-19 10:18:40 UTC
Integrated into 'main-silver', will be available in build *201407190718* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/d9cca502f2dc
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #99059 - Bad scrolling behavior in diff window
Improve jumping between current differences when scrolling.

When scrolling the right panel differences are switched more smoothly
and should now take into account the direction of scrolling.
Comment 21 Jesse Glick 2014-09-03 04:22:24 UTC
Do not recall seeing unreasonable behavior recently in dev builds.