• Robert Knight's avatar
    Scroll new annotations into view · d0876bbd
    Robert Knight authored
    Re-implement the behavior to scroll newly created annotations into view
    in the sidebar so that the user can start editing them immediately.
    
    A complication with doing this given that the annotation list is
    virtualized is that if we want to scroll to the Nth visible annotation,
    we may not know the actual heights of the N-1 annotations above it.
    
    As a result of scrolling the list, some of the heights of those N-1
    annotations may be updated from an estimate to an actual measured
    height, changing the Y offset that we want to scroll to in order
    to make the Nth annotation visible.
    
    There are a few strategies that we could use for dealing with this:
    
     1. Forcibly render all N-1 annotations and measure their height.
        This is prohibitively expensive for long annotation lists.
    
     2. Use a cheaper method to calculate the exact height of an annotation.
        Unfortunately we don't have a way to do this at the moment.
    
     3. Use an iterative approach:
    
        a. Estimate the target position based on current known/guessed
           heights.
    
        b. Scroll to the estimated position, which will trigger re-rendering
           and possibly alter the known thread heights.
    
        c. Re-estimate the target position and if it changed, go to step b.
    
    This commit implements the third method.
    d0876bbd
Name
Last commit
Last update
..
about_this_version_dialog.html Loading commit data...
annotation.html Loading commit data...
annotation_share_dialog.html Loading commit data...
annotation_thread.html Loading commit data...
dropdown_menu_btn.html Loading commit data...
excerpt.html Loading commit data...
feedback_link.html Loading commit data...
group_list.html Loading commit data...
loggedout_message.html Loading commit data...
login_form.html Loading commit data...
markdown.html Loading commit data...
publish_annotation_btn.html Loading commit data...
search_status_bar.html Loading commit data...
share_dialog.html Loading commit data...
sidebar_tutorial.html Loading commit data...
signin_control.html Loading commit data...
sort_dropdown.html Loading commit data...
top_bar.html Loading commit data...
viewer.html Loading commit data...