Make draft comments in diffviewer and text based attachments resizable and movable
Review Request #7032 — Created March 9, 2015 and updated
Currently if a draft comment is made with the wrong range of lines, there is no way to correct it other than to delete it and make a new one. This fix aims to make the comment bubbles movable and resizable to update the line range.
Manual testing by dragging comment blocks.
Dragging:
Checked that the comment block can only be dragged if it is a new draft comment and not one made to an existing comment thread.Resizing:
Checked that begin row cannot be resized to rows after end row.
Checked that end row cannot be resized to rows before begin row.
Checked that begin/end row is resized to a valid row (not headers).
Checked that dragging can be done across compressed diff headers.
Checked that dragging cannot be done across different files.Moving:
Checked that line range stays the same when moving.
Checked that comment block can only be moved within visible lines.
Checked that line range cannot contain invalid rows.
Checked that dragging cannot be done across different files.Triggering of comment dialog:
Checked that the comment dialog is triggered on click of the comment block.
Checked that the comment dialog is triggered on click of a row number in the diffviewer.
Description | From | Last Updated |
---|---|---|
For readability, can you put a space around the > on each of these in this change? |
chipx86 | |
It's not immediately obvious to me how these are used. At the very least, there should be some documentation somewhere … |
chipx86 | |
Each function you introduce should have a doc comment. |
chipx86 | |
This all feels really, really iffy. Can you explain it more? Why can't this just listen in render()? |
chipx86 | |
Should use listenTo instead of on. |
chipx86 | |
Can we put this inline in the startDragging call below? |
chipx86 | |
Hmm, why not just compare against null? |
chipx86 | |
Same here about inlining. |
chipx86 | |
Blank line between these. |
chipx86 | |
Same here about inlining. |
chipx86 | |
Blank line between these. |
chipx86 | |
The second line's $row... should align with that on the first line. Also, no need to do typeof ... to … |
chipx86 | |
These need doc comments. |
chipx86 | |
Blank line between these. |
chipx86 | |
This is probably a good place for that documentation I mentioned. |
chipx86 | |
Best to pull out moveState into a local variable first, since it'll save on attribute lookups. |
chipx86 | |
Given that we're doing this, I'd like you to look into what jquery provides, since they have all this done … |
chipx86 | |
Only one var statement per function. |
chipx86 | |
A lot of this code looks the same as above. Can you factor it out into a mixin? |
chipx86 | |
Should be inline. Same with others. |
chipx86 | |
Should also compare against null directly. |
chipx86 | |
Blank line between these. Same below. |
chipx86 | |
Why this change? |
chipx86 | |
Not necessarily a "diff" comment bubble, since this works on plain text files as well. |
chipx86 | |
Missing a semicolon. |
chipx86 |
-
Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/diffviewer/models/diffCommentBlockModel.js reviewboard/static/rb/js/diffviewer/views/diffCommentBlockView.js reviewboard/static/rb/js/views/textCommentRowSelector.js reviewboard/static/rb/css/pages/diffviewer.less Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/diffviewer/models/diffCommentBlockModel.js reviewboard/static/rb/js/diffviewer/views/diffCommentBlockView.js reviewboard/static/rb/js/views/textCommentRowSelector.js reviewboard/static/rb/css/pages/diffviewer.less
- Change Summary:
-
Fix issue with the resizing not working on first load because $beginRow and $endRow are not initialized in the model.
- Commit:
-
02362039732496a6b287ffb4e9e1a1cae9df3ab78cb46128d2b557cd2533346e3e4495cd51eaf08f
-
Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/diffviewer/models/diffCommentBlockModel.js reviewboard/static/rb/js/diffviewer/views/diffCommentBlockView.js reviewboard/static/rb/js/views/textCommentRowSelector.js reviewboard/static/rb/css/pages/diffviewer.less Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/diffviewer/models/diffCommentBlockModel.js reviewboard/static/rb/js/diffviewer/views/diffCommentBlockView.js reviewboard/static/rb/js/views/textCommentRowSelector.js reviewboard/static/rb/css/pages/diffviewer.less
- Change Summary:
-
Implement moving of comment bubbles.
- Testing Done:
-
+ Manual testing by dragging comment blocks.
+ + Resizing:
+ Checked that begin row cannot be resized to rows after end row. + Checked that end row cannot be resized to rows before begin row. + Checked that begin/end row is resized to a valid row (not headers). + Checked that dragging can be done across compressed diff headers. + Checked that dragging cannot be done across different files. + + Moving:
+ Checked that line range stays the same when moving. + Checked that comment block can only be moved within visible lines. + Checked that line range cannot contain invalid rows. + Checked that dragging cannot be done across different files. - Commit:
-
8cb46128d2b557cd2533346e3e4495cd51eaf08f71d84129307056a5c983da1874119dd441bd385f
- Diff:
-
Revision 4 (+388 -19)
-
Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/diffviewer/models/diffCommentBlockModel.js reviewboard/static/rb/js/diffviewer/views/diffCommentBlockView.js reviewboard/static/rb/js/views/textCommentRowSelector.js reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/css/pages/diffviewer.less Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/diffviewer/models/diffCommentBlockModel.js reviewboard/static/rb/js/diffviewer/views/diffCommentBlockView.js reviewboard/static/rb/js/views/textCommentRowSelector.js reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/css/pages/diffviewer.less
- Summary:
-
[WIP] Make draft comments in diffviewer resizable and movable[WIP] Make draft comments in diffviewer and text based attachments resizable and movable
- Commit:
-
71d84129307056a5c983da1874119dd441bd385f76589bd80e15a23686493adf0d0b5a79316fbee4
- Diff:
-
Revision 5 (+524 -21)
-
Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/views/textBasedCommentBlockView.js reviewboard/static/rb/css/pages/diffviewer.less reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/models/textBasedCommentBlockModel.js reviewboard/static/rb/js/diffviewer/models/diffCommentBlockModel.js reviewboard/static/rb/js/views/textBasedReviewableView.js reviewboard/static/rb/js/diffviewer/views/diffCommentBlockView.js reviewboard/static/rb/js/views/textCommentRowSelector.js Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/views/textBasedCommentBlockView.js reviewboard/static/rb/css/pages/diffviewer.less reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/models/textBasedCommentBlockModel.js reviewboard/static/rb/js/diffviewer/models/diffCommentBlockModel.js reviewboard/static/rb/js/views/textBasedReviewableView.js reviewboard/static/rb/js/diffviewer/views/diffCommentBlockView.js reviewboard/static/rb/js/views/textCommentRowSelector.js
- Summary:
-
[WIP] Make draft comments in diffviewer and text based attachments resizable and movableMake draft comments in diffviewer and text based attachments resizable and movable
- Testing Done:
-
Manual testing by dragging comment blocks.
+ Dragging:
+ Checked that the comment block can only be dragged if it is a new draft comment and not one made to an existing comment thread. + Resizing:
Checked that begin row cannot be resized to rows after end row. Checked that end row cannot be resized to rows before begin row. Checked that begin/end row is resized to a valid row (not headers). Checked that dragging can be done across compressed diff headers. Checked that dragging cannot be done across different files. Moving:
Checked that line range stays the same when moving. Checked that comment block can only be moved within visible lines. Checked that line range cannot contain invalid rows. Checked that dragging cannot be done across different files. + + Triggering of comment dialog:
+ Checked that the comment dialog is triggered on click of the comment block. + Checked that the comment dialog is triggered on click of a row number in the diffviewer. - Commit:
-
76589bd80e15a23686493adf0d0b5a79316fbee47e2c958d8a053d3edc18916c771736371eb07a91
- Diff:
-
Revision 6 (+529 -23)
- Added Files:
-
Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/views/textBasedCommentBlockView.js reviewboard/static/rb/css/pages/diffviewer.less reviewboard/static/rb/css/pages/search.less reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/models/textBasedCommentBlockModel.js reviewboard/static/rb/js/diffviewer/models/diffCommentBlockModel.js reviewboard/static/rb/js/views/textBasedReviewableView.js reviewboard/static/rb/js/diffviewer/views/diffCommentBlockView.js reviewboard/static/rb/js/views/textCommentRowSelector.js Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/views/textBasedCommentBlockView.js reviewboard/static/rb/css/pages/diffviewer.less reviewboard/static/rb/css/pages/search.less reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/models/textBasedCommentBlockModel.js reviewboard/static/rb/js/diffviewer/models/diffCommentBlockModel.js reviewboard/static/rb/js/views/textBasedReviewableView.js reviewboard/static/rb/js/diffviewer/views/diffCommentBlockView.js reviewboard/static/rb/js/views/textCommentRowSelector.js
- Change Summary:
-
Previously, the commenting in the text-based file attachments were broken and a workaround was used to complete the project. The issue is resolved now.
This change fixes the issue with comment blocks being placed at the wrong rows due to the change in row indexes.
- Commit:
-
7e2c958d8a053d3edc18916c771736371eb07a913ce7b8ab9dd0d7c489bbf0016ec199ab2009ad46
- Diff:
-
Revision 7 (+530 -25)
-
Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/views/textBasedCommentBlockView.js reviewboard/static/rb/css/pages/diffviewer.less reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/models/textBasedCommentBlockModel.js reviewboard/static/rb/js/diffviewer/models/diffCommentBlockModel.js reviewboard/static/rb/js/views/textBasedReviewableView.js reviewboard/static/rb/js/diffviewer/views/diffCommentBlockView.js reviewboard/static/rb/js/views/textCommentRowSelector.js Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/views/textBasedCommentBlockView.js reviewboard/static/rb/css/pages/diffviewer.less reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/models/textBasedCommentBlockModel.js reviewboard/static/rb/js/diffviewer/models/diffCommentBlockModel.js reviewboard/static/rb/js/views/textBasedReviewableView.js reviewboard/static/rb/js/diffviewer/views/diffCommentBlockView.js reviewboard/static/rb/js/views/textCommentRowSelector.js
-
-
-
It's not immediately obvious to me how these are used. At the very least, there should be some documentation somewhere about these. However, I wonder if you could instead use the jquery-ui stuff for move/resize support.
-
-
This all feels really, really iffy. Can you explain it more?
Why can't this just listen in
render()
? -
-
-
-
-
-
-
-
The second line's
$row...
should align with that on the first line.Also, no need to do
typeof ...
to compare againstundefined
. Just compare againstundefined
. -
-
-
-
-
Given that we're doing this, I'd like you to look into what jquery provides, since they have all this done in a way that works cross-browser and on mobile.
-
-
-
-
-
-
-
-
- Commit:
-
3ce7b8ab9dd0d7c489bbf0016ec199ab2009ad46dde5ad8278ba8441fb6bb8ae42a2e43f05559a81
- Diff:
-
Revision 8 (+489 -21)
-
Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/views/textBasedCommentBlockView.js reviewboard/static/rb/css/pages/diffviewer.less reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/models/textBasedCommentBlockModel.js reviewboard/static/rb/js/diffviewer/models/diffCommentBlockModel.js reviewboard/static/rb/js/views/textBasedReviewableView.js reviewboard/static/rb/js/views/textCommentRowSelector.js Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/views/textBasedCommentBlockView.js reviewboard/static/rb/css/pages/diffviewer.less reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/models/textBasedCommentBlockModel.js reviewboard/static/rb/js/diffviewer/models/diffCommentBlockModel.js reviewboard/static/rb/js/views/textBasedReviewableView.js reviewboard/static/rb/js/views/textCommentRowSelector.js
- Change Summary:
-
- Fix
undefined
comparison - Update docs to use imperative mood
- Fix
- Commit:
-
dde5ad8278ba8441fb6bb8ae42a2e43f05559a812f1b7959a2a8a53ad946fe4ca03d3841e723479d
- Diff:
-
Revision 9 (+489 -21)
-
Tool: PEP8 Style Checker Ignored Files: reviewboard/static/rb/js/views/textBasedCommentBlockView.js reviewboard/static/rb/css/pages/diffviewer.less reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/models/textBasedCommentBlockModel.js reviewboard/static/rb/js/diffviewer/models/diffCommentBlockModel.js reviewboard/static/rb/js/views/textBasedReviewableView.js reviewboard/static/rb/js/views/textCommentRowSelector.js Tool: Pyflakes Ignored Files: reviewboard/static/rb/js/views/textBasedCommentBlockView.js reviewboard/static/rb/css/pages/diffviewer.less reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/models/textBasedCommentBlockModel.js reviewboard/static/rb/js/diffviewer/models/diffCommentBlockModel.js reviewboard/static/rb/js/views/textBasedReviewableView.js reviewboard/static/rb/js/views/textCommentRowSelector.js