• 
      

    Improve the collapsing logic around entries with status updates.

    Review Request #9299 — Created Oct. 20, 2017 and submitted

    Information

    Review Board
    release-3.0.x
    0561fd7...

    Reviewers

    This updates the Initial Status Updates and Change entries to factor in
    the timestamp and state of any status updates when determining whether
    an entry should be collapsed.

    Both types of entries will be uncollapsed if there are any pending
    status updates. These updates are triggering periodic checks, and their
    entries might update while the user is viewing the page. We don't want
    to risk hiding the content by default by collapsing their boxes.

    They also both now factor in the user's last visited time. If the user
    has visited the page before, and the status update has been updated
    since that last visit, the entry won't be collapsed.

    The Initial Status Updates entry used to default to always stay expanded
    if there weren't any Change entries yet on the page. Now this only
    happens if the user has not visited the page before, ensuring that it's
    always shown by default for new visitors and for anonymous users, but
    that users who have already viewed the page will see it collapsed unless
    there's actual new content to show.

    Unit tests pass.

    Description From Last Updated

    I'm not sure this is a correct check for last_updated. Shouldn't that be comparing against None?

    daviddavid
    david
    1. 
        
    2. reviewboard/reviews/detail.py (Diff revision 1)
       
       
       
       
      Show all issues

      I'm not sure this is a correct check for last_updated. Shouldn't that be comparing against None?

      1. If there's a last_visited timestamp, collapsing will be based on the collapse result from the status updates. If there's no last_visited (either the first visit for authenticated users or any visit from anonymous users), we also consider whether there are change descriptions when deciding whether to collapse (so that the entry doesn't appear collapsed by default on the first view if the status updates collapse result is true unless there have been updates to the review request since).

    3. 
        
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-3.0.x (f1c6b07)