Skip to content

Commit 0a826ad

Browse files
shenxianpengclaude
andcommitted
fix: give the report header a logo that survives being small
#259 swapped the old wordmark badge for the org's new mark, which was the right art but the wrong variant for this surface. The header renders the image at 20px, and the wordless mark is a stroke on transparency -- at that size a stroke carries almost no visual weight, so the header read as a faint tick rather than a mark. It is worst on GitHub's dark theme, where a thin brand-blue line sits close to the background. Two things were wrong, not one: * The variant. branding/logo-mark.png is documented for use "where a background already exists"; the comment header has none, so the mark had nothing to sit on. branding/avatar.png is the filled version and the one the branding README calls out as legible small. Using it here is what the asset is for. * The size. The report title is an h2, which GitHub renders at about 24px, so a 20px icon was smaller than the words beside it and lost the visual hierarchy before any question of contrast. So assets/logo.png is now a 128x128 downscale of avatar.png with the corners rounded (22%), and the width goes 20 -> 24 to match the h2 cap height. Rounding matters because GitHub rounds avatars in its own UI but not inline images; without it the header carries a hard blue square. Measured on the written file: RGBA preserved with the corners genuinely transparent (alpha 0 at 0,0 -- a flattened export would have shown 255 and rendered as a white box on dark), and the two dominant opaque colours are (44,156,205) = #2c9ccd and white, i.e. the brand blue and the check. 4994 -> 2822 bytes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U9zFxq8V4qxG4aMzJhGBFn
1 parent 5957b2f commit 0a826ad

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ ran.
242242

243243
Passing runs stay to one line, with the detail folded away:
244244

245-
> <img src="https://raw.githubusercontent.com/commit-check/commit-check-action/main/assets/logo.png" width="20" align="top" alt=""> **Commit Check**
245+
> <img src="https://raw.githubusercontent.com/commit-check/commit-check-action/main/assets/logo.png" width="24" align="top" alt=""> **Commit Check**
246246
>
247247
> ✅ **All 3 checks passed**
248248
>
@@ -266,7 +266,7 @@ Passing runs stay to one line, with the detail folded away:
266266
Failures open with a count, then a table of only the scopes that failed — every
267267
rule ID links to its documentation — with the full tree still one click away:
268268

269-
> <img src="https://raw.githubusercontent.com/commit-check/commit-check-action/main/assets/logo.png" width="20" align="top" alt=""> **Commit Check**
269+
> <img src="https://raw.githubusercontent.com/commit-check/commit-check-action/main/assets/logo.png" width="24" align="top" alt=""> **Commit Check**
270270
>
271271
> ❌ **2 of 4 checks failed**
272272
>

‎assets/logo.png‎

-179 Bytes
Loading

‎main.py‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,21 @@
3535
# cross-repository dependency, and as PNG rather than SVG because GitHub proxies
3636
# comment images through camo, which handles SVG unreliably. Point this at a
3737
# single org-wide asset if the other tools grow the same header.
38+
#
39+
# This is the org's *filled* mark (branding/avatar.png), not the transparent
40+
# logo-mark. At this size a stroke has almost no visual weight -- the wordless
41+
# mark rendered as a faint tick, worst on dark backgrounds -- while a filled
42+
# tile holds up. It is the asset the branding README calls out as legible
43+
# small, and the width below matches the h2 cap height so the icon is not
44+
# smaller than the words next to it.
3845
LOGO_URL = (
3946
"https://raw.githubusercontent.com/commit-check/commit-check-action/main/"
4047
"assets/logo.png"
4148
)
4249

4350
#: Report heading. h2 rather than h1: this renders inside a PR comment, where an
4451
#: h1 is louder than anything else on the page.
45-
REPORT_TITLE = f'## <img src="{LOGO_URL}" width="20" align="top" alt=""> Commit Check'
52+
REPORT_TITLE = f'## <img src="{LOGO_URL}" width="24" align="top" alt=""> Commit Check'
4653

4754
#: Prefixes of report bodies written by earlier versions, kept so the first run
4855
#: after upgrading adopts the existing comment instead of posting a second one.
@@ -567,7 +574,7 @@ def _scope_value(scope: ScopeResult, max_len: int = 60) -> str:
567574
# Success:
568575
#
569576
# <!-- commit-check-action -->
570-
# ## <img src="..." width="20" align="top" alt=""> Commit Check
577+
# ## <img src="..." width="24" align="top" alt=""> Commit Check
571578
#
572579
# ✅ **All 5 checks passed**
573580
#
@@ -592,7 +599,7 @@ def _scope_value(scope: ScopeResult, max_len: int = 60) -> str:
592599
# Failure:
593600
#
594601
# <!-- commit-check-action -->
595-
# ## <img src="..." width="20" align="top" alt=""> Commit Check
602+
# ## <img src="..." width="24" align="top" alt=""> Commit Check
596603
#
597604
# ❌ **1 of 5 checks failed**
598605
#

0 commit comments

Comments
 (0)