From 8f7b27f8066fb5c46d203eafae64eb83e160df1b Mon Sep 17 00:00:00 2001 From: shay Date: Wed, 6 May 2026 10:32:00 -0400 Subject: [PATCH] feat(grade): add footer attribution for visual consistency in widget --- generator/src/widgets/grade.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/generator/src/widgets/grade.py b/generator/src/widgets/grade.py index a35f4df..96fc8be 100644 --- a/generator/src/widgets/grade.py +++ b/generator/src/widgets/grade.py @@ -128,7 +128,13 @@ def render_grade_widget(data: GradeData, theme_name: str = "dark", settings: dic stats_y = 100 tags_y = stats_y + 54 tag_padding = 18 if tags_h > 24 else 14 + # Reserve space at the bottom for the "Generated with gh-stats" + # attribution. Matches the composite widget's footer convention so + # the standalone grade widget feels visually consistent when it's + # embedded on its own (the /api//grade.svg path). + footer_h = 16 card_h = (tags_y + tags_h + tag_padding) if data.tags else (stats_y + 54) + card_h += footer_h strengths = _top_strengths(data.breakdown) strengths_line = f"Strong in {' ยท '.join(strengths)}" if strengths else "" @@ -166,4 +172,12 @@ def render_grade_widget(data: GradeData, theme_name: str = "dark", settings: dic {tags_svg} ''' + # Footer attribution. Positioned in the inner-svg coordinate space + # (card_wrapper passes title="" here, so inner is not vertically + # offset). 8px above the bottom edge mirrors the composite widget. + inner += f''' + Generated with gh-stats''' + return card_wrapper(inner, 380, card_h, t, "")