From 35e2302e0c03cef4af97a931eaaf03d9af3b445a Mon Sep 17 00:00:00 2001 From: Flotapponnier Date: Wed, 16 Sep 2026 14:27:24 +0200 Subject: [PATCH] bench page: chart config read across seeded variants; cache keys bumped so stale objects without Benchmark.chart do not keep the Head lag tab on Solana Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01HJgbZCqjR4nvCfcJSzofbw --- src/components/benchmark-body.tsx | 9 ++++++--- src/lib/spec.ts | 10 +++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/components/benchmark-body.tsx b/src/components/benchmark-body.tsx index e4b9b383..beea871e 100644 --- a/src/components/benchmark-body.tsx +++ b/src/components/benchmark-body.tsx @@ -310,10 +310,13 @@ export function BenchmarkBody({ // changes, so Solana on aggregator-head-lag opens on First to report // while Base keeps the head lag headline. A ?view= in the URL wins on // first paint; after that the chain tab drives it like a fresh visit. - const defaultPanelByChain = Object.values(variants)[0]?.chart?.defaultPanelByChain; + // The chart block is editorial and rides on whichever variant went + // through overlayEditorial; a URL-seeded filtered variant may not carry + // it, so look across every seeded variant rather than the first one. + const chartConfig = Object.values(variants).find((v) => v.chart)?.chart; + const defaultPanelByChain = chartConfig?.defaultPanelByChain; const hideHeadline = Boolean( - effectiveChain && - Object.values(variants)[0]?.chart?.hideHeadlineByChain?.includes(effectiveChain), + effectiveChain && chartConfig?.hideHeadlineByChain?.includes(effectiveChain), ); const urlViewPinned = useRef(Boolean(urlView)); useEffect(() => { diff --git a/src/lib/spec.ts b/src/lib/spec.ts index 1134fd8f..41e7ba07 100644 --- a/src/lib/spec.ts +++ b/src/lib/spec.ts @@ -402,7 +402,9 @@ const loadBenchmarkUnfilteredCached = unstable_cache( // v63: score_scope contested_chains on bench 008 changes its provider values. // v64: add bench 262 fiat-onramp-cost + On-ramps category. Bench SET grew. // v65: add bench 265 perp-pf-ratio (dev-only) + 5 providers on bench 234. Bench SET grew. - ["bench-unfiltered-v65", process.env.VERCEL_ENV === "production" ? "prod" : "all"], + // v66: Benchmark.chart (default_panel_by_chain, hide_headline_by_chain); cached + // objects without it kept the Head lag tab on Solana after the deploy. + ["bench-unfiltered-v66", process.env.VERCEL_ENV === "production" ? "prod" : "all"], { revalidate: 300, tags: ["benchmarks"] }, ); @@ -617,7 +619,8 @@ const loadAllBenchmarksCached = unstable_cache( // v57: lockstep with bench-unfiltered-v54 (add 6 new chain benches 216-221). // v59: lockstep with bench-unfiltered-v64 (add bench 262 fiat-onramp-cost). // v60: lockstep with bench-unfiltered-v65 (add bench 265 perp-pf-ratio). - ["all-benchmarks-v60", process.env.VERCEL_ENV === "production" ? "prod" : "all"], + // v61: lockstep with bench-unfiltered-v66 (Benchmark.chart). + ["all-benchmarks-v61", process.env.VERCEL_ENV === "production" ? "prod" : "all"], { revalidate: 300, tags: ["benchmarks"] }, ); export const loadAllBenchmarks = cache(loadAllBenchmarksCached); @@ -715,7 +718,8 @@ const loadBenchmarkFiltered = unstable_cache( // v21: bumped with bench-unfiltered-v46 (network-coverage split). // v23: lockstep with bench-unfiltered-v56 (keyed-rpc cleanup). // v24: lockstep with bench-unfiltered-v57 (drop rpc-keyed-latency). - ["bench-filters-v29", process.env.VERCEL_ENV === "production" ? "prod" : "all"], + // v30: lockstep with bench-unfiltered-v66 (Benchmark.chart on variants). + ["bench-filters-v30", process.env.VERCEL_ENV === "production" ? "prod" : "all"], { revalidate: 300, tags: ["benchmarks"] } );