Skip to content

feat(renderers): migrate renderStatCard to satori (phase 3)#52

Merged
evirunurm merged 10 commits into
feat/migrate-to-satorifrom
feat/migrate-stat-card-to-satori
Mar 20, 2026
Merged

feat(renderers): migrate renderStatCard to satori (phase 3)#52
evirunurm merged 10 commits into
feat/migrate-to-satorifrom
feat/migrate-stat-card-to-satori

Conversation

@evirunurm
Copy link
Copy Markdown
Owner

Summary

  • Add StatCard.tsx React component using flexbox column layout, replacing the old TextAttr/CardAttr interfaces and imperative mountText/mountIcons loops
  • Add scripts/assets/svgs/standalone/ — self-contained SVG files (with <svg> wrappers and viewBox) for use with satori's <img> data URI embedding, keeping the original partial fragments intact for renderLangPercent/renderLangPie
  • Convert renderStatCard to an async satori wrapper (same pattern as phase 2's renderErrorCard), update api/stats.ts to await it, and add renderStatCard.test.ts

Test plan

  • npm test passes (23 tests across 4 suites)
  • Dark mode card renders with correct background, stats, and GitHub cat icon
  • White mode card renders with inverted colors
  • Peng toggle produces different output

🤖 Generated with Claude Code

- Add StatCard.tsx React component using flexbox layout
- Replace TextAttr/CardAttr interfaces and imperative mountText/mountIcons loops
- Add standalone SVG assets with proper svg wrappers for satori img embedding
- Convert renderStatCard to async satori wrapper matching phase 2 pattern
- Add renderStatCard.test.ts with coverage for dimensions, variants, and peng toggle
- Update api/stats.ts to await the now-async renderStatCard

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
github-stats-uvqq Ready Ready Preview, Comment Mar 20, 2026 0:02am

- Move spacing from label string to value span to prevent satori from trimming it
- Reduce decorative corner image from 80x80 to 70x70 and push further into corner

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n size

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ard bounds

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
evirunurm and others added 3 commits March 20, 2026 03:03
Switch prettier to singleQuote and reformat StatCard.tsx accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@evirunurm
Copy link
Copy Markdown
Owner Author

Before migration
image

After migration
image

@evirunurm evirunurm merged commit 6c3570b into feat/migrate-to-satori Mar 20, 2026
2 checks passed
@evirunurm evirunurm deleted the feat/migrate-stat-card-to-satori branch March 20, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant