Add a Diff Viewer view for only the new file
Review Request #11226 — Created Oct. 16, 2020 and updated — Latest diff uploaded
The current diff viewer shows both the old and new view for every diff.
Sometimes, we want to just look at the new view and not the whole diff with
the existing code. Adding the feature to hide the old view and only show the
new view will allow users to have an uncluttered view.We added a
[Show/Hide]
toggle to therevision-row
on the diff viewer. This
button will toggle between showing both views and only showing the new view.
The button toggles ashow-new-only
class which show or hide the old view with
the CSSdisplay: none
property. If the line contain comments, the comment
flags are detached from the old view's column and appended to the new view's
column using jQuery'sdetach()
andappendTo()
function, vice versa.
Testing Done:
WroteonShowNewClicked
andOn show new only
in
diffReviewableViewTests.es6.js
.Tested following behaviour in browser:
- Added comments before toggling, able to view in both views
- Added comments after toggling, able to view in both views