Toggling of the display of whitespace-only changes.

Review Request #899 — Created June 18, 2009 and submitted — Latest diff uploaded

Information

Review Board SVN (deprecated)

Reviewers

This patch adds a basic infrastructure to adding metadata to diff in a line/chunk/file level.
It also implements the detection of whitespace-only changes in diff, and adds a button to the diff viewer to toggle between whitespace visible and highlighted, or hidden and regular.

As a design decision I choose not to collapse a chunk that consisted only of whitespace changes, as it would create an inconsistency with chunks that mix both whitespace and regular changes.
For mixed chunks, the lines that contain only whitespace are set to the regular background, making the visualization better.
I also decided not to move the thin gray lines, that delimit a chunk, in cases of mixed chunks were the whitespace-only section was at the beginning or at the end, as I thought this could cause confusion to the user, to suddenly see a chunk shrink.
For whole chunks, on the other hand, I thought it would be better to hide everything, an so I did.

As all those decisions were pretty arbitrary, I'd really like some input about them.

I also decided to post this patch without unit test for it, as then we can review while I do the unit testing.
Ran all unit tests currenly available, without a breakage.
Applied patch in a production system, with no breakage of existing reviews.
Tested on IE 7, Chrome, Firefox 3.5 and 3.0 and Safari 4.0.

A Unit test for this is needed and will be provided in a following update.
    Loading...