From 1805635666933bb4ed72a56550d0e4229b4782f0 Mon Sep 17 00:00:00 2001 From: Flotapponnier <160007691+Flotapponnier@users.noreply.github.com> Date: Sat, 25 Jul 2026 22:39:23 +0200 Subject: [PATCH 1/4] =?UTF-8?q?chart=20toolbar:=20drop=20Image/Video/Repor?= =?UTF-8?q?t=20page-header=20=E2=80=94=20icon-only=20inline=20next=20to=20?= =?UTF-8?q?Copy/DL=20in=20chart=20headerActions=20(#1447)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Florent Tapponnier --- src/app/benchmarks/[slug]/page.tsx | 34 +++++++++++++------------ src/components/benchmark-body.tsx | 16 ++++++++---- src/components/export-video-section.tsx | 5 ++-- src/components/report-section.tsx | 7 ++--- src/components/share-section.tsx | 5 ++-- 5 files changed, 37 insertions(+), 30 deletions(-) diff --git a/src/app/benchmarks/[slug]/page.tsx b/src/app/benchmarks/[slug]/page.tsx index a7170b75..6aa8ba96 100644 --- a/src/app/benchmarks/[slug]/page.tsx +++ b/src/app/benchmarks/[slug]/page.tsx @@ -481,22 +481,6 @@ export default async function BenchmarkPage({ All benchmarks - {!isDraft && ( -
- - - -
- )} {/* Bench identifier - minimal mono line, no SaaS-style pills. */} @@ -743,6 +727,24 @@ export default async function BenchmarkPage({ initialKind={kind ?? null} initialVenue={venue ?? null} hasLongHistory={benchmark.slug === "hyperliquid-frontends"} + pageActions={ + !isDraft ? ( + <> + + + + + ) : undefined + } /> )} diff --git a/src/components/benchmark-body.tsx b/src/components/benchmark-body.tsx index 8890d561..0798befe 100644 --- a/src/components/benchmark-body.tsx +++ b/src/components/benchmark-body.tsx @@ -148,6 +148,7 @@ export function BenchmarkBody({ initialKind = null, initialVenue = null, hasLongHistory = false, + pageActions, }: { variants: Record; chainOptions: ChainOption[]; @@ -165,6 +166,11 @@ export function BenchmarkBody({ * below the main ledger. Only set on benches whose harness ships a * long-window archive blob (currently: hyperliquid-frontends). */ hasLongHistory?: boolean; + /** Page-level toolbar (Image / Video / Report). Rendered inline in the + * chart's header row on the left of the ViewSwitcher so the sharing + * affordances sit visually next to the per-chart Copy / Download + * button instead of floating alone at the top of the page. */ + pageActions?: import("react").ReactNode; }) { // Read ?chain= / ?region= / ?kind= client-side. The server can't read these any // more (doing so would force /benchmarks/ to render dynamic on @@ -727,7 +733,7 @@ export function BenchmarkBody({ {view === "countLeaderboard" && ( } + headerActions={<>{pageActions}} /> )} {view === "rankedBar" && ( @@ -752,7 +758,7 @@ export function BenchmarkBody({ onResetExcluded={resetExcluded} disableTopN={hasLayerSplit} topNControl={topNControl} - headerActions={} + headerActions={<>{pageActions}} /> )} @@ -764,7 +770,7 @@ export function BenchmarkBody({ onResetExcluded={resetExcluded} disableTopN={hasLayerSplit} topNControl={topNControl} - headerActions={} + headerActions={<>{pageActions}} /> )} {view === "donut" && ( @@ -774,7 +780,7 @@ export function BenchmarkBody({ onToggleExclude={toggleExclude} disableTopN={hasLayerSplit} topNControl={topNControl} - headerActions={} + headerActions={<>{pageActions}} /> )} {view === "timeseries" && ( @@ -807,7 +813,7 @@ export function BenchmarkBody({ onResetExcluded={resetExcluded} disableTopN={hasLayerSplit} topNControl={topNControl} - headerActions={} + headerActions={<>{pageActions}} seriesOverride={activePanel?.seriesByProvider} seriesOverride7d={activePanel?.seriesByProvider7d} seriesOverride30d={activePanel?.seriesByProvider30d} diff --git a/src/components/export-video-section.tsx b/src/components/export-video-section.tsx index d0d1f80c..6585cbd5 100644 --- a/src/components/export-video-section.tsx +++ b/src/components/export-video-section.tsx @@ -91,10 +91,9 @@ function ExportVideoModal({ slug, title, benchmark }: Props) { onClick={() => setOpen(true)} aria-label="Export video" title="Export video" - className="inline-flex items-center gap-1.5 rounded-md border border-ink/15 bg-paper px-2.5 py-1 text-[11px] font-sans font-medium uppercase tracking-[0.1em] text-ink shadow-sm transition-colors hover:bg-paper-soft" + className="inline-flex items-center justify-center rounded-md border border-ink/15 bg-paper p-1.5 text-ink shadow-sm transition-colors hover:bg-paper-soft" > -