Diff fragments in review comments can now be expanded and collapsed.
Review Request #6380 — Created Sept. 28, 2014 and submitted
Diff fragments can now be expanded in three ways:
- expanded above or below the current context by a fixed number of
lines (20);
- expanded up to the previous header (i.e., method definition); or
- expanded completely above or below.
After a diff fragment is expanded in one direction, it can be
collapsed via a floating button that follows the viewport. If there is
still more of the diff to be expanded, it may be expanded again.The
comment_diff_fragments
view now takes an optional URL query
parameter,lines-of-context
, which indicates the number of lines
above and below that should be included in the fragment. Likewise,
thebuild_diff_comment_fragments
now takes alines_of_context
parameter and uses that to calculate thefirst_line
and
num_lines
parameters forget_file_chunks_in_range
.The activity indicator functionality in
RB.apiCall
(in
apiUtils.js
) has been refactored into another method in the same
file:RB.setActivityIndicator
. Asynchronous activity that does not
involve API calls can use this method to enable or disable the
activity indicator.Add the
expand_fragment_link
andexpand_fragment_header_link
Django template tags. These tags create expansion links for use in
diff fragments. These functions use a new template:
reviews/expand_link.html
.Added Brian Cherne's hoverIntent jQuery plugin to the 3rd party static
bundles.The
DiffFragmentQueueView
(diffFragmentQueueView.js
) now handles
the expansion and contraction of diff fragments. This view monitors
for clicks on expansion and contraction buttons and dynamically adds
a script tag which will replace the contents of the appropriate diff
fragment with the same fragment, but with expanded (or contracted)
context. The activity indicator is turned on when a diff fragment is
requested and off when the requested fragment has been received.The expansion links for diff fragments are only shown when the mouse
is hovering over the comment container for that fragment. Once the
mouse moves off the comment container, the expansion links will become
hidden. The hoverIntent jQuery plugin ensures that clumsy mouse
movements will not result in the controls toggling on and off
repeatedly.The
ReviewBoxListView
now constructs theDiffFragmentQueueView
with an element (#container
) on which it should listen for events.The diff fragment template (
diff_comment_fragment.html
) has been
modified to only show 2 columns (instead of 4) when the file in the
diff is a new file. This change makes the diff comment fragment viewer
look more similar to the diffviewer.When a diff fragment is expanded to have context, the lines that have
been flagged for review will be surrounded above and below by a gray
border.
Unit tests pass.
Verified the following in Chrome and Firefox:
- Expansion links are only visible if the diff fragment can be
expanded in that direction. - When a review request is loaded, the expansion controls are hidden.
- Upon hovering over a diff fragment, the expansion controls expand.
- Upon stopping hovering over a diff fragment, this is a delay before
the expansion controls become hidden again. - Upon stopping hovering over a diff fragment, if the mouse hovers
over the diff fragment again before the delay expires, the
expansion controls do not become hidden. - Clicking on the "expand by 20" lines buttons expands the context by
20 lines in the appropriate direction. - Click on the expand to header button expands to that header.
- Expanding multiple times expands upon the current context.
- The collapse button smoothly follows scrolling, staying in the
centre of the screen (if the fragment takes up the whole view) or
the centre of the fragment (if the fragment does not take up the
whole view). - Clicking the collapse button makes all context hidden and removes
the collapse button. - The lines originally flagged for review have a border around them.
- When the file is a new file, only one line number column is
visible. - If upon contracting a diff fragment the mouse is no longer above
the fragment for a period, the diff fragment's controls will become
hidden.
Also verified the following:
- An invalid
lines_of_context
query parameter is interpreted as
0 lines of context above and below - If too many
lines_of_context
query parameter values are passed
(e.g.,0,0,0,0
), it is interpreted as if only the first two
values were present. - If the
lines_of_context
query parameter is passed with no value,
it is interpreted as0,0
- If the
lines_of_context
query parameter is passed with only one
value, it is interpreted as both the above and below context.
Description | From | Last Updated |
---|---|---|
I think the thickness of the border is a little much, was 1px not visible enough? |
SM smacleod | |
list comprehension redefines 'file_attachment' from line 587 |
reviewbot | |
list comprehension redefines 'file_attachment' from line 588 |
reviewbot | |
list comprehension redefines 'file_attachment' from line 588 |
reviewbot | |
Col: 24 E231 missing whitespace after ',' |
reviewbot | |
list comprehension redefines 'file_attachment' from line 588 |
reviewbot | |
list comprehension redefines 'file_attachment' from line 588 |
reviewbot | |
list comprehension redefines 'file_attachment' from line 589 |
reviewbot | |
list comprehension redefines 'file_attachment' from line 590 |
reviewbot | |
'mark_safe' imported but unused |
reviewbot | |
'render_markdown' imported but unused |
reviewbot | |
Col: 25 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 52 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 52 E128 continuation line under-indented for visual indent |
reviewbot | |
Add a trailing comma. |
david | |
If you call mark_safe() here, you can avoid the |safe in the template. This should probably also be named something … |
david | |
Dictionary entries in python should always end in a trailing comma. |
david | |
Add a trailing comma. |
david | |
This should probably be wrapped in a try/except in order to avoid 500s if a bogus query string is passed. |
david | |
Should have a trailing comma. |
david | |
Can we add a non-minified version of this instead? When we compile it we'll minify, but having the original source … |
david | |
Where do these numbers come from? |
david | |
Can you name this $activityIndicator? |
david | |
Single-line comments (other than those used as method comments) should use // |
david | |
All blocks should use {} |
david | |
We'd typically indent this as: $chunks = $button .closest('.sidebyside') .children('tbody') .not('.diff-header'); |
david | |
Single-line comments should use //. Here and below. |
david | |
These should be on the same line. |
david | |
These should be on the same line. |
david | |
setActivityIndicator checks RB.ajaxOptions.enableIndicator so you shouldn't need the conditional. |
david | |
Should have a period at the end. |
david | |
{} |
david | |
typo: finishd |
david | |
You shouldn't need the conditional here because setActivityIndicator checks RB.ajaxOptions.enableIndicator. |
david | |
Variable definitions should happen at the top of the method. |
david | |
Multi-line comments should be formatted as: /* * text */ |
david | |
Same here re: formatting. Also should end in a period. |
david | |
Can you revert this change? |
david | |
Just to be safe, how about we escape the 'text' field here? You can use format_html to create HTML and … |
david | |
Generally, in Python it's best to avoid lists in default arguments because any modification to that variable can end up … |
david | |
What happens if this URL is loaded with lines_of_context= ? |
david | |
This should use an === comparison. |
david | |
Should have a blank /* on the first line of the comment. |
david | |
You don't need to pass $expanded in to this--it will be available in the closure. |
david | |
Variable definitions should all be at the top of their method. |
david | |
Blocks should always use {} |
david | |
Col: 33 E225 missing whitespace around operator |
reviewbot | |
You don't need to call escape(text) because format_html will escape any arguments that aren't already safe. |
david | |
Can you add an "else: raise ValueError" at the end of this? |
david |
- Change Summary:
-
Add extra line to comply with PEP8.
- Commit:
-
492bf95cce10542cea668b78364205e0082bda62da6918e7ab47e108bd0c77d9ec28e058c628fbac
- Diff:
-
Revision 2 (+15 -4)
- Change Summary:
-
Remove extra blank line after a comment.
- Commit:
-
da6918e7ab47e108bd0c77d9ec28e058c628fbac7cf6754076aa19e5fc0814202d44e452332bc489
- Diff:
-
Revision 3 (+14 -4)
- Change Summary:
-
Change
before_lines
andafter_lines
to belines_of_context
(for arguments)
andlines-of-context
(for query parameter - Description:
-
~ The
comment_diff_fragments
view now takes two optional URL get~ parameters: ~ - before_lines
, which indicates the number of lines before the~ The
comment_diff_fragments
view now takes an optional URL query~ parameter, lines-of-context
, which indicates the number of lines~ above and below that should be included in the fragment. - start_line
that should be returned in the fragment; and- - after_lines
, which indicates the number of lines after- start_line
+num_lines
should be returned in the fragment.- It passes these arguments to build_diff_comment_fragments
, which now- takes two arguments (named the same). ~ The
build_diff_comment_fragments
function now calculates, based on~ the comment's first_line
andnum_lines
fields and the~ before_lines
andafter_lines
arguments new values for the first~ line and number of lines to pass to get_file_chunks_in_range
.~ The
build_diff_comment_fragments
function now takes a~ lines_of_context
and uses that to calculate the~ first_line
andnum_lines
parameters for~ get_file_chunks_in_range
- Testing Done:
-
Modifying
static/rb/js/views/diffFragmentQueueView.js
to add~ before_lines
andafter_lines
query parameters makes the diff~ lines-of-cotext
query parameter makes the difffragments have the appropriate surrounding context (when available). - Commit:
-
7cf6754076aa19e5fc0814202d44e452332bc48936bab9040e4d5645ae7d655c6f0c969478738058
- Diff:
-
Revision 4 (+19 -4)
- Change Summary:
-
fix space after comma
- Commit:
-
36bab9040e4d5645ae7d655c6f0c96947873805818b5c00351700fc89b98ab67a73b1a6ef261855f
- Diff:
-
Revision 5 (+19 -4)
- Change Summary:
-
Add client side functionality for diff expansion.
- Summary:
-
[WIP] Allow the comment diff fragment view to return context lines.[WIP] Allow expansion of comment diff fragments in review requests.
- Description:
-
+ Comment diff fragments can now be expanded by a fixed number of lines
+ either above or below the current amount of context. Add links to the + diff_comment_fragment.html
template to facilitiate this+ functionality. After expanding once, the fragment may be further + expanded. + + The
DiffFragmentQueueView
now has an_onExpandButtonClicked
event+ which is fired when an expansion button is clicked. + + Add
_expandDiffFragment
toDiffFragmentQueueView
to expand add a+ script tag to the current page that will update the diff fragment with + the new context. + + The
ReviewBoxListView
now initializes theDiffFragmentQueueView
+ with an element ( #container
) to listen for events on.+ The
comment_diff_fragments
view now takes an optional URL queryparameter, lines-of-context
, which indicates the number of linesabove and below that should be included in the fragment. The
build_diff_comment_fragments
function now takes alines_of_context
and uses that to calculate thefirst_line
andnum_lines
parameters forget_file_chunks_in_range
- Testing Done:
-
Modifying
static/rb/js/views/diffFragmentQueueView.js
to addlines-of-cotext
query parameter makes the difffragments have the appropriate surrounding context (when available). + + Tested the expansion links on local devserver.
- Commit:
-
18b5c00351700fc89b98ab67a73b1a6ef261855f6dd0f02671bf96eb4bec14dbb2406f705bbe8461
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py Ignored Files: reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/views/diffFragmentQueueView.js Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py Ignored Files: reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/views/diffFragmentQueueView.js
-
- Change Summary:
-
Formatting
- Commit:
-
6dd0f02671bf96eb4bec14dbb2406f705bbe8461f92eea355f134820a852e8caa208fcf358f29271
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py Ignored Files: reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/views/diffFragmentQueueView.js Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py Ignored Files: reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/views/diffFragmentQueueView.js
-
- Change Summary:
-
Add activity indicator interaction.
- Description:
-
Comment diff fragments can now be expanded by a fixed number of lines
either above or below the current amount of context. Add links to the diff_comment_fragment.html
template to facilitiate thisfunctionality. After expanding once, the fragment may be further expanded. The
DiffFragmentQueueView
now has an_onExpandButtonClicked
eventwhich is fired when an expansion button is clicked. Add
_expandDiffFragment
toDiffFragmentQueueView
to expand add ascript tag to the current page that will update the diff fragment with the new context. The
ReviewBoxListView
now initializes theDiffFragmentQueueView
with an element ( #container
) to listen for events on.The
comment_diff_fragments
view now takes an optional URL queryparameter, lines-of-context
, which indicates the number of lines~ above and below that should be included in the fragment. ~ above and below that should be included in the fragment. It also + takes an optional activity
parameter that specifies if the activity+ indicator should be turned on (indicating asynchronous activity). The
build_diff_comment_fragments
function now takes alines_of_context
and uses that to calculate thefirst_line
andnum_lines
parameters forget_file_chunks_in_range
+ + The activity indicator functionality in
apiUtils.js
has been+ refactored into another method, RB.setActivityIndicator
so that+ non-API calls can set the activity indicator status when they make + asynchronous requests. - Commit:
-
f92eea355f134820a852e8caa208fcf358f292717341e9235ac66eff19d962a86c8922f9a1cd1a77
- Diff:
-
Revision 8 (+99 -20)
- Change Summary:
-
Use the lines-of-context parameter to determine when we should add JS to turn off the activity indicator
- Commit:
-
7341e9235ac66eff19d962a86c8922f9a1cd1a776c44dd0b957da8a2e2d235eb8569558c5957b096
- Diff:
-
Revision 9 (+97 -20)
- Change Summary:
-
Code cleanup -- better JS and Python. Provide semantic conditions to the Django template in build_diff_comment_fragment. Improve LAF of expansion links.
- Description:
-
Comment diff fragments can now be expanded by a fixed number of lines
either above or below the current amount of context. Add links to the diff_comment_fragment.html
template to facilitiate thisfunctionality. After expanding once, the fragment may be further expanded. The
DiffFragmentQueueView
now has an_onExpandButtonClicked
eventwhich is fired when an expansion button is clicked. Add
_expandDiffFragment
toDiffFragmentQueueView
to expand add ascript tag to the current page that will update the diff fragment with the new context. The
ReviewBoxListView
now initializes theDiffFragmentQueueView
with an element ( #container
) to listen for events on.The
comment_diff_fragments
view now takes an optional URL queryparameter, lines-of-context
, which indicates the number of linesabove and below that should be included in the fragment. It also takes an optional activity
parameter that specifies if the activityindicator should be turned on (indicating asynchronous activity). The
build_diff_comment_fragments
function now takes alines_of_context
and uses that to calculate thefirst_line
andnum_lines
parameters forget_file_chunks_in_range
The activity indicator functionality in
apiUtils.js
has beenrefactored into another method, RB.setActivityIndicator
so thatnon-API calls can set the activity indicator status when they make asynchronous requests. + + Add the Django template tag
expand_fragment_link
, which functions+ similarily to the expand_diff_link
tag. - Commit:
-
6c44dd0b957da8a2e2d235eb8569558c5957b09639005119a586737d33ddbb7f5db4f84accb9fe05
- Diff:
-
Revision 10 (+174 -27)
- Change Summary:
-
Almost everything works. Just need to fix collapsable buttons.
- Description:
-
Comment diff fragments can now be expanded by a fixed number of lines
~ either above or below the current amount of context. Add links to the ~ diff_comment_fragment.html
template to facilitiate this~ functionality. After expanding once, the fragment may be further ~ expanded. ~ either above or below the current amount of context or to the next ~ previous header (i.e., method definition). After expanding once, the ~ fragment may be further expanded (if more of the file is available) or ~ collapsed. The
DiffFragmentQueueView
now has an_onExpandButtonClicked
eventwhich is fired when an expansion button is clicked. Add
_expandDiffFragment
toDiffFragmentQueueView
to expand add ascript tag to the current page that will update the diff fragment with the new context. The
ReviewBoxListView
now initializes theDiffFragmentQueueView
with an element ( #container
) to listen for events on.The
comment_diff_fragments
view now takes an optional URL queryparameter, lines-of-context
, which indicates the number of linesabove and below that should be included in the fragment. It also takes an optional activity
parameter that specifies if the activityindicator should be turned on (indicating asynchronous activity). The
build_diff_comment_fragments
function now takes alines_of_context
and uses that to calculate thefirst_line
andnum_lines
parameters forget_file_chunks_in_range
The activity indicator functionality in
apiUtils.js
has beenrefactored into another method, RB.setActivityIndicator
so thatnon-API calls can set the activity indicator status when they make asynchronous requests. ~ Add the Django template tag
expand_fragment_link
, which functions~ similarily to the expand_diff_link
tag.~ Add the
exand_fragment_link
andexpand_fragment_header_link
Django~ template tags. expand_fragment_link
functions similarily to the+ expand_diff_link
tag, as doesexpand_fragment_header_link
, except+ expand_fragment_header_link
is exclusively for expanding the context+ to fragment headers. + + Refactored
DiffReviewableView._updateCollapsePos
into a separate+ mixin: CollapseButtonManagerMixin
(in+ rb/js/utils/collapseButtonManager.js
). Add this path to the JS+ bundle for the reviews views. - Commit:
-
39005119a586737d33ddbb7f5db4f84accb9fe054cb318b8a8e231c443836864591e93931998cd34
- Diff:
-
Revision 11 (+410 -143)
- Change Summary:
-
Collapsible diff segments. Move out of WIP status. Add screenshots.
- Summary:
-
[WIP] Allow expansion of comment diff fragments in review requests.Diff fragments in review comments can now be expanded and collapsed.
- Description:
-
~ Comment diff fragments can now be expanded by a fixed number of lines
~ either above or below the current amount of context or to the next ~ previous header (i.e., method definition). After expanding once, the ~ fragment may be further expanded (if more of the file is available) or ~ collapsed. ~ ~ The
DiffFragmentQueueView
now has an_onExpandButtonClicked
event~ which is fired when an expansion button is clicked. ~ Diff fragments can now be expanded in three ways:
~ - expanded above or below the current context by a fixed number of ~ lines (20); ~ - expanded up to the previous header (i.e., method definition); or ~ - expanded completely above or below. ~ After a diff fragment is expanded in one direction, it can be ~ collapsed in that direction. If there is still room for expansion, ~ it may be expanded again. - - Add
_expandDiffFragment
toDiffFragmentQueueView
to expand add a- script tag to the current page that will update the diff fragment with - the new context. - - The
ReviewBoxListView
now initializes theDiffFragmentQueueView
- with an element ( #container
) to listen for events on.The
comment_diff_fragments
view now takes an optional URL queryparameter, lines-of-context
, which indicates the number of lines~ above and below that should be included in the fragment. It also ~ takes an optional activity
parameter that specifies if the activity~ indicator should be turned on (indicating asynchronous activity). ~ above and below that should be included in the fragment. Likewise, ~ the build_diff_comment_fragments
now takes alines_of_context
~ parameter and uses that to calculate the first_line
and+ num_lines
parameters forget_file_chunks_in_range
.~ The
build_diff_comment_fragments
function now takes a~ lines_of_context
and uses that to calculate the~ first_line
andnum_lines
parameters for~ get_file_chunks_in_range
~ The activity indicator functionality in
RB.apiCall
(in~ apiUtils.js
) has been refactored into another method in the same~ file: RB.setActivityIndicator
. Asynchronous activity that does not~ involve API calls ~ The activity indicator functionality in
apiUtils.js
has been~ refactored into another method, RB.setActivityIndicator
so that~ non-API calls can set the activity indicator status when they make ~ asynchronous requests. ~ Add the
expand_fragment_link
,expand_fragment_header_link
and~ collapse_fragment_link
Django template tags. These tags create~ expansion and contraction links for use in diff fragments. These ~ functions use a new template: reviews/expand_link.html
.~ Add the
exand_fragment_link
andexpand_fragment_header_link
Django~ template tags. expand_fragment_link
functions similarily to the~ expand_diff_link
tag, as doesexpand_fragment_header_link
, except~ expand_fragment_header_link
is exclusively for expanding the context~ to fragment headers. ~ The
DiffFragmentQueueView
(diffFragmentQueueView.js
) now handles~ the expansion and contraction of diff fragments. This view monitors ~ for clicks on expansion and contraction buttons and dynamically adds ~ a script tag which will replace the contents of the appropriate diff ~ fragment with the same fragment, but with expanded (or contracted) + context. The activity indicator is turned on when a diff fragment is + requested and off when the requested fragment has been received. ~ Refactored
DiffReviewableView._updateCollapsePos
into a separate~ mixin: CollapseButtonManagerMixin
(in~ The
ReviewBoxListView
now constructs theDiffFragmentQueueView
~ with an element ( #container
) on which it should listen for events.- rb/js/utils/collapseButtonManager.js
). Add this path to the JS- bundle for the reviews views. - Testing Done:
-
~ Modifying
static/rb/js/views/diffFragmentQueueView.js
to add~ Unit tests pass.
- lines-of-cotext
query parameter makes the diff- fragments have the appropriate surrounding context (when available). ~ Tested the expansion links on local devserver.
~ Expansion and contraction links work correctly on local dev server.
- Commit:
-
4cb318b8a8e231c443836864591e93931998cd3484e553c5ab42ad9d3e0e6dd7be2ba16bab13d49c
- Diff:
-
Revision 12 (+293 -31)
- Added Files:
- Change Summary:
-
Base off latest master.
- Commit:
-
84e553c5ab42ad9d3e0e6dd7be2ba16bab13d49cd0c3337f4d0b7103a371981e2e5298522331e120
- Diff:
-
Revision 13 (+290 -36)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/templates/diffviewer/expand_link.html reviewboard/static/rb/js/views/diffFragmentQueueView.js Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/templates/diffviewer/expand_link.html reviewboard/static/rb/js/views/diffFragmentQueueView.js
-
-
-
-
-
- Change Summary:
-
Update to fix formatting errors. Move back into WIP status.
- Summary:
-
Diff fragments in review comments can now be expanded and collapsed.[WIP] Diff fragments in review comments can now be expanded and collapsed.
- Commit:
-
d0c3337f4d0b7103a371981e2e5298522331e1208b4faef7ecaeea4df84f296d74aa64669bf93610
- Diff:
-
Revision 14 (+289 -37)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/templates/diffviewer/expand_link.html reviewboard/static/rb/js/views/diffFragmentQueueView.js Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/templates/diffviewer/expand_link.html reviewboard/static/rb/js/views/diffFragmentQueueView.js
- Change Summary:
-
Improve UI.
- Description:
-
Diff fragments can now be expanded in three ways:
- expanded above or below the current context by a fixed number of lines (20); - expanded up to the previous header (i.e., method definition); or - expanded completely above or below. After a diff fragment is expanded in one direction, it can be collapsed in that direction. If there is still room for expansion, it may be expanded again. The
comment_diff_fragments
view now takes an optional URL queryparameter, lines-of-context
, which indicates the number of linesabove and below that should be included in the fragment. Likewise, the build_diff_comment_fragments
now takes alines_of_context
parameter and uses that to calculate the first_line
andnum_lines
parameters forget_file_chunks_in_range
.The activity indicator functionality in
RB.apiCall
(inapiUtils.js
) has been refactored into another method in the samefile: RB.setActivityIndicator
. Asynchronous activity that does notinvolve API calls ~ Add the
expand_fragment_link
,expand_fragment_header_link
and~ collapse_fragment_link
Django template tags. These tags create~ expansion and contraction links for use in diff fragments. These ~ functions use a new template: reviews/expand_link.html
.~ Add the
expand_fragment_link
andexpand_fragment_header_link
~ Django template tags. These tags create expansion links for use in ~ diff fragments. These functions use a new template: ~ reviews/expand_link.html
.+ + Added Brian Cherne's hoverIntent jQuery plugin to the 3rd party static
+ bundles. The
DiffFragmentQueueView
(diffFragmentQueueView.js
) now handlesthe expansion and contraction of diff fragments. This view monitors for clicks on expansion and contraction buttons and dynamically adds a script tag which will replace the contents of the appropriate diff fragment with the same fragment, but with expanded (or contracted) context. The activity indicator is turned on when a diff fragment is requested and off when the requested fragment has been received. + The expansion links for diff fragments are only shown when the mouse
+ is hovering over the comment container for that fragment. Once the + mouse moves off the comment container, the expansion links will become + hidden. The hoverIntent jQuery plugin ensures that clumsy mouse + movements will not result in the controls toggling on and off + repeatedly. + + Refactor
DiffReviewableView._updateCollapseButtonPos
into a mixin:+ CollapseButtonManagerMixin
. The updated method takes a selector to+ use as to find the parent element, instead of the hardcoded tbody
+ selector. This mixin is used in DiffFragmentQueueView
in addition to+ DiffReviewableView
; it has been added to the static bundles.+ The
ReviewBoxListView
now constructs theDiffFragmentQueueView
with an element ( #container
) on which it should listen for events.+ + The diff fragment template (
diff_comment_fragment.html
) has been+ modified to only show 2 columns (instead of 4) when the file in the + diff is a new file. This change makes the diff comment fragment viewer + look more similar to the diffviewer. + + When a diff fragment is expanded to have context, the lines that have
+ been flagged for review will be surrounded above and below by a black + border. - Testing Done:
-
Unit tests pass.
~ Expansion and contraction links work correctly on local dev server.
~ Tested expansion and contraction in both Firefox and Chrome.
- Commit:
-
8b4faef7ecaeea4df84f296d74aa64669bf9361086a7ba1496e4eea769ef9db4a7eaae5f4f782b4b
- Diff:
-
Revision 15 (+520 -151)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/css/pages/diffviewer.less reviewboard/templates/reviews/boxes/review.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/utils/collapseButtonManager.js reviewboard/static/rb/css/pages/reviews.less reviewboard/static/lib/js/jquery.hoverIntent.min.js reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/templates/diffviewer/expand_link.html reviewboard/static/rb/js/views/diffFragmentQueueView.js Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/css/pages/diffviewer.less reviewboard/templates/reviews/boxes/review.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/utils/collapseButtonManager.js reviewboard/static/rb/css/pages/reviews.less reviewboard/static/lib/js/jquery.hoverIntent.min.js reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/templates/diffviewer/expand_link.html reviewboard/static/rb/js/views/diffFragmentQueueView.js
- Change Summary:
-
Update indentation in apiUtils.js
- Commit:
-
86a7ba1496e4eea769ef9db4a7eaae5f4f782b4b07f1d2e9ac5e0f7dc3a3834b81d44e915bf7e511
- Diff:
-
Revision 16 (+520 -151)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/css/pages/diffviewer.less reviewboard/templates/reviews/boxes/review.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/utils/collapseButtonManager.js reviewboard/static/rb/css/pages/reviews.less reviewboard/static/lib/js/jquery.hoverIntent.min.js reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/templates/diffviewer/expand_link.html reviewboard/static/rb/js/views/diffFragmentQueueView.js Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/css/pages/diffviewer.less reviewboard/templates/reviews/boxes/review.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/utils/collapseButtonManager.js reviewboard/static/rb/css/pages/reviews.less reviewboard/static/lib/js/jquery.hoverIntent.min.js reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/templates/diffviewer/expand_link.html reviewboard/static/rb/js/views/diffFragmentQueueView.js
- Change Summary:
-
Update color of comment divider
- Commit:
-
07f1d2e9ac5e0f7dc3a3834b81d44e915bf7e5119f54bb018f60a317399a33791d1e8f71decfaf87
- Diff:
-
Revision 17 (+521 -151)
- Removed Files:
- Added Files:
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/css/pages/diffviewer.less reviewboard/templates/reviews/boxes/review.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/utils/collapseButtonManager.js reviewboard/static/rb/css/pages/reviews.less reviewboard/static/lib/js/jquery.hoverIntent.min.js reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/templates/diffviewer/expand_link.html reviewboard/static/rb/js/views/diffFragmentQueueView.js Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/css/pages/diffviewer.less reviewboard/templates/reviews/boxes/review.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/utils/collapseButtonManager.js reviewboard/static/rb/css/pages/reviews.less reviewboard/static/lib/js/jquery.hoverIntent.min.js reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/templates/diffviewer/expand_link.html reviewboard/static/rb/js/views/diffFragmentQueueView.js
- Change Summary:
-
Fix regression in diffviewer.
- Commit:
-
9f54bb018f60a317399a33791d1e8f71decfaf873e336b65efae41e16ef8cf45039ad1b7cd9804bc
- Diff:
-
Revision 18 (+518 -149)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/css/pages/diffviewer.less reviewboard/templates/reviews/boxes/review.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/utils/collapseButtonManager.js reviewboard/static/rb/css/pages/reviews.less reviewboard/static/lib/js/jquery.hoverIntent.min.js reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/templates/diffviewer/expand_link.html reviewboard/static/rb/js/views/diffFragmentQueueView.js Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/css/pages/diffviewer.less reviewboard/templates/reviews/boxes/review.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/js/diffviewer/views/diffReviewableView.js reviewboard/static/rb/js/utils/collapseButtonManager.js reviewboard/static/rb/css/pages/reviews.less reviewboard/static/lib/js/jquery.hoverIntent.min.js reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/templates/diffviewer/expand_link.html reviewboard/static/rb/js/views/diffFragmentQueueView.js
- Change Summary:
-
Fix jumpy button. Move back out of WIP status.
- Summary:
-
[WIP] Diff fragments in review comments can now be expanded and collapsed.Diff fragments in review comments can now be expanded and collapsed.
- Description:
-
Diff fragments can now be expanded in three ways:
- expanded above or below the current context by a fixed number of lines (20); - expanded up to the previous header (i.e., method definition); or - expanded completely above or below. After a diff fragment is expanded in one direction, it can be ~ collapsed in that direction. If there is still room for expansion, ~ it may be expanded again. ~ collapsed via a floating button that follows the viewport. If there is ~ still more of the diff to be expanded, it may be expanded again. The
comment_diff_fragments
view now takes an optional URL queryparameter, lines-of-context
, which indicates the number of linesabove and below that should be included in the fragment. Likewise, the build_diff_comment_fragments
now takes alines_of_context
parameter and uses that to calculate the first_line
andnum_lines
parameters forget_file_chunks_in_range
.The activity indicator functionality in
RB.apiCall
(inapiUtils.js
) has been refactored into another method in the samefile: RB.setActivityIndicator
. Asynchronous activity that does not~ involve API calls ~ involve API calls can use this method to enable or disable the + activity indicator. Add the
expand_fragment_link
andexpand_fragment_header_link
Django template tags. These tags create expansion links for use in diff fragments. These functions use a new template: reviews/expand_link.html
.Added Brian Cherne's hoverIntent jQuery plugin to the 3rd party static
bundles. The
DiffFragmentQueueView
(diffFragmentQueueView.js
) now handlesthe expansion and contraction of diff fragments. This view monitors for clicks on expansion and contraction buttons and dynamically adds a script tag which will replace the contents of the appropriate diff fragment with the same fragment, but with expanded (or contracted) context. The activity indicator is turned on when a diff fragment is requested and off when the requested fragment has been received. The expansion links for diff fragments are only shown when the mouse
is hovering over the comment container for that fragment. Once the mouse moves off the comment container, the expansion links will become hidden. The hoverIntent jQuery plugin ensures that clumsy mouse movements will not result in the controls toggling on and off repeatedly. - Refactor
DiffReviewableView._updateCollapseButtonPos
into a mixin:- CollapseButtonManagerMixin
. The updated method takes a selector to- use as to find the parent element, instead of the hardcoded tbody
- selector. This mixin is used in DiffFragmentQueueView
in addition to- DiffReviewableView
; it has been added to the static bundles.- The
ReviewBoxListView
now constructs theDiffFragmentQueueView
with an element ( #container
) on which it should listen for events.The diff fragment template (
diff_comment_fragment.html
) has beenmodified to only show 2 columns (instead of 4) when the file in the diff is a new file. This change makes the diff comment fragment viewer look more similar to the diffviewer. When a diff fragment is expanded to have context, the lines that have
~ been flagged for review will be surrounded above and below by a black ~ been flagged for review will be surrounded above and below by a gray border. - Commit:
-
3e336b65efae41e16ef8cf45039ad1b7cd9804bcabe19d68fa7fb9f2c4b668d381c563e673844b95
- Diff:
-
Revision 19 (+502 -40)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/css/pages/diffviewer.less reviewboard/templates/reviews/boxes/review.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/css/pages/reviews.less reviewboard/static/lib/js/jquery.hoverIntent.min.js reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/templates/diffviewer/expand_link.html reviewboard/static/rb/js/views/diffFragmentQueueView.js Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/css/pages/diffviewer.less reviewboard/templates/reviews/boxes/review.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/css/pages/reviews.less reviewboard/static/lib/js/jquery.hoverIntent.min.js reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/templates/diffviewer/expand_link.html reviewboard/static/rb/js/views/diffFragmentQueueView.js
-
I'd like a lot more detail on the test cases that you ran through, especially listing out any edge cases that you've tested (for example, what about comments at the beginning of a file? The end? A comment on a file that's only a single line?)
-
-
If you call
mark_safe()
here, you can avoid the |safe in the template. This should probably also be named something like 'text_html' in order to clarify that it's HTML and not plain text. -
-
-
This should probably be wrapped in a try/except in order to avoid 500s if a bogus query string is passed.
-
-
Can we add a non-minified version of this instead? When we compile it we'll minify, but having the original source will make it easier to debug for development.
I'm planning on migrating more of our 3rd-party code to using non-minified sources in the future.
-
-
-
-
-
We'd typically indent this as:
$chunks = $button .closest('.sidebyside') .children('tbody') .not('.diff-header');
-
-
-
-
-
-
-
-
You shouldn't need the conditional here because
setActivityIndicator
checksRB.ajaxOptions.enableIndicator
. -
-
-
-
- Change Summary:
-
Address the issues in David's review.
- Commit:
-
abe19d68fa7fb9f2c4b668d381c563e673844b9537b4a809e738a106261df9282ddcfb7eb8db2e6b
- Diff:
-
Revision 20 (+620 -43)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/css/pages/diffviewer.less reviewboard/static/lib/js/jquery.hoverIntent.js reviewboard/templates/reviews/boxes/review.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/css/pages/reviews.less reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/static/rb/js/views/diffFragmentQueueView.js Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/css/pages/diffviewer.less reviewboard/static/lib/js/jquery.hoverIntent.js reviewboard/templates/reviews/boxes/review.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/css/pages/reviews.less reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/static/rb/js/views/diffFragmentQueueView.js
-
-
Just to be safe, how about we escape the 'text' field here? You can use format_html to create HTML and escape all in one go.
-
Generally, in Python it's best to avoid lists in default arguments because any modification to that variable can end up changing your default argument for the next call. The usual pattern is:
def method(x=None): if x is None: x = [...]
That way you can later modify x without causing any strange bugs.
-
-
-
-
-
-
- Change Summary:
-
Fix issues in David's review.
- Commit:
-
37b4a809e738a106261df9282ddcfb7eb8db2e6bf6c38cd7f9e05ebe0af2430ad089e79a6c4fc313
- Diff:
-
Revision 21 (+630 -44)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/css/pages/diffviewer.less reviewboard/static/lib/js/jquery.hoverIntent.js reviewboard/templates/reviews/boxes/review.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/css/pages/reviews.less reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/static/rb/js/views/diffFragmentQueueView.js Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/css/pages/diffviewer.less reviewboard/static/lib/js/jquery.hoverIntent.js reviewboard/templates/reviews/boxes/review.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/css/pages/reviews.less reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/static/rb/js/views/diffFragmentQueueView.js
-
- Change Summary:
-
Formatting
- Commit:
-
f6c38cd7f9e05ebe0af2430ad089e79a6c4fc3136cef65aaf270e9b6285fc1215375d977bcc3a6e1
- Diff:
-
Revision 22 (+630 -44)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/css/pages/diffviewer.less reviewboard/static/lib/js/jquery.hoverIntent.js reviewboard/templates/reviews/boxes/review.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/css/pages/reviews.less reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/static/rb/js/views/diffFragmentQueueView.js Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/css/pages/diffviewer.less reviewboard/static/lib/js/jquery.hoverIntent.js reviewboard/templates/reviews/boxes/review.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/css/pages/reviews.less reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/static/rb/js/views/diffFragmentQueueView.js
- Change Summary:
-
Fix format_html call. TODO: Add more testing info.
- Bugs:
-
- Commit:
6cef65aaf270e9b6285fc1215375d977bcc3a6e1207ba0cbc75ea145bfd9af09bf63ef40d4707aa3- Diff:
Revision 23 (+630 -44)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/css/pages/diffviewer.less reviewboard/static/lib/js/jquery.hoverIntent.js reviewboard/templates/reviews/boxes/review.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/css/pages/reviews.less reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/static/rb/js/views/diffFragmentQueueView.js Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/css/pages/diffviewer.less reviewboard/static/lib/js/jquery.hoverIntent.js reviewboard/templates/reviews/boxes/review.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/css/pages/reviews.less reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/static/rb/js/views/diffFragmentQueueView.js
- Commit:
-
207ba0cbc75ea145bfd9af09bf63ef40d4707aa302a689052a13f6483995972861dfe993dfd65974
- Diff:
-
Revision 24 (+632 -44)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/css/pages/diffviewer.less reviewboard/static/lib/js/jquery.hoverIntent.js reviewboard/templates/reviews/boxes/review.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/css/pages/reviews.less reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/static/rb/js/views/diffFragmentQueueView.js Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/css/pages/diffviewer.less reviewboard/static/lib/js/jquery.hoverIntent.js reviewboard/templates/reviews/boxes/review.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/css/pages/reviews.less reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/static/rb/js/views/diffFragmentQueueView.js
- Change Summary:
-
Fix regression where fragments wouldnt expand.
Make controls hidden immediately instead of slide up on page load.
Add testing info.
- Testing Done:
-
Unit tests pass.
~ Tested expansion and contraction in both Firefox and Chrome.
~ Verified the following in Chrome and Firefox:
+ + - Expansion links are only visible if the diff fragment can be
expanded in that direction.
+ - When a review request is loaded, the expansion controls are hidden.
+ - Upon hovering over a diff fragment, the expansion controls expand.
+ - Upon stopping hovering over a diff fragment, this is a delay before
the expansion controls become hidden again.
+ - Upon stopping hovering over a diff fragment, if the mouse hovers
over the diff fragment again before the delay expires, the
expansion controls do not become hidden.
+ - Clicking on the "expand by 20" lines buttons expands the context by
20 lines in the appropriate direction.
+ - Click on the expand to header button expands to that header.
+ - Expanding multiple times expands upon the current context.
+ - The collapse button smoothly follows scrolling, staying in the
centre of the screen (if the fragment takes up the whole view) or
the centre of the fragment (if the fragment does not take up the
whole view).
+ - Clicking the collapse button makes all context hidden and removes
the collapse button.
+ - The lines originally flagged for review have a border around them.
+ - When the file is a new file, only one line number column is
visible.
+ - If upon contracting a diff fragment the mouse is no longer above
the fragment for a period, the diff fragment's controls will become
hidden.
+ + Also verified the following:
+ + - An invalid
lines_of_context
query parameter is interpreted as
0 lines of context above and below
+ - If too many
lines_of_context
query paramter values are passed
(e.g.,0,0,0,0
), it is interpreted as if only the first two
values were present.
+ - If the
lines_of_context
query parameter is passed with no value,
it is interpreted as0,0
+ - If the
lines_of_context
query parameter is passed with only one
value, it is interpreted as both the above and below context.
- Expansion links are only visible if the diff fragment can be
- Commit:
-
02a689052a13f6483995972861dfe993dfd6597441ef997751c942211d3bfdb4183ca0303ead0f7b
- Diff:
-
Revision 25 (+633 -44)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/css/pages/diffviewer.less reviewboard/static/lib/js/jquery.hoverIntent.js reviewboard/templates/reviews/boxes/review.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/css/pages/reviews.less reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/static/rb/js/views/diffFragmentQueueView.js Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/staticbundles.py Ignored Files: reviewboard/templates/reviews/expand_link.html reviewboard/static/rb/css/pages/diffviewer.less reviewboard/static/lib/js/jquery.hoverIntent.js reviewboard/templates/reviews/boxes/review.html reviewboard/static/rb/js/views/reviewBoxListView.js reviewboard/static/rb/js/utils/apiUtils.js reviewboard/static/rb/css/pages/reviews.less reviewboard/templates/reviews/diff_comment_fragment.html reviewboard/static/rb/js/views/diffFragmentQueueView.js
- Change Summary:
-
Fix typo
- Testing Done:
-
Unit tests pass.
Verified the following in Chrome and Firefox:
- Expansion links are only visible if the diff fragment can be
expanded in that direction.
- When a review request is loaded, the expansion controls are hidden.
- Upon hovering over a diff fragment, the expansion controls expand.
- Upon stopping hovering over a diff fragment, this is a delay before
the expansion controls become hidden again.
- Upon stopping hovering over a diff fragment, if the mouse hovers
over the diff fragment again before the delay expires, the
expansion controls do not become hidden.
- Clicking on the "expand by 20" lines buttons expands the context by
20 lines in the appropriate direction.
- Click on the expand to header button expands to that header.
- Expanding multiple times expands upon the current context.
- The collapse button smoothly follows scrolling, staying in the
centre of the screen (if the fragment takes up the whole view) or
the centre of the fragment (if the fragment does not take up the
whole view).
- Clicking the collapse button makes all context hidden and removes
the collapse button.
- The lines originally flagged for review have a border around them.
- When the file is a new file, only one line number column is
visible.
- If upon contracting a diff fragment the mouse is no longer above
the fragment for a period, the diff fragment's controls will become
hidden.
Also verified the following:
- An invalid
lines_of_context
query parameter is interpreted as
0 lines of context above and below
~ - If too many
lines_of_context
query paramter values are passed
(e.g.,0,0,0,0
), it is interpreted as if only the first two
values were present.
~ - If too many
lines_of_context
query parameter values are passed
(e.g.,0,0,0,0
), it is interpreted as if only the first two
values were present.
- If the
lines_of_context
query parameter is passed with no value,
it is interpreted as0,0
- If the
lines_of_context
query parameter is passed with only one
value, it is interpreted as both the above and below context.
- Expansion links are only visible if the diff fragment can be