Move more diff viewer logic and state into DiffViewerPage.
Review Request #9166 — Created Aug. 31, 2017 and submitted
RB.DiffViewerPageViewhas been responsible for a lot of state and
logic around loading in diffs from the server. This change moves some of
that down to the
RB.DiffViewerPagemodel. The model now handles
RB.DiffReviewablesand emitting events that the
view can use to know when to queue up the loading of diffs or when to
reset elements for a new set.
By moving state to the model, it'll be easier for the new review UI work
and the diff bookmarks features to better track and respond to updates
made on the page.
All unit tests pass.
Tested viewing several diffs, changing pages, and viewing different
Tested navigating via keybindings and the file list.
Tested commenting on lines.
Tested expanding/collapsing context in a diff.