From 54cae9d2c9c193909818b1a09d1524643eaffedc Mon Sep 17 00:00:00 2001 From: Flotapponnier Date: Tue, 15 Sep 2026 01:05:37 +0200 Subject: [PATCH] compare: per-card trend charts only on perp venue pairs, with a y axis Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01HJgbZCqjR4nvCfcJSzofbw --- src/app/compare/[slug]/page.tsx | 13 +++++++---- src/components/compare-trend-chart.tsx | 31 +++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/src/app/compare/[slug]/page.tsx b/src/app/compare/[slug]/page.tsx index 0b5279bb..37920584 100644 --- a/src/app/compare/[slug]/page.tsx +++ b/src/app/compare/[slug]/page.tsx @@ -897,6 +897,9 @@ export default async function ComparePage({ }; const comparisonProse = buildComparisonProse(shared, a.name, b.name); + const perpPair = + pair.hero === "perp-volume" || + (PERP_VOLUME_COHORT.has(a.slug) && PERP_VOLUME_COHORT.has(b.slug)); return (
@@ -981,8 +984,7 @@ export default async function ComparePage({ /> - {(pair.hero === "perp-volume" || - (PERP_VOLUME_COHORT.has(a.slug) && PERP_VOLUME_COHORT.has(b.slug))) && ( + {perpPair && ( ))} diff --git a/src/components/compare-trend-chart.tsx b/src/components/compare-trend-chart.tsx index 458b206c..c35c9369 100644 --- a/src/components/compare-trend-chart.tsx +++ b/src/components/compare-trend-chart.tsx @@ -106,8 +106,8 @@ export function CompareTrendChart({ } const W = 800; - const H = 150; - const PAD_L = 8; + const H = 170; + const PAD_L = 54; const PAD_R = 8; const PAD_T = 10; const PAD_B = 20; @@ -179,7 +179,32 @@ export function CompareTrendChart({ aria-label={`${aName} vs ${bName}, last ${range}`} onMouseLeave={() => setHover(null)} > - + {[0, 0.5, 1].map((f) => { + const v = min + f * span; + return ( + + + + {fmtUnit(v, unit)} + + + ); + })} {hover !== null && (