Simplify review thread markup and CSS.

Review Request #8391 — Created Sept. 8, 2016 and submitted

Information

Review Board
release-3.0.x
7108bc7...

Reviewers

This change dramatically improves the markup and CSS for review threads.
Specifically, instead of using <dl> for everything (which isn't semantically
correct), we wrap things in <ol> elements, and then individual comments are
broken up into <div>s with sensible classes. These are then styled with
consistent and simple spacing so that everything looks nice while also being
aligned. Replies to a comment are all indented a bit from that comment,
emphasizing the relationship in the way that most threaded displays work. One
particularly nice part of this change is that the text for comments is now
horizontally aligned with the avatar (the borders of the text area are
accounted for using negative margins).

Tested reviews with all sorts of different comments, and replies to those
reviews. Checked to make sure everything was aligned and spaced correctly.
Opened the editor for draft replies to verify that there were no jumps in the
position of the text.


Description From Last Updated

&.draft should go before any child selectors.

chipx86chipx86

Can we add a constant for this color?

chipx86chipx86

"could be simpler"

chipx86chipx86

No need for the space before data-context-id.

chipx86chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/models/review.py
        reviewboard/reviews/templatetags/reviewtags.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_reply_section.html
        reviewboard/templates/reviews/review_reply.html
        reviewboard/templates/reviews/boxes/review_body.html
        reviewboard/templates/reviews/boxes/review.html
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/js/views/reviewReplyEditorView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/models/review.py
        reviewboard/reviews/templatetags/reviewtags.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_reply_section.html
        reviewboard/templates/reviews/review_reply.html
        reviewboard/templates/reviews/boxes/review_body.html
        reviewboard/templates/reviews/boxes/review.html
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/js/views/reviewReplyEditorView.js
    
    
  2. 
      
chipx86
  1. Good cleanup. Just a few small comments.

  2. Show all issues

    &.draft should go before any child selectors.

    1. In this case I think I disagree. Ordinarily sure, but this &.draft doesn't have any rules that directly apply to the selected element. It only contains more child selectors. The result is that the first rules define the normal behavior, and these modify those for when there's a draft. Switching the order makes it less comprehensible.

      I'll add a comment.

    2. It doesn't right now, but if it did later we'd end up creating an inconsistency. We do this exact thing in other places already.

    3. Even in that case I would still argue for putting the general rules first and the ones that specialize individual aspects of those rules for specific states second.

  3. Show all issues

    Can we add a constant for this color?

  4. Show all issues

    "could be simpler"

  5. Show all issues

    No need for the space before data-context-id.

  6. 
      
david
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/models/review.py
        reviewboard/reviews/templatetags/reviewtags.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_reply_section.html
        reviewboard/templates/reviews/review_reply.html
        reviewboard/templates/reviews/boxes/review_body.html
        reviewboard/templates/reviews/boxes/review.html
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/js/views/reviewReplyEditorView.js
        reviewboard/static/rb/css/defs.less
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/models/review.py
        reviewboard/reviews/templatetags/reviewtags.py
    
    Ignored Files:
        reviewboard/templates/reviews/review_reply_section.html
        reviewboard/templates/reviews/review_reply.html
        reviewboard/templates/reviews/boxes/review_body.html
        reviewboard/templates/reviews/boxes/review.html
        reviewboard/static/rb/css/pages/reviews.less
        reviewboard/static/rb/js/views/reviewReplyEditorView.js
        reviewboard/static/rb/css/defs.less
    
    
  2. 
      
chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-3.0.x (c0be5e0)