Skip to content

feat(renderers): migrate renderLanguageCard to satori (phase 4)#55

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

feat(renderers): migrate renderLanguageCard to satori (phase 4)#55
evirunurm merged 4 commits into
feat/migrate-to-satorifrom
feat/migrate-lang-card-to-satori

Conversation

@evirunurm
Copy link
Copy Markdown
Owner

@evirunurm evirunurm commented Mar 20, 2026

Summary

  • Creates LanguageCard.tsx with a flexbox layout serving both pie (chartType: 'pie') and bar (chartType: 'bar') variants via a single component, following the same pattern as StatCard.tsx
  • Pie chart fallback: satori 0.25 supports neither conic-gradient nor SVG stroke-dasharray on <circle> elements in HTML context. The pie is pre-rendered as an inline SVG string (using the original stroke-dasharray layer technique) and embedded as a data:image/svg+xml;base64 URI in an <img> tag, which satori handles through its image renderer
  • Makes renderLanguageCard async in both renderLangPie.ts and renderLangPercent.ts; adds await in api/languages.ts

Closes #48

Test plan

  • Run npx jest scripts/renderers/renderLangCard.test.ts — 8 tests should pass (SVG output, correct dimensions, dark/white variants, pie vs bar difference, different users)
  • Run npx jest — all 31 tests should pass
  • npx tsc --noEmit — no type errors

🤖 Generated with Claude Code

- Create LanguageCard.tsx with flexbox layout for both pie and bar variants
- Pie chart uses pre-rendered SVG data URI (stroke-dasharray technique) since
  satori 0.25 does not support conic-gradient or SVG primitives natively
- Make renderLanguageCard async in both renderLangPie.ts and renderLangPercent.ts
- Await render calls in api/languages.ts
- Add renderLangCard.test.ts with 8 tests covering both chart types

Closes #48

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@evirunurm evirunurm self-assigned this Mar 20, 2026
@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 3:06pm

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

Language pie

Before

imageimage

After

imageimage

Language bars

Before

imageimage

After

imageimage

@evirunurm evirunurm merged commit 149cb34 into feat/migrate-to-satori Mar 20, 2026
2 checks passed
@evirunurm evirunurm deleted the feat/migrate-lang-card-to-satori branch March 20, 2026 15:10
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