stable

Clone or download

Read-only

Handle properly side by side comments

Part of story #11667 - Finish pull request side-by-side-diff This patch allows the user to comment every line on the left diff. What is the expected behavior: - The lines of each sides have the same height when some inline comments are added. - To achieve this, placeholders are either: - created when there is no placeholder on the opposite side - adjusted (taller or smaller height) when a new-inline-comment is added or removed - minimized (height 0) when the two sides have the same number of comment widgets - The distinction is now made between code placeholders and comments placeholders. When a code placeholder is present on a side, it remains untouched to avoid the code to be unwantedly offset. A new placeholder (comment placeholder) is added instead. How to test: - add a comment on any line with no comment on it --> A placeholder is added to the opposite side. - click again to add a new comment on the same line than previously --> The opposite placeholder's height is adjusted (taller) - cancel the last inline comment --> The opposite placeholder's height is adjusted (smaller) - Add a comment on the oposite line --> The placeholder is minimized (height 0) Change-Id: Ifb23eae96e742f1e78cb2b6bbac379f2be5bb391

Modified Files

Name
M plugins/pullrequest/www/scripts/src/app/app.spec.js +5 −1 Go to diff View file
M plugins/pullrequest/www/scripts/src/app/file-diff/codemirror-helper-service.js +31 −13 Go to diff View file
R plugins/pullrequest/www/scripts/src/app/file-diff/diff-modes/side-by-side-widget-builder.js Go to diff View file
R plugins/pullrequest/www/scripts/src/app/file-diff/diff-modes/side-by-side-widget-builder.spec.js Go to diff View file
A plugins/pullrequest/www/scripts/src/app/file-diff/diff-modes/side-by-side-comment-placeholder-builder.js +266 −0 Go to diff View file
A plugins/pullrequest/www/scripts/src/app/file-diff/diff-modes/side-by-side-comment-placeholder-builder.spec.js +416 −0 Go to diff View file
M plugins/pullrequest/www/scripts/src/app/file-diff/diff-modes/side-by-side-diff-component.js +73 −70 Go to diff View file
A plugins/pullrequest/www/scripts/src/app/file-diff/diff-modes/side-by-side-line-height-equalizer.js +187 −0 Go to diff View file
A plugins/pullrequest/www/scripts/src/app/file-diff/diff-modes/side-by-side-line-height-equalizer.spec.js +211 −0 Go to diff View file
M plugins/pullrequest/www/scripts/src/app/file-diff/diff-modes/side-by-side-line-mapper.js +5 −5 Go to diff View file
M plugins/pullrequest/www/scripts/src/app/file-diff/diff-modes/side-by-side-line-mapper.spec.js +69 −28 Go to diff View file
M plugins/pullrequest/www/scripts/src/app/file-diff/diff-modes/side-by-side-lines-state.js +23 −1 Go to diff View file
M plugins/pullrequest/www/scripts/src/app/file-diff/diff-modes/side-by-side-lines-state.spec.js +114 −1 Go to diff View file
A plugins/pullrequest/www/scripts/src/app/file-diff/diff-modes/side-by-side-placeholder-positioner.js +36 −0 Go to diff View file
A plugins/pullrequest/www/scripts/src/app/file-diff/diff-modes/side-by-side-placeholder-positioner.spec.js +66 −0 Go to diff View file
A plugins/pullrequest/www/scripts/src/app/file-diff/diff-modes/side-by-side-widget-finder.js +29 −0 Go to diff View file
A plugins/pullrequest/www/scripts/src/app/file-diff/diff-modes/side-by-side-widget-finder.spec.js +60 −0 Go to diff View file
M plugins/pullrequest/www/scripts/src/app/file-diff/inline-comment-component.js +2 −0 Go to diff View file
M plugins/pullrequest/www/scripts/src/app/file-diff/new-inline-comment-component.js +2 −0 Go to diff View file
M plugins/pullrequest/www/themes/BurningParrot/css/includes/_file-diff.scss +1 −1 Go to diff View file