Fix display of code blocks in change descriptions (djblets version).

Review Request #8363 — Created Aug. 30, 2016 and submitted

Information

Djblets
release-0.10.x
940a707...

Reviewers

The way full-width code blocks were shown in change descriptions was incorrect
(things were offset oddly to the left, and there was a big extra margin added
at the bottom).

The fix involves changes to both djblets and Review Board. This change contains
the djblets side, which changes the default margin to just un-do the extra
spacing added by the padding and border. Additional overrides to this default
margin can happen on a case-by-case basis, for example, to account for specific
padding within an editor, or flush display within fields.

Verified the appearance of full-width code blocks in:
- Review request fields.
- The change description field in the review request draft header.
- The change description field in change description boxes.
- Field change diffs in change description boxes.
- Comments and headers in the review dialog.
- Comments and headers in reviews.
- Draft replies to reviews.
- Diff comment flag pop-ups.

Checked that all affected text editors with full-width code blocks didn't have
any vertical jumps when opening or closing the editor.

Description From Last Updated

I don't think this is correct. I remember writing this logic, and doing so to fix rendering issues with code …

chipx86chipx86
reviewbot
  1. Tool: PEP8 Style Checker
    Ignored Files:
        djblets/static/djblets/css/mixins/markdown.less
    
    
    
    Tool: Pyflakes
    Ignored Files:
        djblets/static/djblets/css/mixins/markdown.less
    
    
  2. 
      
chipx86
  1. 
      
  2. djblets/static/djblets/css/mixins/markdown.less (Diff revision 1)
     
     
     
     
     
    Show all issues

    I don't think this is correct. I remember writing this logic, and doing so to fix rendering issues with code blocks in places.

    Your new logic is putting vertical margin values in the horizontal margin argument. It goes margin: vert horiz. It's not rotated 90 degrees here at all. In fact, the original rule still looks correct to me, so I think you're seeing something else.

    To feel comfortable with any changes to this rule, I'd want to see testing and screenshots for:

    • Change descriptions
    • Review request fields
    • Reviews
    • Review dialog
    • Tooltips for comment bubbles
    1. OK, after digging in a little more, I think the better thing to do is get rid of margin here and fix it specifically for the 4px added by the rows in the change description. I'll have updated changes in a moment...

    2. Okay. One thing to sanity-check is that text in a review request field or review doesn't vertically shift when you have code blocks. IIRC, this rule is partly there to prevent that.

    3. Hilariously enough, before I made any changes I was seeing vertical shifts when opening the editor.

  3. 
      
david
reviewbot
  1. Tool: Pyflakes
    Ignored Files:
        djblets/static/djblets/css/mixins/markdown.less
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        djblets/static/djblets/css/mixins/markdown.less
    
    
  2. 
      
david
reviewbot
  1. Tool: Pyflakes
    Ignored Files:
        djblets/static/djblets/css/mixins/markdown.less
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        djblets/static/djblets/css/mixins/markdown.less
    
    
  2. 
      
chipx86
  1. Ship It!
  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.10.x (cef2fd9)
Loading...