codecov / codecov-browser-extension

A browser extension for Codecov. Works for Chrome and Firefox
Apache License 2.0
36 stars 11 forks source link

Display line coverage when viewing a pull request #3

Closed eliatcodecov closed 1 year ago

eliatcodecov commented 1 year ago

Line coverage on a Pull Request should be able to be toggled. This presents a difficult UI challenge since the SCM UI already uses red and green to indicate added and removed lines.

To prevent cluttering the Files Changed UI in the pull request, we propose only annotating lines added in the PR with coverage information, and using a border width and border color to do so. An example of an added line that is not covered by tests:

Image

Example HTML that could facilitate this:

<td id="diff-097ebdf15c614877bc0e7fdeb1f50cf97ad230009dc13f6d2a2832f3f524e3f6R19" data-line-number="19" title="Line not covered by tests" class="blob-num blob-num-addition js-linkable-line-number js-code-nav-line-number js-blob-rnum" style="
    border-color: red;
    border-right-width: 3px;
    border-style: solid;
    border-left-width: 0;
    border-top-width: 0;
    border-bottom-width: 0;
"></td>

Similarly, for a covered line:

Image

And partial coverage using color code #f4b01c:

Image

In the case of a partial, text on hover should read “Line partially covered by tests”.

eliatcodecov commented 1 year ago

Complete, but impacted by #26