From 0a826adf72e1cd23f2ee5a0e0d4d895ce9fdb1ce Mon Sep 17 00:00:00 2001 From: Xianpeng Shen Date: Fri, 7 Aug 2026 11:20:18 +0000 Subject: [PATCH] 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 Claude-Session: https://claude.ai/code/session_01U9zFxq8V4qxG4aMzJhGBFn --- README.md | 4 ++-- assets/logo.png | Bin 3001 -> 2822 bytes main.py | 13 ++++++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4af10a8..75d0c87 100644 --- a/README.md +++ b/README.md @@ -242,7 +242,7 @@ ran. Passing runs stay to one line, with the detail folded away: -> **Commit Check** +> **Commit Check** > > ✅ **All 3 checks passed** > @@ -266,7 +266,7 @@ Passing runs stay to one line, with the detail folded away: Failures open with a count, then a table of only the scopes that failed — every rule ID links to its documentation — with the full tree still one click away: -> **Commit Check** +> **Commit Check** > > ❌ **2 of 4 checks failed** > diff --git a/assets/logo.png b/assets/logo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0ccijU!CQjXAs!LY&GmC`V%Jti^M=9TY(&Is$z<;- z^L3rP19b6`3_tfx^6H1_rE^M0Tc|0oVQ7r_Q_j6Xuvaf)Gvc}C;hS(x+EZnkkGGF| zLn_TC1??)L-8>PB0b>)+Su-83i$qf(RWxorJ?cs&^#L?X5uT6@B8s|i&_$^bFf7Wrl4 zYZ&8H^y?zOpK3p+&&Mnfeff1_G09siZNx;WCh-ZQJg0FXy0Fq}%5=_8`?}T8DAu!f z@OvxX_Tkl@aU;p>($BwBs-F?xO7EIl$9}KRA{_zg$a86H2WU-SUY5ztSsO#GrtF1Q zK4$+Mi`+cLoE29mU_NWTuxPED!W$YQ>O-Wn1|Ec$WAa5lM!P4Wy6!4>|LKiUAo23> zSUt0fKQm5kW56u#Rw>MM`C1CbT1;AJyDoKwJIws?SWOWha^#LIBq(69k0M9Sy@jSS z1A}ND-wVzO*s>NhAg(`|xB1Y_M;+D(f?lY7w3BUgSr)FvZRm^aM4}K}CGYX|#FLc% z#8NcxBke?aM%^0Z6|dYKwILqzy|zYfa48oi4^B;pMovw04FAR>?Q=R2VD+BSmi_<2 zjacAR1J(;I*>R$LhsT;0*s(%bUTbVOsGZS$^&YLT69C)y97u2m2@&I(eGNyR?rdo!x}Eqx$<6$F5MIWmqU0{Qd>F|A(+if^8e`YE{{cdlm$Lu> diff --git a/main.py b/main.py index 477b4cd..1b5fde8 100755 --- a/main.py +++ b/main.py @@ -35,6 +35,13 @@ # cross-repository dependency, and as PNG rather than SVG because GitHub proxies # comment images through camo, which handles SVG unreliably. Point this at a # single org-wide asset if the other tools grow the same header. +# +# This is the org's *filled* mark (branding/avatar.png), not the transparent +# logo-mark. At this size a stroke has almost no visual weight -- the wordless +# mark rendered as a faint tick, worst on dark backgrounds -- while a filled +# tile holds up. It is the asset the branding README calls out as legible +# small, and the width below matches the h2 cap height so the icon is not +# smaller than the words next to it. LOGO_URL = ( "https://raw.githubusercontent.com/commit-check/commit-check-action/main/" "assets/logo.png" @@ -42,7 +49,7 @@ #: Report heading. h2 rather than h1: this renders inside a PR comment, where an #: h1 is louder than anything else on the page. -REPORT_TITLE = f'## Commit Check' +REPORT_TITLE = f'## Commit Check' #: Prefixes of report bodies written by earlier versions, kept so the first run #: 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: # Success: # # -# ## Commit Check +# ## Commit Check # # ✅ **All 5 checks passed** # @@ -592,7 +599,7 @@ def _scope_value(scope: ScopeResult, max_len: int = 60) -> str: # Failure: # # -# ## Commit Check +# ## Commit Check # # ❌ **1 of 5 checks failed** #