Add a Diff Viewer view for only the new file
Review Request #11226 — Created Oct. 16, 2020 and updated
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
Summary | ID |
---|---|
6ac04ab5ec2f58991b8a7a4587d3796c2175c243 |
- Change Summary:
-
Updated review request and added UI screenshots.
- Description:
-
~ Update Show New function to toggle.
~ 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 a show-new-only
class which show or hide the old view with+ the CSS display: 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's detach()
andappendTo()
function, vice versa. - Testing Done:
-
+ Testing Done:
+ + 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
- Commits:
-
Summary ID 7cc388330d712a50d985451edc64805db8599ec3 57a3ec9619b329fe9b28d72fb4209d92fc81c971 50b01e1fb6d3dd20240602823c2ded37844becc3 - Diff:
-
Revision 2 (+94)
- Added Files:
Checks run (2 succeeded)
- Change Summary:
-
Add JS unit tests.
- Testing Done:
-
~ Testing Done:
~ Testing Done:
+ Wrote onShowNewClicked
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
- Commits:
-
Summary ID 50b01e1fb6d3dd20240602823c2ded37844becc3 f414482469c0797f1e5b9475ea5fa84240c07bed
Checks run (2 succeeded)
- Change Summary:
-
Fix tests in
diffReviewableViewTests.es6.js
- Summary:
-
[WIP] Add a Diff Viewer view for only the new fileAdd a Diff Viewer view for only the new file
- Commits:
-
Summary ID f414482469c0797f1e5b9475ea5fa84240c07bed 6ac04ab5ec2f58991b8a7a4587d3796c2175c243