Split per-fragment handling out of DiffFragmentQueueView.
Review Request #858 — Created Sept. 11, 2017 and updated
Information | |
---|---|
guest6811 | |
Review Board | |
c0b046d... | |
Reviewers | |
a |
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`. Testing Done: Unit tests pass. Manually tested that all hover, expansion, and collapsing logic all worked correctly. Reviewed at https://reviews.reviewboard.org/r/9117/