Don't reload the diff viewer when changing revisions.
Review Request #4630 — Created Sept. 22, 2013 and submitted
Don't reload the diff viewer when changing revisions.
This change adds a new API resource called "diff-context" which can take the
same revision/interdiff parameters as the diffviewer view, but will return only
the JSON data needed to replace the page.This is wired up to some AJAX on the client side which will take the new
revision and change out all the data on the models. A backbone router will make
sure that the URL and browser history get appropriately updated.At the moment this can be a little annoying because our UI jumps around when
things like the current-revision label get replaced. I'll be reworking some of
these UI elements to make sure that they use up the same amount of vertical
space for different diff revisions.The next major steps, in addition to preventing things from jumping around, are
a redesign of the revision selector widget, and a redesign of how we do
pagination.
Loaded a bunch of different diff and interdiff revisions. Verified that all of
the appropriate UI elements (file index, files, revision label, revision
selector, comments hint) were updated in-place. Checked that pagination still
worked.
Description | From | Last Updated |
---|---|---|
'WebAPIResponse' imported but unused |
reviewbot | |
'webapi_response_errors' imported but unused |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (84 > 79 characters) |
reviewbot | |
undefined name 'Http404' |
reviewbot | |
Trailing comma. |
chipx86 | |
var parts |
mike_conley | |
Trailing comma. |
chipx86 | |
Can you go into more detail here, for the docs? I know it's meant for internal use, but we should … |
chipx86 | |
Missing a period. |
chipx86 | |
Needs to be revision, or it'll make Sphinx sad. (foo the beginning of a reference.) |
chipx86 | |
Can you add a docstring here as well, that goes into how this is used? |
chipx86 | |
Let's just pull this out so it doesn't have to be redefined every time. |
chipx86 | |
Can you format this like the other resources? Also, this should have the same key as the resource: return 200, … |
chipx86 | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
Col: 17 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
Col: 17 E126 continuation line over-indented for hanging indent |
reviewbot | |
Not sure we want to mention the JavaScript class in this comment. It doesn't really make sense in the API … |
chipx86 | |
""" on the next line. |
chipx86 | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
""" on the next line. |
chipx86 | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
This should still probably go in the main resource doc description. |
chipx86 | |
""" on the next line. |
chipx86 | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot |
-
This is a review from Review Bot.
Tool: Pyflakes
Processed Files:
reviewboard/webapi/resources/diff_context.py
reviewboard/webapi/resources/review_request.py
Ignored Files:
reviewboard/static/rb/js/pages/views/diffViewerPageView.js -
-
-
-
This is a review from Review Bot.
Tool: PEP8 Style Checker
Processed Files:
reviewboard/webapi/resources/diff_context.py
reviewboard/webapi/resources/review_request.py
Ignored Files:
reviewboard/static/rb/js/pages/views/diffViewerPageView.js
-
This is a review from Review Bot.
Tool: Pyflakes
Processed Files:
reviewboard/webapi/resources/diff_context.py
reviewboard/webapi/resources/review_request.py
Ignored Files:
reviewboard/static/rb/js/pages/views/diffViewerPageView.js
-
This also needs a doc file and an entry in resource-tree.txt.
-
-
Totally optional, but just a thought. If you don't want to use _.bind later (which is safe enough -- that'll just do the native bind() on a function on modern browsers anyway), you could pull out this.model instead of this and just reference that below.
-
-
Can you go into more detail here, for the docs? I know it's meant for internal use, but we should really flesh these out so it's clear if you don't have the source file in front of you.
-
-
-
-
-
Can you format this like the other resources? Also, this should have the same key as the resource:
return 200, { self.item_result_key: context['diff_context'], }
-
This is a review from Review Bot.
Tool: PEP8 Style Checker
Processed Files:
reviewboard/webapi/resources/diff_context.py
reviewboard/webapi/resources/review_request.py
Ignored Files:
docs/manual/webapi/2.0/resources/index.txt
docs/manual/webapi/2.0/resources/diff-context.txt
reviewboard/static/rb/js/pages/views/diffViewerPageView.js -
-
-
This is a review from Review Bot.
Tool: Pyflakes
Processed Files:
reviewboard/webapi/resources/diff_context.py
reviewboard/webapi/resources/review_request.py
Ignored Files:
docs/manual/webapi/2.0/resources/index.txt
docs/manual/webapi/2.0/resources/diff-context.txt
reviewboard/static/rb/js/pages/views/diffViewerPageView.js
-
This is a review from Review Bot.
Tool: PEP8 Style Checker
Processed Files:
reviewboard/webapi/resources/diff_context.py
reviewboard/webapi/resources/review_request.py
Ignored Files:
docs/manual/webapi/2.0/resources/index.txt
docs/manual/webapi/2.0/resources/diff-context.txt
reviewboard/static/rb/js/pages/views/diffViewerPageView.js -
-
-
This is a review from Review Bot.
Tool: Pyflakes
Processed Files:
reviewboard/webapi/resources/diff_context.py
reviewboard/webapi/resources/review_request.py
Ignored Files:
docs/manual/webapi/2.0/resources/index.txt
docs/manual/webapi/2.0/resources/diff-context.txt
reviewboard/static/rb/js/pages/views/diffViewerPageView.js
-
This is a review from Review Bot.
Tool: PEP8 Style Checker
Processed Files:
reviewboard/webapi/resources/diff_context.py
reviewboard/webapi/resources/review_request.py
Ignored Files:
docs/manual/webapi/2.0/resources/index.txt
docs/manual/webapi/2.0/resources/diff-context.txt
reviewboard/static/rb/js/pages/views/diffViewerPageView.js -
-
This is a review from Review Bot.
Tool: Pyflakes
Processed Files:
reviewboard/webapi/resources/diff_context.py
reviewboard/webapi/resources/review_request.py
Ignored Files:
docs/manual/webapi/2.0/resources/index.txt
docs/manual/webapi/2.0/resources/diff-context.txt
reviewboard/static/rb/js/pages/views/diffViewerPageView.js
-
-
Not sure we want to mention the JavaScript class in this comment. It doesn't really make sense in the API docs. It's more of an implementation detail on our end (even if this is considered more of an internally used API).
Given that this is the main description for the resource, I think we should move the bit about how this is internal into here.
-
-
This is a review from Review Bot.
Tool: PEP8 Style Checker
Processed Files:
reviewboard/webapi/resources/diff_context.py
reviewboard/webapi/resources/review_request.py
Ignored Files:
docs/manual/webapi/2.0/resources/index.txt
docs/manual/webapi/2.0/resources/diff-context.txt
reviewboard/static/rb/js/pages/views/diffViewerPageView.js -
-
This is a review from Review Bot.
Tool: Pyflakes
Processed Files:
reviewboard/webapi/resources/diff_context.py
reviewboard/webapi/resources/review_request.py
Ignored Files:
docs/manual/webapi/2.0/resources/index.txt
docs/manual/webapi/2.0/resources/diff-context.txt
reviewboard/static/rb/js/pages/views/diffViewerPageView.js
-
This is a review from Review Bot.
Tool: PEP8 Style Checker
Processed Files:
reviewboard/webapi/resources/diff_context.py
reviewboard/webapi/resources/review_request.py
Ignored Files:
docs/manual/webapi/2.0/resources/index.txt
docs/manual/webapi/2.0/resources/diff-context.txt
reviewboard/static/rb/js/pages/views/diffViewerPageView.js -
-
This is a review from Review Bot.
Tool: Pyflakes
Processed Files:
reviewboard/webapi/resources/diff_context.py
reviewboard/webapi/resources/review_request.py
Ignored Files:
docs/manual/webapi/2.0/resources/index.txt
docs/manual/webapi/2.0/resources/diff-context.txt
reviewboard/static/rb/js/pages/views/diffViewerPageView.js