• 
      

    Fix updating the diff index when switching diff pages from the bottom.

    Review Request #13314 — Created Oct. 6, 2023 and submitted

    Information

    Review Board
    release-6.x

    Reviewers

    When the diff file index is in docked mode, and the user switches which
    page was visible, we would hit an error and the file index would fail to
    update as the diff was loading, leaving every file showing a spinner.

    The problem is that when the page is scrolled, we redock the items table
    elsewhere onto the page. Inside the #update() method we would load all
    the new items, but then reset the #$items variable to be tr
    (grand)children of the view's element, which was empty because the table
    was a child of the banner instead.

    I've updated it to explicitly set #$items to be tr children of the
    items table. While in here, I realized that the way we're assembling the
    items table is quite inefficient, so I fixed this up to assemble all the
    child nodes first and then add them all to the DOM at the same time.

    • Ran js-tests.
    • Switched around between pages of a very large diff. Made sure that
      the paginators at both the top and bottom of the page worked
      correctly.
    Summary ID
    Fix updating the diff index when switching diff pages from the bottom.
    When the diff file index is in docked mode, and the user switches which page was visible, we would hit an error and the file index would fail to update as the diff was loading, leaving every file showing a spinner. The problem is that when the page is scrolled, we redock the items table elsewhere onto the page. Inside the `#update()` method we would load all the new items, but then reset the `#$items` variable to be `tr` (grand)children of the view's element, which was empty because the table was a child of the banner instead. I've updated it to explicitly set `#$items` to be `tr` children of the items table. While in here, I realized that the way we're assembling the items table is quite inefficient, so I fixed this up to assemble all the child nodes first and then add them all to the DOM at the same time. Testing Done: - Ran js-tests. - Switched around between pages of a very large diff. Made sure that the paginators at both the top and bottom of the page worked correctly.
    d045fec3393d211c483964f5e2d9c3c0c8379665
    chipx86
    1. Ship It!
    2. 
        
    david
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-6.x (c6b5e43)