diff --git a/src/app/benchmarks/[slug]/share-card/route.tsx b/src/app/benchmarks/[slug]/share-card/route.tsx index 03fa36f7..54e3f34e 100644 --- a/src/app/benchmarks/[slug]/share-card/route.tsx +++ b/src/app/benchmarks/[slug]/share-card/route.tsx @@ -688,6 +688,7 @@ async function renderRanking( color: INK, letterSpacing: "-0.02em", lineHeight: 1.05, + flexShrink: 0, }} > {benchmark.title} @@ -699,6 +700,7 @@ async function renderRanking( color: INK_SOFT, lineHeight: 1.3, maxWidth: 980, + flexShrink: 0, }} > Product ranking by p50 · {benchmark.metric}. @@ -809,9 +811,13 @@ async function renderLeaderboard( colors: Map, chainLabel?: string | null ) { - const sorted = sortByP50(benchmark); + const sorted = sortByP50(benchmark).slice(0, 10); const maxP50 = Math.max(...sorted.map((r) => r.ms.p50)) || 1; - const subtitleLB = `Ranked by p50 · ${benchmark.metric}.`; + const total = benchmark.results.length; + const subtitleLB = + total > sorted.length + ? `Top ${sorted.length} of ${total} · ranked by p50 · ${benchmark.metric}.` + : `Ranked by p50 · ${benchmark.metric}.`; return new ImageResponse( ( @@ -832,6 +838,7 @@ async function renderLeaderboard( color: INK, letterSpacing: "-0.02em", lineHeight: 1.05, + flexShrink: 0, }} > {benchmark.title} @@ -842,6 +849,7 @@ async function renderLeaderboard( fontSize: 16, color: INK_SOFT, marginTop: 2, + flexShrink: 0, }} > {subtitleLB} @@ -852,7 +860,7 @@ async function renderLeaderboard( display: "flex", flexDirection: "column", flex: 1, - justifyContent: "center", + justifyContent: "flex-start", gap: 14, marginTop: 18, }} @@ -1012,6 +1020,7 @@ async function renderSnapshot( color: INK, letterSpacing: "-0.02em", lineHeight: 1.05, + flexShrink: 0, }} > {benchmark.title} @@ -1022,6 +1031,7 @@ async function renderSnapshot( fontSize: 16, color: INK_SOFT, maxWidth: 980, + flexShrink: 0, }} > {benchmark.subtitle} @@ -1313,6 +1323,7 @@ async function renderCompare( color: INK, letterSpacing: "-0.02em", lineHeight: 1.05, + flexShrink: 0, }} > {benchmark.title} · top 2