From bb055773b4821b41c3eddda260d80ffe7a738107 Mon Sep 17 00:00:00 2001 From: Samuel Berthe Date: Tue, 14 Apr 2026 21:52:27 +0200 Subject: [PATCH] feat: add GitHub star nudges across the site MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Prepend attribution comment to "Copy all" exporter clipboard - Show inline ⭐ Star nudge on individual rule copy (3s, dismisses automatically) - Change StatsBar stars label to "engineers starred" for social proof - Add milestone progress bar toward 10k stars in StatsBar - Fix header/StatsBar showing "0" when SSR GitHub API fetch fails (use "—" placeholder) --- site/src/components/CopyButton.astro | 79 +++++++++++++++++------ site/src/components/ExporterSection.astro | 2 +- site/src/components/Header.astro | 2 +- site/src/components/RuleCard.astro | 2 +- site/src/components/StatsBar.astro | 56 ++++++++++++++-- 5 files changed, 112 insertions(+), 29 deletions(-) diff --git a/site/src/components/CopyButton.astro b/site/src/components/CopyButton.astro index 5a2e54e..dc4b1fa 100644 --- a/site/src/components/CopyButton.astro +++ b/site/src/components/CopyButton.astro @@ -1,31 +1,53 @@ --- +import { GITHUB_URL } from '../data/site'; + interface Props { targetId: string; label?: string; variant?: 'icon' | 'text'; class?: string; + withAttribution?: boolean; + nudge?: boolean; } -const { targetId, label = 'Copy', variant = 'icon', class: extraClass = '' } = Astro.props; +const { targetId, label = 'Copy', variant = 'icon', class: extraClass = '', withAttribution = false, nudge = false } = Astro.props; const btnId = `copy-btn-${targetId}`; +const nudgeId = `star-nudge-${btnId}`; --- {variant === 'icon' ? ( - + + + {nudge && ( + + )} + ) : (