• Robert Knight's avatar
    Make top/bottom bucket scrolling work when using a custom bucket container · 6d76d194
    Robert Knight authored
    When using a custom bucket container, the top / bottom buckets may be positioned
    differently than the code previously assumed (137x px below the top of the
    viewport, 20px above the bottom). Redo the logic to work regardless of bucket
    container positioning. Instead of trying to determine whether an anchor is
    on-screen or not, just pick the anchor with the lowest bottom or highest top as
    the "nearest" one, depending on which direction we are scrolling in.
    
    This is implemented by:
    
     - Changing `Bucket` objects to record not just the tags from anchors in
       them, but the list of `AnchorPosition` objects from which the bucket
       was built. These objects include the top and bottom positions of the
       anchor.
    
     - Make clicking on the "Up" bucket search the anchor list for the
       anchor with the lowest bottom position, and send a request to the
       guest to scroll to that anchor.
    
     - Make clicking on the "Down" bucket search the anchor list for the
       anchor with the highest top position, and send a request to the
       guest to scroll to that anchor.
    
     - Removing all the logic for finding and scrolling to the "nearest
       off-screen anchor"
    6d76d194
port-rpc-events.d.ts 6.11 KB