Split per-fragment handling out of DiffFragmentQueueView.

Review Request #9117 - Created Aug. 3, 2017 and submitted

Christian Hammond
Review Board
release-3.0.x
d651403...
reviewboard

Originally, DiffFragmentQueueView's sole responsibility was to handle
the queueing and loading of fragments from the server and to inject
those fragments into the DOM. Over time, it's been expanded to handle
interaction on each fragment. This added to the complexity a bit,
requiring additional bookkeeping and expensive selectors that worked
across the whole page.

This change splits the per-fragment handling out of
DiffFragmentQueueView and into its own DiffFragmentView class. This
handles the hover controls and expansion/collapsing logic. The
mouse/click events and centered collapse button tracking are all handled
per-view now, allowing the event selectors and button bookkeeping to be
more efficient. The view now only keeps the CenteredElementManager
around when needed, and doesn't require a page-wide selector every time
there's an expansion/collapse.

Unit tests have been updated for DiffFragmentQueueView for some of the
new tracking, and new tests were added for DiffFragmentView.

Unit tests pass.

Manually tested that all hover, expansion, and collapsing logic all
worked correctly.

  • 0
  • 0
  • 2
  • 0
  • 2
Description From Last Updated
David Trowbridge
Christian Hammond
David Trowbridge
Christian Hammond
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (c0b046d)
Loading...