Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix tetris effect (holes) in read receipts #5697

Merged
merged 5 commits into from
Mar 2, 2021
Merged

Commits on Feb 27, 2021

  1. Update velocity-animate to the latest beta

    This is the primary change in this PR: the new beta (which has been untouched for a year as of writing) actually does a better job of handling concurrent read receipts, this patching holes. 
    
    The beta doesn't have the same leak as v1, so we can remove the metadata hack from our side (it doesn't use jQuery's data anymore).
    
    Note that this change on its own introduces an annoying bug where every second update to a read receipt will throw it 14px to the right - more on that in the next commit.
    turt2live committed Feb 27, 2021
    Configuration menu
    Copy the full SHA
    208faf6 View commit details
    Browse the repository at this point in the history
  2. Offset read receipt start positions by 1px

    As mentioned in 208faf6, the velocity-animate update causes read receipts to occasionally show up 14px to the right of where they should be. This is because the read receipt width is 14px, and velocity-animate will *not* translate `left` if it isn't changing. Unfortunately, it's smart enough to realize that `-0px` is `0px`, so we end up having to specify `1px`. 
    
    The comment already mentions it, but this should have no perceived effect for the user. During development I could not tell if the 1px was being applied during the animation, implying that it's a meaningless value. It's a bit unfortunate for those who know that it's translating left by 1px, but hopefully they'll be able to unsee that in time.
    turt2live committed Feb 27, 2021
    Configuration menu
    Copy the full SHA
    b3142d6 View commit details
    Browse the repository at this point in the history
  3. Put speed holes in the code

    We can make read receipts more efficient (and avoid double-animation) by using `PureComponent` which no-ops useless updates for us.
    turt2live committed Feb 27, 2021
    Configuration menu
    Copy the full SHA
    76ad93b View commit details
    Browse the repository at this point in the history
  4. Disable velocity mock option

    This appears to have been removed in the beta
    turt2live committed Feb 27, 2021
    Configuration menu
    Copy the full SHA
    0dd4d45 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e43853d View commit details
    Browse the repository at this point in the history