Skip to content

fix: drop the empty line between the group lines of a PR comment - #346

Merged
shenxianpeng merged 3 commits into
mainfrom
fix/pr-comment-line-spacing
Nov 19, 2026
Merged

shenxianpeng merged 3 commits into
mainfrom
fix/pr-comment-line-spacing

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

The group lines at the top of the PR comment (Pull request: passed, Commits: …, Branch: …) render with an empty line between each, so the comment looks loose and three times taller than it should. And each status mark sits about two pixels above its text.

  • Spacing. A PR comment turns every newline into a line break of its own, so <br> followed by a newline became two breaks. The lines are now joined by <br> alone. The job summary and the README render the same either way.
  • Alignment. The 16 px line marks used align="top". They now use align="absmiddle", which GitHub keeps, so the mark is centred on its line. The 24 px tile in the heading is unchanged.

Before and after

Rendered by GitHub's own Markdown API and shown in a real PR page:

Passing comment before and after

Failing comment before and after

Tests

  • The expected report lines in main_test.py now end in <br> with no newline, and the line marks in absmiddle.
  • 381 tests pass; ruff check and format are clean.

Summary by CodeRabbit

  • Bug Fixes
    • Status icons in reports now align vertically with their text, while tile images remain top-aligned.
    • Group summaries render together on a single line without extra gaps or trailing line breaks.
  • Documentation
    • Updated the README’s failing-run example to match the report’s icon alignment.

A pull request comment turns every newline into a line break, so the
"<br>" plus newline between the group lines rendered as an empty line
between each. Join them with "<br>" alone, and centre each line mark on
its text instead of aligning it to the top.
@shenxianpeng
shenxianpeng requested a review from a team as a code owner November 19, 2026 22:09
@shenxianpeng shenxianpeng added the bug Something isn't working label Nov 19, 2026 — with Claude
@shenxianpeng shenxianpeng self-assigned this Nov 19, 2026
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The report formatting now centers line status images vertically and emits group summaries with <br> separators without source newlines. The README examples and report tests reflect these output changes.

Changes: Report formatting

Layer / File(s) Summary
Status image alignment
main.py, README.md, main_test.py
Line status images now use absmiddle alignment. Tile images remain top-aligned. The README example and test expectation reflect the line-image alignment.
Group summary line formatting
main.py, main_test.py
Group summaries now use <br> separators without source newlines. The report example and golden test expectations reflect the updated output.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Possibly related PRs

Merge Risk: Minimal · up to 1172b

This is a cosmetic formatting change to PR comment reports, which now render more compactly with centered icons. No meaningful merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix: drop the empty line between the group lines of a PR comment" matches the main change. The summary shows that _group_lines now joins group summaries with <br> and no newline, and th…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix: drop the empty line between the group lines of a PR comment" matches the main change. The summary shows that _group_lines now joins group summaries with &lt;br&gt; and no newline, and the tests were updated to match. The title names the fix and the affected area (group lines in a PR comment). It does not mention the secondary change to align="absmiddle" for the status icons, but that is a minor aspect and the title does not conflict with it.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 96d28192-4d3a-4020-9dcc-0803804d0004
Commits

Reviewing files that changed from the base of the PR and between aa257f2 and 1172b17.

Files selected for processing: 3

  • README.md
  • main.py
  • main_test.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

✔ Commit Check passed

✔ Pull request: 2 passed
✔ Commits: 3 passed
✔ Author: 2 passed
✔ Branch: passed

All 8 checks
Pull request
  ✔ title        fix: drop the empty line between the group lines of a PR ...
  ✔ description
Commits
  ✔ 20e25bd      fix: drop the empty line between the group lines of a PR ...
  ✔ 6848ab4      docs: add before and after screenshots for the pull request
  ✔ 1172b17      docs: remove the pull request screenshots
Author
  ✔ name         Xianpeng Shen
  ✔ email        3353385+shenxianpeng@users.noreply.github.com
Branch
  ✔ branch       fix/pr-comment-line-spacing

Checked by Commit Check 2.22.0 · Rules · Check before you push

@github-actions github-actions Bot added the ai-assisted Written with the help of an AI tool label Nov 19, 2026
@codecov

codecov Bot commented Nov 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (aa257f2) to head (1172b17).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #346   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines         1119      1120    +1     
=========================================
+ Hits          1119      1120    +1     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shenxianpeng
shenxianpeng merged commit 3d46238 into main Nov 19, 2026
22 of 25 checks passed
@shenxianpeng
shenxianpeng deleted the fix/pr-comment-line-spacing branch November 19, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Written with the help of an AI tool bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant