OpenlyOne / openly-rails

"GitHub" for Google Drive [inactive]
https://www.open.ly/
GNU General Public License v3.0
21 stars 1 forks source link

Contribution Review: Fix side-by-side diffs #281

Open FinnWoelm opened 5 years ago

FinnWoelm commented 5 years ago

When I review a contribution, I can see a list of file changes. Modified documents show me a diff preview and a button to view the diff side-by-side. This works fine when no commits have been made on master since the contribution was started.

If a commit has since been made on master, there are two issues:

  1. If the file was also modified in the contribution, the side-by-side diff does not match the diff preview. The diff preview is correct, but the side-by-side diff ONLY shows the modification that was made in the contribution itself. For example:

    v1 in master = v1 in contribution = 'HELLO'
    v2 in master = 'HELLO DEAR'
    v2 in contribution = 'HELLO FRIEND'
    diff preview (correct): 'HELLO -DEAR-+FRIEND+'
    side-by-side diff (incorrect): 'HELLO +FRIEND+'

    In other words, the side-by-side diff is relative to the contribution's origin commit rather than the master branch's current commit.

  2. If the file was not modified in the contribution, the diff preview shows correctly. But when attempting to view the side-by-side diff, it throws an error because the file has not been modified locally.

FinnWoelm commented 5 years ago

Temporary fix is to simply disable the diff previews in the review mode. That deescalates the issue from bug to enhancement. :+1:

See: #282