This fixes a bug where the ScrollDownButton would continue to persist
even after jumping to the bottom.
This is due to undefined ordering in UIKit with how it handles
scrollViewDidScroll: and updating the collectionView's visible index
paths. We'd receive the final scrollViewDidScroll: before the visible
items were updated.
To fix this, we need to figure out what cell's are visible without
relying on UICollectionView's cell appearance to be up to date. This
instead uses the collection view layout's cell frames to determine if
they live in the visible content rect of the collection view. Since
layout must be available for the cell to be visible, this should be
correct.
Made some other minor changes around naming. Clarified that lastSortId
and lastIndexPath refer to the viewmodel's loaded window, not the
global thread state.
Our target index path should be determined after updating the
ConversationViewModel's window.
A more robust solution might involve pinning the bottom page to *always*
be loaded in the ConversationViewModel. But for now, this should fix the
assertion.